git clone https://github.com/bjnandi/terraform-ci-cd-aws.git
Organization > Workspaces > Variables
Generate an HCP Terraform user API token. For this go to the Tokens page in HCP Terraform User Settings. Click on Create an API token, enter the GitHub Actions token for the Description, then click “Generate token”.
You can read GitHub Secrets for more details. Now we go to secrets and variables and set values.
Github > Repo Name > Settings > Secrets and variables > Action > Repository Secrets > New repository secret
git checkout -b 'tf-infa-test'
env/dev
Now, Return to the VS Code Editor & Minor changes in the code for the demo test then commit & push the code in the GitHub “tf-infa-test” branch. Create a pull request for this branch in GitHub.
After the pull request run a GitHub workflow (Terraform plan) to check the Terraform plan.
If you are satisfied with the “Terraform plan” then close the “pull request” with the “merge” code in the ‘main’ branch then run a workflow (Terraform apply) for provisioning infrastructure.
All resources have been created.
Happy coding! 💻✨