{"id":11856,"date":"2020-09-24T11:32:17","date_gmt":"2020-09-24T11:32:17","guid":{"rendered":"https:\/\/codeandpepper.com\/?p=11856"},"modified":"2020-11-29T16:16:16","modified_gmt":"2020-11-29T16:16:16","slug":"infrastructure-as-code-deploying-web-applications-on-aws-cloudformation","status":"publish","type":"post","link":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/","title":{"rendered":"Infrastructure as Code: Creating and Deploying Web Applications on AWS Using CloudFormation"},"content":{"rendered":"\n<p>The cloud adoption trend isn\u2019t slowing down. That\u2019s no wonder: cloud computing has completely changed the way we think about <strong>IT infrastructure<\/strong>. However, for organizations that deal with never-ending deployments, the complexity of provisioning and managing all the infrastructure elements can become a headache and a source of serious issues. In this case, <strong>infrastructure codification, known as Infrastructure as Code<\/strong>, comes to the rescue.&nbsp;<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-infrastructure-as-code\">Why Infrastructure as Code?<\/h2>\n\n\n\n<p>The traditional way to create and manage cloud infrastructure is to do it manually from the cloud provider\u2019s web-based user interface (e.g. Azure portal or AWS Management Console). However, this solution has several defects: it\u2019s highly error-prone and non-replicable. Manual infrastructure management and provisioning can lead to a situation when a given infrastructure setup is a mystery, meaning that it\u2019s nearly impossible to recreate it.&nbsp;<\/p>\n\n\n\n<p>Imagine that you could treat your infrastructure the same way you handle code: writing commands in a code editor of your choice. <strong>That\u2019s exactly what Infrastructure as Code is about<\/strong>: it allows for automating the cloud infrastructure (servers, containers, databases, storage\u2026) provisioning with the use of a high-level, declarative programming language. Some solutions, e.g. <a href=\"https:\/\/aws.amazon.com\/cdk\/\">AWS CDK<\/a>, support also more familiar, general-purpose languages (TypeScript, JavaScript, <a href=\"https:\/\/codeandpepper.com\/services\/python-software-developers-outsourcing\">Python<\/a>, Java, C#, .NET), which makes defining infrastructure in the cloud even easier.&nbsp;<\/p>\n\n\n\n<p>IaC provides developers and other parties involved (DevOps specialists, testers, and even clients) with a number of benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>recreating test, production or dev environments using simple commands,<\/li><li>creating multiple environments at once,<\/li><li>using templates to speed up the whole process and make it error-free,<\/li><li>reducing the amount of repeated, manual work,<\/li><li>version control and keeping track of changes: code used as the infrastructure documentation,<\/li><li>advanced deployment options, such as <a href=\"https:\/\/aws.amazon.com\/quickstart\/architecture\/blue-green-deployment\/\">blue-green deployment<\/a> or <a href=\"https:\/\/martinfowler.com\/bliki\/CanaryRelease.html\">canary deployment<\/a>.<\/li><\/ul>\n\n\n\n<p>These are the reasons why IaC has become a must-have for many development teams, especially those that follow <strong>DevOps<\/strong> practices, such as the <a href=\"https:\/\/aws.amazon.com\/blogs\/mt\/leveraging-immutable-infrastructure-nubank\/\">immutable infrastructure<\/a> approach.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-aws-cloudformation\">What is AWS CloudFormation?<\/h2>\n\n\n\n<p>Nowadays, developers can choose between a plethora of tools, the most popular being <a href=\"https:\/\/www.terraform.io\/\">Terraform<\/a>, <a href=\"https:\/\/aws.amazon.com\/cloudformation\/\">AWS CloudFormation<\/a>, <a href=\"https:\/\/azure.microsoft.com\/en-us\/features\/resource-manager\/\">Azure Resource Manager<\/a>, <a href=\"https:\/\/aws.amazon.com\/cdk\/\">AWS Cloud Development Kit<\/a>. In today\u2019s article, we\u2019re going to talk about CloudFormation given that we\u2019re deploying an AWS application. Terraform will be covered in the second part of our IaC series.&nbsp;<\/p>\n\n\n\n<p>Getting straight to the point: <strong>CloudFormation<\/strong> is a tool for modeling and provisioning AWS and third-party <a href=\"https:\/\/codeandpepper.com\/services\/cloud-computing-software-development-and-consulting\/\">cloud infrastructure<\/a> resources in an automated manner. With CloudFormation, you can create templates to simplify tasks related to infrastructure management, replicate infrastructure across different projects, and easily track changes. You define cloud infrastructure by coding it from scratch or using one of the sample templates in text files, in either JSON or YAML format. Then you just upload the code to the Amazon S3 bucket (it can be done directly in the AWS CloudFormation console as well) and create a stack with CloudFormation. Let\u2019s dive into the hands-on tutorial to see a real-life example.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-deploying-a-web-app-on-aws-with-cloudformation\">Deploying a web app on AWS with CloudFormation<\/h2>\n\n\n\n<p>From this short guide, you will learn how to use CloudFormation and Infrastructure as Code to deploy your web application on <strong>Amazon Web Services cloud<\/strong>. In this case, we will create a production environment. Deploying to the development environment is very similar, and you can find the detailed tutorial on our <a href=\"https:\/\/github.com\/codeandpepper\/bestpicture\">Github<\/a> page, together with YAML files and all the required and optional code.<\/p>\n\n\n\n<p>In order to show how you can build infrastructure and deploy applications with CloudFormation, I\u2019ve created a simple web app called <em>Best Picture<\/em> showcasing Academy Award-winning movies.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"531\" src=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-1024x531.png\" alt=\"AWS web app front-end\" class=\"wp-image-13578\" srcset=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-1024x531.png 1024w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-300x155.png 300w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-768x398.png 768w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-1536x796.png 1536w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-361x187.png 361w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-193x100.png 193w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-720x373.png 720w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-864x448.png 864w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app-432x224.png 432w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-web-app.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>The front-end of our web app<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-application-architecture\">Application architecture<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"995\" src=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-1024x995.png\" alt=\"AWS web app architecture\" class=\"wp-image-13580\" srcset=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-1024x995.png 1024w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-300x292.png 300w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-768x747.png 768w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-215x209.png 215w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-103x100.png 103w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-720x700.png 720w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-864x840.png 864w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1-432x420.png 432w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/web-app-aws-architecture-1.png 1144w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Front-end<\/strong>: the client-facing side is written in <a href=\"https:\/\/codeandpepper.com\/services\/react-developers\/\">React.js<\/a> and uses the <a href=\"https:\/\/material-ui.com\/\">Material-UI<\/a> framework, as well as the <a href=\"https:\/\/www.apollographql.com\/docs\/react\/\">Apollo Client<\/a> (GraphQL library for JavaScript) for the front-end API. The JavaScript and HTML files are uploaded to the S3 bucket. <a href=\"https:\/\/aws.amazon.com\/cloudfront\/\">Amazon CloudFront<\/a> is used as the content delivery network, and the <a href=\"https:\/\/aws.amazon.com\/certificate-manager\/\">AWS Certificate Manager<\/a> provides an SSL certificate to ensure HTTPS access. Last but not least, the <a href=\"https:\/\/aws.amazon.com\/route53\/\">Amazon Route 53<\/a> allows for DNS configuration.<\/p>\n\n\n\n<p><strong>Back-end<\/strong>: GraphQL gateway with <a href=\"https:\/\/aws.amazon.com\/appsync\/\">AWS AppSync<\/a> is used to fetch data from the <a href=\"https:\/\/aws.amazon.com\/dynamodb\/\">Amazon DynamoDB<\/a> database, where the table with Academy Award-winning movies data is located.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-by-step-tutorial-deploying-to-production-environment\">Step-by-step tutorial: deploying to production environment<\/h3>\n\n\n\n<p>Now it\u2019s time to get your hands dirty and create our production environment. Remember to check and analyze the code that you can find in the <a href=\"https:\/\/github.com\/codeandpepper\/bestpicture\">repo<\/a>.&nbsp;<\/p>\n\n\n\n<p>First things first, prepare a DevOps S3 bucket, where you will copy a <strong>nested stack<\/strong> (i.e. a stack created within another stack) and back-end files, e.g. AWS AppSync GraphQL schema. In this demo, it\u2019s a public S3 bucket, but an <a href=\"https:\/\/aws.amazon.com\/premiumsupport\/knowledge-center\/secure-s3-resources\/\">additional configuration is recommended<\/a> for better security. Insert the following command in the AWS Command Line:<\/p>\n\n\n\n<p><code>cd .\\infrastructure\\<\/code><\/p>\n\n\n\n<p><code>.\\prepare-devops-bucket.bat<\/code><\/p>\n\n\n\n<p>Then, create the CloudFormation stack:<\/p>\n\n\n\n<p><code>aws cloudformation create-stack --stack-name prod --template-body file:\/\/stack.yaml --parameters ParameterKey=Environment,ParameterValue=prod --capabilities CAPABILITY_NAMED_IAM<\/code><\/p>\n\n\n\n<p>As you can see, with \u201cParameterKey \/ Value\u201d we define the environment. In this demo, it\u2019s production.<\/p>\n\n\n\n<p>You have to wait a few minutes until the infrastructure is created. You can go to the AWS console to check whether the process is finished or simply use this command:<\/p>\n\n\n\n<p><code>aws cloudformation wait stack-create-complete --stack-name prod<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"529\" src=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-1024x529.png\" alt=\"Infrastructure as Code: nested stack in CloudFormation\" class=\"wp-image-13585\" srcset=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-1024x529.png 1024w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-300x155.png 300w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-768x396.png 768w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-1536x793.png 1536w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-361x186.png 361w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-194x100.png 194w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-720x372.png 720w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-864x446.png 864w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack-432x223.png 432w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-nested-stack.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Nested stack view in AWS CloudFormation<\/figcaption><\/figure>\n\n\n\n<p>Now you should initialize the DynamoDB database. Change the folder to:<\/p>\n\n\n\n<p><code>cd ..\\backend\\DynamoDB<\/code><\/p>\n\n\n\n<p>Then get the name of the DynamoDB table with movies data:<\/p>\n\n\n\n<p><code>aws cloudformation describe-stacks --stack-name prod --query \"Stacks[0].Outputs[?OutputKey=='DynamoDBMoviesTableName'].OutputValue\" --output text<\/code><\/p>\n\n\n\n<p>Modify the table name inside the <em>Movies.json <\/em>file. Batch write items with the command:<\/p>\n\n\n\n<p><code>aws dynamodb batch-write-item --request-items file:\/\/Movies.json<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"529\" src=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-1024x529.png\" alt=\"Infrastructure as Code tool AWS CloudFormation\" class=\"wp-image-13586\" srcset=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-1024x529.png 1024w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-300x155.png 300w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-768x396.png 768w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-1536x793.png 1536w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-361x186.png 361w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-194x100.png 194w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-720x372.png 720w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-864x446.png 864w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table-432x223.png 432w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-dynamodb-table.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>DynamoDB table with movies data<\/figcaption><\/figure>\n\n\n\n<p>Now it\u2019s time to build and deploy the front-end (React) application. To do so, get the AppSync API URL and the API key either from the AWS console or by typing a command, and set environment variables using the values obtained:<\/p>\n\n\n\n<p><strong>API URL<\/strong><\/p>\n\n\n\n<p><code>aws cloudformation describe-stacks --stack-name prod --query \"Stacks[0].Outputs[?OutputKey=='AppSyncGraphQLApiUrl'].OutputValue\" --output text<\/code><\/p>\n\n\n\n<p>Use this output in the next command:<\/p>\n\n\n\n<p><code>$Env:REACT_APP_AWS_APPSYNC_GRAPHQL_API_URL = 'https:\/\/55gjvpd2pzcyxfdjprgmdbu2ri.appsync-api.eu-west-1.amazonaws.com\/graphql'<\/code><\/p>\n\n\n\n<p><strong>API Key<\/strong><\/p>\n\n\n\n<p><code>aws cloudformation describe-stacks --stack-name prod --query \"Stacks[0].Outputs[?OutputKey=='AppSyncApiKey'].OutputValue\" --output text<\/code><\/p>\n\n\n\n<p><code>$Env:REACT_APP_AWS_APPSYNC_API_KEY = '\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588'<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-1024x502.png\" alt=\"API outputs in AWS CloudFormation\" class=\"wp-image-13587\" srcset=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-1024x502.png 1024w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-300x147.png 300w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-768x377.png 768w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-1536x754.png 1536w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-361x177.png 361w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-200x98.png 200w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-720x353.png 720w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-864x424.png 864w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key-432x212.png 432w, https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/aws-api-key.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>API Key and URL can be also found in the AWS console<\/figcaption><\/figure>\n\n\n\n<p>Now, to complete the final steps, you can retrieve the stack outputs and set environment variables e.g. the S3 bucket name for static web hosting. This time, you can also do it in the AWS console or by using the command:<\/p>\n\n\n\n<p><code>aws cloudformation describe-stacks --stack-name prod --query \"Stacks[0].Outputs[?OutputKey=='WebAppBucketName'].OutputValue\" --output text<\/code><\/p>\n\n\n\n<p><code>cd ..\\..\\frontend<\/code><\/p>\n\n\n\n<p><code>yarn build<\/code><\/p>\n\n\n\n<p><code>aws s3 sync build\/ s3:\/\/bestpicture.link --acl public-read<\/code><\/p>\n\n\n\n<p>That\u2019s it: your web application on AWS is up and running!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-s-next\">What\u2019s next?<\/h2>\n\n\n\n<p>It\u2019s worth noting that CloudFormation is an AWS-only tool. So if you\u2019re keen on working with Infrastructure as Code on other cloud platforms such as Azure or Google Cloud, you might want to consider different tools. And I have good news: in our next blog post from the IaC series, we are going to talk about Terraform, or in other words, <em>CloudFormation on steroids<\/em>. We\u2019ll also provide a tutorial, so stay tuned!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The cloud adoption trend isn\u2019t slowing down. That\u2019s no wonder: cloud computing has completely changed the way we think about IT infrastructure. However, for organizations that deal with never-ending deployments, the complexity of provisioning and managing all the infrastructure elements can become a headache and a source of serious issues. In this case, infrastructure codification,<a class=\"moretag\" href=\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":11874,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1647],"tags":[1610,1609,1622],"class_list":["post-11856","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-aws","tag-cloud-computing","tag-iac"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper<\/title>\n<meta name=\"description\" content=\"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper\" \/>\n<meta property=\"og:description\" content=\"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\" \/>\n<meta property=\"og:site_name\" content=\"Code &amp; Pepper\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codeandpepper\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-24T11:32:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-29T16:16:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"625\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jacek Ko\u015bciesza\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codeandpepper\" \/>\n<meta name=\"twitter:site\" content=\"@codeandpepper\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jacek Ko\u015bciesza\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\"},\"author\":{\"name\":\"Jacek Ko\u015bciesza\",\"@id\":\"https:\/\/codeandpepper.com\/#\/schema\/person\/d052d96109fb3f3efedf8349fdd5c703\"},\"headline\":\"Infrastructure as Code: Creating and Deploying Web Applications on AWS Using CloudFormation\",\"datePublished\":\"2020-09-24T11:32:17+00:00\",\"dateModified\":\"2020-11-29T16:16:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\"},\"wordCount\":1101,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codeandpepper.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png\",\"keywords\":[\"AWS\",\"Cloud computing\",\"IaC\"],\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\",\"url\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\",\"name\":\"Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper\",\"isPartOf\":{\"@id\":\"https:\/\/codeandpepper.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png\",\"datePublished\":\"2020-09-24T11:32:17+00:00\",\"dateModified\":\"2020-11-29T16:16:16+00:00\",\"description\":\"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!\",\"breadcrumb\":{\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage\",\"url\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png\",\"contentUrl\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png\",\"width\":1200,\"height\":625},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codeandpepper.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Infrastructure as Code: Creating and Deploying Web Applications on AWS Using CloudFormation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codeandpepper.com\/#website\",\"url\":\"https:\/\/codeandpepper.com\/\",\"name\":\"Code & Pepper\",\"description\":\"FinTech Developers\",\"publisher\":{\"@id\":\"https:\/\/codeandpepper.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codeandpepper.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codeandpepper.com\/#organization\",\"name\":\"Code & Pepper\",\"url\":\"https:\/\/codeandpepper.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codeandpepper.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2019\/06\/logo.png\",\"contentUrl\":\"https:\/\/codeandpepper.com\/wp-content\/uploads\/2019\/06\/logo.png\",\"width\":319,\"height\":144,\"caption\":\"Code & Pepper\"},\"image\":{\"@id\":\"https:\/\/codeandpepper.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codeandpepper\/\",\"https:\/\/x.com\/codeandpepper\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codeandpepper.com\/#\/schema\/person\/d052d96109fb3f3efedf8349fdd5c703\",\"name\":\"Jacek Ko\u015bciesza\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codeandpepper.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1c2fdaa6e44d487ec39e727a89cc6aec99b7753fa227e5c65f836f3bbe1accc9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1c2fdaa6e44d487ec39e727a89cc6aec99b7753fa227e5c65f836f3bbe1accc9?s=96&d=mm&r=g\",\"caption\":\"Jacek Ko\u015bciesza\"},\"description\":\"CTO at Code &amp; Pepper. He got his Computer Science master\u2019s degree with honours from The Silesian University of Technology, where he also completed a PhD programme. Fascinated by electronics, he also completed a few semesters of the second faculty \u2013 Electronics and Telecommunication. He\u2019s got over 12 years of experience in the industry, performing different roles in startups, corporations and his own business. Being not only a developer, but also QA, technical lead and manager gave him unique insights into software development processes and great technical skills. He is a self-driven software engineer, fascinated by the newest technology. At Code &amp; Pepper, Jacek is responsible for the quality of products at the technical level. He leads the engineering department and helps improve software development competencies, skills and processes. He supports recruitment and sales processes from the technical point of view. In product development teams, he plays the role of a Solution Architect or Lead Developer.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/jacekkosciesza\"],\"url\":\"https:\/\/codeandpepper.com\/author\/j-koscieszacodeandpepper-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper","description":"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/","og_locale":"en_US","og_type":"article","og_title":"Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper","og_description":"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!","og_url":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/","og_site_name":"Code &amp; Pepper","article_publisher":"https:\/\/www.facebook.com\/codeandpepper\/","article_published_time":"2020-09-24T11:32:17+00:00","article_modified_time":"2020-11-29T16:16:16+00:00","og_image":[{"width":1200,"height":625,"url":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png","type":"image\/png"}],"author":"Jacek Ko\u015bciesza","twitter_card":"summary_large_image","twitter_creator":"@codeandpepper","twitter_site":"@codeandpepper","twitter_misc":{"Written by":"Jacek Ko\u015bciesza","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#article","isPartOf":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/"},"author":{"name":"Jacek Ko\u015bciesza","@id":"https:\/\/codeandpepper.com\/#\/schema\/person\/d052d96109fb3f3efedf8349fdd5c703"},"headline":"Infrastructure as Code: Creating and Deploying Web Applications on AWS Using CloudFormation","datePublished":"2020-09-24T11:32:17+00:00","dateModified":"2020-11-29T16:16:16+00:00","mainEntityOfPage":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/"},"wordCount":1101,"commentCount":0,"publisher":{"@id":"https:\/\/codeandpepper.com\/#organization"},"image":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage"},"thumbnailUrl":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png","keywords":["AWS","Cloud computing","IaC"],"articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/","url":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/","name":"Infrastructure as Code on AWS: CloudFormation | Code &amp; Pepper","isPartOf":{"@id":"https:\/\/codeandpepper.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage"},"image":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage"},"thumbnailUrl":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png","datePublished":"2020-09-24T11:32:17+00:00","dateModified":"2020-11-29T16:16:16+00:00","description":"How to automate your cloud infrastructure management with Infrastructure as Code tool: AWS CloudFormation? Check out this guide and step-by-step tutorial!","breadcrumb":{"@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#primaryimage","url":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png","contentUrl":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2020\/09\/infrastructure_as_code.png","width":1200,"height":625},{"@type":"BreadcrumbList","@id":"https:\/\/codeandpepper.com\/infrastructure-as-code-deploying-web-applications-on-aws-cloudformation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeandpepper.com\/"},{"@type":"ListItem","position":2,"name":"Infrastructure as Code: Creating and Deploying Web Applications on AWS Using CloudFormation"}]},{"@type":"WebSite","@id":"https:\/\/codeandpepper.com\/#website","url":"https:\/\/codeandpepper.com\/","name":"Code & Pepper","description":"FinTech Developers","publisher":{"@id":"https:\/\/codeandpepper.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeandpepper.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codeandpepper.com\/#organization","name":"Code & Pepper","url":"https:\/\/codeandpepper.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeandpepper.com\/#\/schema\/logo\/image\/","url":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2019\/06\/logo.png","contentUrl":"https:\/\/codeandpepper.com\/wp-content\/uploads\/2019\/06\/logo.png","width":319,"height":144,"caption":"Code & Pepper"},"image":{"@id":"https:\/\/codeandpepper.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codeandpepper\/","https:\/\/x.com\/codeandpepper"]},{"@type":"Person","@id":"https:\/\/codeandpepper.com\/#\/schema\/person\/d052d96109fb3f3efedf8349fdd5c703","name":"Jacek Ko\u015bciesza","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeandpepper.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1c2fdaa6e44d487ec39e727a89cc6aec99b7753fa227e5c65f836f3bbe1accc9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1c2fdaa6e44d487ec39e727a89cc6aec99b7753fa227e5c65f836f3bbe1accc9?s=96&d=mm&r=g","caption":"Jacek Ko\u015bciesza"},"description":"CTO at Code &amp; Pepper. He got his Computer Science master\u2019s degree with honours from The Silesian University of Technology, where he also completed a PhD programme. Fascinated by electronics, he also completed a few semesters of the second faculty \u2013 Electronics and Telecommunication. He\u2019s got over 12 years of experience in the industry, performing different roles in startups, corporations and his own business. Being not only a developer, but also QA, technical lead and manager gave him unique insights into software development processes and great technical skills. He is a self-driven software engineer, fascinated by the newest technology. At Code &amp; Pepper, Jacek is responsible for the quality of products at the technical level. He leads the engineering department and helps improve software development competencies, skills and processes. He supports recruitment and sales processes from the technical point of view. In product development teams, he plays the role of a Solution Architect or Lead Developer.","sameAs":["https:\/\/www.linkedin.com\/in\/jacekkosciesza"],"url":"https:\/\/codeandpepper.com\/author\/j-koscieszacodeandpepper-com\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/posts\/11856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/comments?post=11856"}],"version-history":[{"count":30,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/posts\/11856\/revisions"}],"predecessor-version":[{"id":17542,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/posts\/11856\/revisions\/17542"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/media\/11874"}],"wp:attachment":[{"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/media?parent=11856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/categories?post=11856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeandpepper.com\/wp-json\/wp\/v2\/tags?post=11856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}