But sometimes things don’t go as planned, and we are required to review what happened. When we think about successful automation, we aim to spend the least amount of time looking at what’s automated, so we can focus our attention on what’s relevant. We’ve introduced several improvements to make the experience more performant, precise, and pleasing to use. Use the curl command below with the web-address output value.It’s now even easier to review logs from your GitHub Actions workflow runs. Terraform Cloud shows the resources it created and the EC2 instance's web address.įinally, verify that the EC2 instance is publicly available. In Terraform Cloud, expand the Apply finished section. Then, expand the Apply step, scroll to the bottom, and click the link next to View Run in Terraform Cloud. Then, click on the Terraform Apply workflow. In GitHub, go to Actions, then select the pull request you just merged. Terraform plans to create three resources, matching the comment in the pull request. When the workflow completes, it will add a comment with a link to the speculative plan.Ĭlick the Terraform Cloud Plan link to view the plan in Terraform Cloud. Your PR will trigger the Terraform Plan Actions workflow. From the base drop-down, choose the main branch. Next, open a pull request from the update-tfc-org branch. The first line defines the name of the Actions workflow. Remember to replace YOUR-USER-NAME with your GitHub username if you are using the command below. Then, clone your forked repository to your local machine. Create a secret named TF_API_TOKEN, setting the Terraform Cloud API token you created in the previous step as the value. Open the Secrets and variables menu, then select Actions. In your new repository, navigate to the Settings page. Next, enter learn-terraform-github-actions as the Repository name.įinally, select Public and click Create repository from template. In the Owner dropdown, select your personal GitHub account. Select Use this template, then select Create a new repository. In your browser, navigate to the Learn Terraform GitHub Actions template repository. You will add it to GitHub later as a secret, so the Actions workflow can authenticate to Terraform Cloud. Click on Create an API token, enter GitHub Actions for the Description, then click Generate token. You can use any authentication method described in the AWS provider documentation.įinally, go to the Tokens page in your Terraform Cloud User Settings. This tutorial uses IAM user authentication. Terraform Cloud, complete the Terraform Cloud Get Started If you are new to Terraform, complete the Get Started This tutorial assumes that you are familiar with the Terraform and TerraformĬloud workflows. However, by using HashiCorp's Terraform Cloud GitHub Actions, you can create a custom workflow with additional steps before or after your Terraform operations. Terraform Cloud's built-in support for GitHub webhooks can accomplish this generic workflow.
0 Comments
Leave a Reply. |