<?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: Veronica Eulenberg</title>
    <description>The latest articles on DEV Community by Veronica Eulenberg (@happyviki).</description>
    <link>https://dev.to/happyviki</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%2F3920407%2Fe37b5b1c-0324-4ccc-8c9d-2ba54713c829.png</url>
      <title>DEV Community: Veronica Eulenberg</title>
      <link>https://dev.to/happyviki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/happyviki"/>
    <language>en</language>
    <item>
      <title>IaC AWS CloudFormation Stack Basics</title>
      <dc:creator>Veronica Eulenberg</dc:creator>
      <pubDate>Mon, 01 Jun 2026 20:24:58 +0000</pubDate>
      <link>https://dev.to/happyviki/iac-aws-cloudformation-stack-basics-3d88</link>
      <guid>https://dev.to/happyviki/iac-aws-cloudformation-stack-basics-3d88</guid>
      <description>&lt;p&gt;I'm almost done with my AWS Cloud Resume Challenge! Part of it is making a blog post about the process, but I wanted to make a separate post about Infrastructure as Code; this is new to me and I would like to understand it better.&lt;/p&gt;

&lt;p&gt;Making a CloudFormation stack template is also part of the challenge, but I would have done this even if it wasn't. I think it's cool to be able to start fresh, and then automate infrastructure setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing My Infra Automation Tool
&lt;/h2&gt;

&lt;p&gt;At first I wanted to use Infrastructure Composer, but that was overwhelming; too many different buttons to click.&lt;/p&gt;

&lt;p&gt;Then, I thought I would use IaC Generator. That was overwhelming and confusing because there are too many services, and I didn't know which ones to include.&lt;/p&gt;

&lt;p&gt;Finally, I decided to go with CDK, since I'm already a programmer, I thought this would be easier for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Cloud Development Kit
&lt;/h2&gt;

&lt;p&gt;I was right, sort of. I needed some practice deploying something simple first. I used ChatGPT, YouTube, and Stack Overflow (yes, I still read it!) to figure out how to deploy a simple S3 Bucket Website.&lt;/p&gt;

&lt;p&gt;I tried watching some one hour videos for a few minutes, but decided this wouldn't be very helpful for me, because I learn by doing, and I wanted the most simplest thing!&lt;/p&gt;

&lt;p&gt;Lucky for me, I found just the guy! He explained what I wanted to do in 15 minutes, and I was able to follow along really well. He did C# (I can comprehend C#), so I used ChatGPT to help me fix my translated JavaScript code and deploy with aws cdk cli.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=rmXI_kd_owQ" rel="noopener noreferrer"&gt;Getting Started With Infrastructure as Code (AWS CDK, CloudFormation)&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;Setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; aws-cdk
&lt;span class="nb"&gt;mkdir &lt;/span&gt;aws-resume
&lt;span class="nb"&gt;cd &lt;/span&gt;aws-resume
cdk init app &lt;span class="nt"&gt;--language&lt;/span&gt; javascript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code for creating/deleting all in public website s3 bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bucket name will be auto generated&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ResumeBucket&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;websiteIndexDocument&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;index.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// Allow anyone to see this bucket's content&lt;/span&gt;
  &lt;span class="na"&gt;publicReadAccess&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;blockPublicAccess&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;BlockPublicAccess&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;blockPublicAcls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;blockPublicPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;ignorePublicAcls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;restrictPublicBuckets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="c1"&gt;// Delete everything in bucket when this CF Stack is deleted!&lt;/span&gt;
  &lt;span class="na"&gt;autoDeleteObjects&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;removalPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;RemovalPolicy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DESTROY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Print URL after deploy is done&lt;/span&gt;
&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;cdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CfnOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WebsiteURL&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bucketWebsiteUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws login
cdk bootstrap
cdk deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I had to trouble shoot some things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upgrade aws cli to use &lt;code&gt;aws login&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;aws sts get-caller-identity&lt;/code&gt; to check my account info&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;vi ~/.aws/config&lt;/code&gt; and fix my region string
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;[&lt;span class="n"&gt;default&lt;/span&gt;]
&lt;span class="n"&gt;login_session&lt;/span&gt; = &lt;span class="n"&gt;arn&lt;/span&gt;:&lt;span class="n"&gt;aws&lt;/span&gt;:&lt;span class="n"&gt;iam&lt;/span&gt;::...
// &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;put&lt;/span&gt; &lt;span class="n"&gt;some&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt; &lt;span class="n"&gt;letters&lt;/span&gt; &lt;span class="n"&gt;here&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;mistake&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;CLI&lt;/span&gt;
&lt;span class="n"&gt;region&lt;/span&gt; = &lt;span class="n"&gt;us&lt;/span&gt;-&lt;span class="n"&gt;east&lt;/span&gt;-&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;Now that I've figured out how to deploy with cdk, I'm going to write out my whole aws resume infrastructure one service at a time. Not sure yet how to integrate my CI/CD, if I should still use GitHub Actions. And because I'm new to IaC, I don't know how updating the infrastructure works. I know, for example, I can add existing buckets to my &lt;code&gt;stack.js&lt;/code&gt; file. I would need to learn how to prevent configuration drift. Luckily there's a mod for that – Solutions Architect Mod: Blueprint Drift.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>infrastructureascode</category>
      <category>cloudresumechallenge</category>
      <category>cdk</category>
    </item>
  </channel>
</rss>
