<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zach Mowrey</title>
    <description>The latest articles on DEV Community by Zach Mowrey (@zachmowrey).</description>
    <link>https://dev.to/zachmowrey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F844192%2Ff3c16048-f126-4d01-be2b-de61c04d9a61.png</url>
      <title>DEV Community: Zach Mowrey</title>
      <link>https://dev.to/zachmowrey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zachmowrey"/>
    <language>en</language>
    <item>
      <title>Terraform V4 AWS Provider, Github Actions, and Named Profiles</title>
      <dc:creator>Zach Mowrey</dc:creator>
      <pubDate>Wed, 18 May 2022 12:42:24 +0000</pubDate>
      <link>https://dev.to/zachmowrey/terraform-v4-aws-provider-github-actions-and-named-profiles-2e8p</link>
      <guid>https://dev.to/zachmowrey/terraform-v4-aws-provider-github-actions-and-named-profiles-2e8p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Environment:&lt;/strong&gt; Github Actions&lt;br&gt;
&lt;strong&gt;Authentication:&lt;/strong&gt; configure-aws-credentials action, using OIDC.&lt;br&gt;
&lt;strong&gt;Terraform AWS Provider:&lt;/strong&gt; &amp;gt;= 4&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We want to use a named AWS profile for convenience in our local environments, but the named profile doesn't exist in our CI/CD pipelines, and we can't create it there (the necessary location isn't writable). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Issue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The V3 AWS Provider for Terraform would gracefully fall back in an attempt to find valid AWS credentials when it couldn't find credentials for a named profile.&lt;/p&gt;

&lt;p&gt;The V4 AWS Provider does not. Instead of following the AWS-CLI workflow for locating credentials, the V4 provider halts and returns an error: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;error configuring Terraform AWS Provider: failed to get shared config profile, XYZ&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MEj7K4Yj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ato0aqjujt6gaoq0e3wb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MEj7K4Yj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ato0aqjujt6gaoq0e3wb.png" alt="Image description" width="707" height="132"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Resolution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We set the profile dynamically in our Terraform code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new variable. Make it a bool, with a default of false. I called mine "pipeline". &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--beubStyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikkhsnf5pm6kz9p8unux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--beubStyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikkhsnf5pm6kz9p8unux.png" alt="Image description" width="264" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modify your provider's &lt;strong&gt;profile&lt;/strong&gt;. If we're in a pipeline, set the profile to "". Otherwise, you can set it to whatever value you had before.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ivt1O8iH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9l1aqr28qv1lockgdsn2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ivt1O8iH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9l1aqr28qv1lockgdsn2.png" alt="Image description" width="533" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>credential</category>
      <category>security</category>
      <category>git</category>
      <category>terraform</category>
    </item>
    <item>
      <title>PlannedBudgetLimits Cloudformation Example</title>
      <dc:creator>Zach Mowrey</dc:creator>
      <pubDate>Fri, 08 Apr 2022 12:46:41 +0000</pubDate>
      <link>https://dev.to/zachmowrey/plannedbudgetlimits-cloudformation-example-1llj</link>
      <guid>https://dev.to/zachmowrey/plannedbudgetlimits-cloudformation-example-1llj</guid>
      <description>&lt;p&gt;While working with an enterprise finance department to establish planned budget alarms in their multi-account environment, I reached for Cloudformation to help me avoid manually entering 1200 monthly budgets. &lt;/p&gt;

&lt;p&gt;The AWS documentation for planned budgets is fine, but the lack of an example and some explicit call-outs caused me to spin wheels while trying to find examples that would explain the error messages I kept getting. &lt;/p&gt;

&lt;p&gt;It's my hope the following sample will prove helpful to anyone else trying to do the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resources:

  # If you're managing multiple accounts, you'll probably want this resource name
  # to reflect the name of the target account.

  BudgetAccountNameHere:
    Type: "AWS::Budgets::Budget"
    Properties:
      Budget:
        TimeUnit: MONTHLY
        BudgetType: COST
        PlannedBudgetLimits:
          # Unix Timestamp of Start of Month, UTC.
          # You must provide a full 12-month list, starting with the current month.
          "1648771200":
            Amount: 100.00
            Unit: USD
          "1651363200":
            Amount: 100.00
            Unit: USD
          "1654041600":
            Amount: 100.00
            Unit: USD
          "1656633600":
            Amount: 100.00
            Unit: USD
          "1659312000":
            Amount: 100.00
            Unit: USD
          "1661990400":
            Amount: 100.00
            Unit: USD
          "1664582400":
            Amount: 100.00
            Unit: USD
          "1667260800":
            Amount: 100.00
            Unit: USD
          "1669852800":
            Amount: 100.00
            Unit: USD
          "1672531200":
            Amount: 100.00
            Unit: USD
          "1675209600":
            Amount: 100.00
            Unit: USD
          "1677628800":
            Amount: 100.00
            Unit: USD
        CostFilters:
          LinkedAccount:
            - YOUR_ACCOUNT_ID_HERE
      NotificationsWithSubscribers:
        - Notification:
            NotificationType: ACTUAL
            ComparisonOperator: GREATER_THAN
            Threshold: 99
          Subscribers:
            - SubscriptionType: EMAIL
              Address: YOUR_EMAIL_HERE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>aws</category>
      <category>cloudformation</category>
      <category>finops</category>
    </item>
  </channel>
</rss>
