{"id":1115,"date":"2021-07-24T20:11:04","date_gmt":"2021-07-25T03:11:04","guid":{"rendered":"https:\/\/bullyrooks.com\/?p=1115"},"modified":"2021-07-25T06:54:07","modified_gmt":"2021-07-25T13:54:07","slug":"automated-terraform-deploy-using-github-actions","status":"publish","type":"post","link":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/24\/automated-terraform-deploy-using-github-actions\/","title":{"rendered":"Automated Terraform Deploy Using Github Actions"},"content":{"rendered":"\n<p>Now we just need to build and deploy our application automatically so that whenever we push changes to the <code>main<\/code> branch, they&#8217;ll automatically become available through our endpoint.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create Our Artifact Storage<\/h2>\n\n\n\n<p>We&#8217;re going to use a &#8216;poor man&#8217;s artifactory&#8217; to store our compiled .jar files.  With our current build process our .jar files are lost every time we rebuild.  This might not be a good idea in case we need to rollback.  We&#8217;ll use an S3 bucket to store the artifacts.  And we&#8217;ll create that manually.<\/p>\n\n\n\n<p>First, create a generic S3 bucket.  Mine&#8217;s called <code>bullyrooks-zipped-artifacts<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"25\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-32-1024x27.png?resize=960%2C25&#038;ssl=1\" alt=\"\" class=\"wp-image-1117\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-32.png?resize=1024%2C27&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-32.png?resize=300%2C8&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-32.png?resize=768%2C20&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-32.png?w=1180&amp;ssl=1 1180w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Update the Terraform to Use the Artifact<\/h2>\n\n\n\n<p>Let&#8217;s start a new branch<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout -b \"deploy-workflow\"<\/code><\/pre>\n\n\n\n<p>Now update our terraform to use the artifact from the bucket<\/p>\n\n\n\n<p>Add variables to <code>variables.tf<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>variable \"s3_artifact_bucket\" {\r\n  default = \"bullyrooks-zipped-artifacts\"\r\n}\r\n#this key should never exist\r\nvariable \"s3_artifact_key\" {\r\n  default = \"bullyrooks\/helloworld-lambda\/helloworld-lambda-0.0.1-SNAPSHOT-aws.jar\"\r\n}<\/code><\/pre>\n\n\n\n<p>and update the <code>main.tf<\/code> to pull the artifact from the bucket<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>resource \"aws_lambda_function\" \"tf-helloWorld\" {\r\n  function_name = \"helloWorld-lambda\"\r\n<span class=\"has-inline-color has-vivid-red-color\">  s3_bucket = var.s3_artifact_bucket\r\n  s3_key = var.s3_artifact_key<\/span>\r\n  role = aws_iam_role.iam_for_helloWorld_lambda.arn\r\n  handler = \"org.springframework.cloud.function.adapter.aws.SpringBootApiGatewayRequestHandler::handleRequest\"\r\n  memory_size = 512\r\n  timeout = 15\r\n\r\n  runtime = \"java11\"\r\n\r\n  depends_on = &#91;\r\n    aws_iam_role_policy_attachment.helloWorld-log-attach,\r\n    aws_cloudwatch_log_group.helloWorld-logs,\r\n  ]\r\n\r\n  environment {\r\n    variables = {\r\n      FUNCTION_NAME = \"apiFunction\"\r\n    }\r\n  }\r\n}\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Create the Github Action<\/h2>\n\n\n\n<p>  <\/p>\n\n\n\n<p>In your project root, create a directory called <code>.github\/workflows<\/code> and add a file there called <code>main.yml<\/code> with this content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># This is a basic workflow to help you get started with Actions\r\n\r\nname: helloworld-lambda-cicd\r\n\r\n# Controls when the action will run. Triggers the workflow on push or pull request\r\n# events but only for the develop branch\r\non:\r\n  push:\r\n    branches: &#91; main ]\r\n\r\n# A workflow run is made up of one or more jobs that can run sequentially or in parallel\r\njobs:\r\n  # This workflow contains a single job called \"build\"\r\n  build:\r\n    # The type of runner that the job will run on\r\n    runs-on: ubuntu-latest\r\n    timeout-minutes: 30\r\n\r\n    # Steps represent a sequence of tasks that will be executed as part of the job\r\n    steps:\r\n      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it\r\n      - uses: actions\/checkout@v2\r\n      - name: Set up JDK 11\r\n        uses: actions\/setup-java@v2\r\n        with:\r\n          java-version: '11'\r\n          distribution: 'adopt'\r\n      - name: Cache Maven packages\r\n        uses: actions\/cache@v2\r\n        with:\r\n          path: ~\/.m2\r\n          key: ${{ runner.os }}-m2-${{ hashFiles('**\/pom.xml') }}\r\n          restore-keys: ${{ runner.os }}-m2\r\n      - name: Build with Maven\r\n        run: mvn --batch-mode --update-snapshots package\r\n      - name: Upload shaded jar\r\n        uses: actions\/upload-artifact@v2\r\n        with:\r\n          name: jar\r\n          path: target\/helloworld-lambda-0.0.1-SNAPSHOT-aws.jar\r\n  upload:\r\n    runs-on: ubuntu-latest\r\n    needs: build\r\n    steps:\r\n      - name: Make artifact directory\r\n        run: mkdir -p .\/artifacts\/${{ github.repository }}\r\n\r\n      - name: Download jar\r\n        uses: actions\/download-artifact@v2\r\n        with:\r\n          name: jar\r\n          path: artifacts\/${{ github.repository }}\r\n\r\n      - name: Display structure of downloaded files\r\n        run: ls -R\r\n        working-directory: artifacts\/${{ github.repository }}\r\n\r\n      - name: Rename jar\r\n        run: |\r\n          mv artifacts\/${{ github.repository }}\/helloworld-lambda-0.0.1-SNAPSHOT-aws.jar artifacts\/${{ github.repository }}\/${{ github.sha }}.jar\r\n\r\n      - name: Push Zip to S3\r\n        uses: jakejarvis\/s3-sync-action@v0.3.1\r\n        env:\r\n          SOURCE_DIR: '.\/artifacts'\r\n          AWS_REGION: 'us-east-1'\r\n          AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}\r\n          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\r\n          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\r\n  deploy:\r\n    runs-on: ubuntu-latest\r\n    needs: upload\r\n    steps:\r\n      - name: Checkout\r\n        uses: actions\/checkout@v2\r\n      - name: Install Terraform\r\n        env:\r\n          TERRAFORM_VERSION: \"1.0.2\"\r\n        run: |\r\n          tf_version=$TERRAFORM_VERSION\r\n          wget https:\/\/releases.hashicorp.com\/terraform\/\"$tf_version\"\/terraform_\"$tf_version\"_linux_amd64.zip\r\n          unzip terraform_\"$tf_version\"_linux_amd64.zip\r\n          sudo mv terraform \/usr\/local\/bin\/\r\n      - name: Verify Terraform version\r\n        run: terraform --version\r\n        working-directory: tf\r\n      - name: Terraform Init\r\n        env:\r\n          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\r\n          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\r\n        run: terraform init -input=false\r\n        working-directory: tf\r\n      - name: Terraform Apply\r\n        env:\r\n          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\r\n          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\r\n          TF_VAR_s3_artifact_bucket: ${{ secrets.AWS_BUCKET_NAME }}\r\n          TF_VAR_s3_artifact_key: ${{ github.repository }}\/${{ github.sha }}.jar\r\n        run: terraform apply -auto-approve -input=false\r\n        working-directory: tf<\/code><\/pre>\n\n\n\n<p>I&#8217;ll walk you through the code:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"114\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-33.png?resize=678%2C114&#038;ssl=1\" alt=\"\" class=\"wp-image-1118\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-33.png?w=678&amp;ssl=1 678w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-33.png?resize=300%2C50&amp;ssl=1 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" data-recalc-dims=\"1\" \/><figcaption>execute this workflow when a push happens on the main branch<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"485\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-34.png?resize=679%2C485&#038;ssl=1\" alt=\"\" class=\"wp-image-1119\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-34.png?w=679&amp;ssl=1 679w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-34.png?resize=300%2C214&amp;ssl=1 300w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" data-recalc-dims=\"1\" \/><figcaption>setup java 11 to compile with, cache maven repository so that we don&#8217;t have to keep rebuilding it between builds (makes it run faster), build the .jar (<code>mvn --batch-mode --update-snapshots package<\/code>) and then upload it into &#8216;local&#8217; storage so that we can reuse it in the next job<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"591\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-46.png?resize=960%2C591&#038;ssl=1\" alt=\"\" class=\"wp-image-1131\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-46.png?w=1023&amp;ssl=1 1023w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-46.png?resize=300%2C185&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-46.png?resize=768%2C473&amp;ssl=1 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><figcaption>download the .jar from the last job, put it in a directory with github project name and this commit sha as the jar name and then do a &#8216;real&#8217; upload to the s3 bucket.  This will put it in the bucket with the correct directory structure<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"684\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-43.png?resize=802%2C684&#038;ssl=1\" alt=\"\" class=\"wp-image-1128\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-43.png?w=802&amp;ssl=1 802w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-43.png?resize=300%2C256&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-43.png?resize=768%2C655&amp;ssl=1 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" data-recalc-dims=\"1\" \/><figcaption>download and install terraform into the build machine, run init and apply against our terraform configuration in the \/tf directory.  The important part here is that we&#8217;re using environment variables to overwrite the variables we defined in the terraform.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Secrets<\/h2>\n\n\n\n<p>As you can see, we&#8217;re using a bunch of secrets which we&#8217;ll need to setup now.  Log into your Github account, navigate to the project repository and click on <code>Settings<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"124\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-37.png?resize=944%2C124&#038;ssl=1\" alt=\"\" class=\"wp-image-1122\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-37.png?w=944&amp;ssl=1 944w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-37.png?resize=300%2C39&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-37.png?resize=768%2C101&amp;ssl=1 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Open the <code>Secrets<\/code> tab and click on <code>New repository secret<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"452\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-38-1024x482.png?resize=960%2C452&#038;ssl=1\" alt=\"\" class=\"wp-image-1123\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-38.png?resize=1024%2C482&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-38.png?resize=300%2C141&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-38.png?resize=768%2C362&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-38.png?w=1276&amp;ssl=1 1276w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>We need to make 3 secrets <code>AWS_ACCESS_KEY_ID<\/code>, <code>AWS_SECRET_ACCESS_KEY<\/code> and <code>AWS_BUCKET_NAME<\/code><\/p>\n\n\n\n<p> <code>AWS_BUCKET_NAME<\/code> will be the name of the bucket you created (<code>bullyrooks-zipped-artifacts<\/code>) and access and secret key will be from your credentials file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Commit and Merge<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git status\n$ git add .\n$ git commit -m \"build and deploy\"\n$ git push --set-upstream origin deploy-workflow\n$ git checkout main\n$ git merge deploy-workflow\n$ git push<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Review the Actions <\/h2>\n\n\n\n<p>This should have kicked off a workflow<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"336\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41-1024x358.png?resize=960%2C336&#038;ssl=1\" alt=\"\" class=\"wp-image-1126\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41.png?resize=1024%2C358&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41.png?resize=300%2C105&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41.png?resize=768%2C269&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41.png?resize=1536%2C537&amp;ssl=1 1536w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-41.png?w=1556&amp;ssl=1 1556w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Eventually, it should succeed (I had to make a few changes to get it working correctly)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"340\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44-1024x363.png?resize=960%2C340&#038;ssl=1\" alt=\"\" class=\"wp-image-1129\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44.png?resize=1024%2C363&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44.png?resize=300%2C106&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44.png?resize=768%2C272&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44.png?resize=1536%2C544&amp;ssl=1 1536w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-44.png?w=1541&amp;ssl=1 1541w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Now go grab the API Gateway URL from the lambda configuration and confirm this new endpoint works<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"309\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-45-1024x330.png?resize=960%2C309&#038;ssl=1\" alt=\"\" class=\"wp-image-1130\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-45.png?resize=1024%2C330&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-45.png?resize=300%2C97&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-45.png?resize=768%2C247&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-45.png?w=1165&amp;ssl=1 1165w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nNow we just need to build and deploy our application automatically so&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/bullyrooks.com\/index.php\/2021\/07\/24\/automated-terraform-deploy-using-github-actions\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Automated Terraform Deploy Using Github Actions&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[142,146,77,148,44,147,144,143,50,42,43,145],"course":[141],"class_list":["post-1115","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-aws","tag-aws-gateway","tag-cicd","tag-functions","tag-github","tag-github-actions","tag-java","tag-lambda","tag-maven","tag-spring","tag-spring-boot","tag-terraform","course-spring-boot-lambda-on-aws","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1102,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/24\/terraform-centralized-state-management\/","url_meta":{"origin":1115,"position":0},"title":"Terraform Centralized State Management","author":"Bullyrook","date":"July 24, 2021","format":false,"excerpt":"As we saw in the last course Terraform will manage the state of your application, but by default it stores this locally. This is not ideal for us and will cause problems when we try to work with others or create a continuous deployment pipeline. Now we'll create a way\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-23.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-23.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-23.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-23.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-23.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1094,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/24\/terraform-setup-and-first-install\/","url_meta":{"origin":1115,"position":1},"title":"Terraform Setup and First Install","author":"Bullyrook","date":"July 24, 2021","format":false,"excerpt":"Terraform is a system that allows you to define your infrastructure in a series of configuration files. These configuration files are linked to a provider library which will execute the infrastructure create, update and teardown commands on the platform you want to deploy to. This is called \"Infrastructure as Code\"\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-19.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-19.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-19.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-19.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1065,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/23\/spring-boot-lambda-prerequisites\/","url_meta":{"origin":1115,"position":2},"title":"Spring Boot Lambda Prerequisites","author":"Bullyrook","date":"July 23, 2021","format":false,"excerpt":"In this course we're going to build a very simple spring boot lambda, deploy it manually to AWS to make sure that it works and then automate the deployment using Terraform and github actions. This will allow us to automatically build and deploy changes from a commit to the main\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1081,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/24\/spring-boot-lambda-api-implementation\/","url_meta":{"origin":1115,"position":3},"title":"Spring Boot Lambda API Implementation","author":"Bullyrook","date":"July 24, 2021","format":false,"excerpt":"We've got a 'working' lambda now, but we can't actually use it anywhere. The easiest thing to do at this point is add an API Gateway trigger to our function as a new lambda. This will require a little bit of work to make an API Gateway adapter to our\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-10.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-10.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-10.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1133,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/25\/confirming-the-continuous-deployment-pipeline\/","url_meta":{"origin":1115,"position":4},"title":"Confirming the Continuous Deployment Pipeline","author":"Bullyrook","date":"July 25, 2021","format":false,"excerpt":"Lets verify that changes to our application will be automatically available when they're pushed up. Update the Application Let's start a new branch $ git checkout -b \"greeting-change\" Now update our service to return a different greeting: @Component public class HelloWorldService { public HelloWorld helloWorld(String name) { return HelloWorld.builder() .response(\"G'Day,\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-48.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-48.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-48.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-48.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1161,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/01\/02\/cloud-kube-build-pipeline-initialization\/","url_meta":{"origin":1115,"position":5},"title":"Cloud Kube | Build Pipeline Initialization","author":"Bullyrook","date":"January 2, 2022","format":false,"excerpt":"Now that we have a service we're going to start building our pipeline so that as we add functionality to the application we can incorporate any build needs into the pipeline. Initialize Github Actions Create a new directory from the root of the project called .github\/workflows\/ create a file called\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-16.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-16.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-16.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-16.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/01\/image-16.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/comments?post=1115"}],"version-history":[{"count":2,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1115\/revisions"}],"predecessor-version":[{"id":1132,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1115\/revisions\/1132"}],"wp:attachment":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/media?parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/categories?post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/tags?post=1115"},{"taxonomy":"course","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/course?post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}