Deploy with Atmos and Terraform
Quick Start
Steps | |
---|---|
1. Vendor | atmos workflow vendor -f gitops |
2. Deploy | atmos workflow deploy/all -f gitops |
Currently, the workflows use the terminology "gitops". In the future, we plan to replace this with "atmos-pro".
Requirements
1 Authentication Prerequisites
The GitHub Action workflows expect the gitops
AWS Team to be properly setup and connected to GitHub OIDC. This component should already be deployed with aws-teams
/aws-team-roles
and github-oidc-provider
respectively. Verify the following to complete the authentication prerequisites.
By default in the Reference Architecture, the trusted_github_repos
input is commented out for aws-teams
. Now is the time to uncomment those lines. Please see stacks/catalog/aws-teams.yaml
- The
gitops
Team is defined and deployed byaws-teams
- The team has trusted relationships with the infrastructure repo via
trusted_github_repos
Capitalization matters! In the reference architecture, these values are initially commented out and will need to be updated with your specific repository information:components:
terraform:
aws-teams:
vars:
trusted_github_repos:
gitops:
- "acme/infra:main" - The
aws-team-roles
default catalog allows thegitops
team to assume theterraform
role github-oidc-provider
is deployed to the account where Atmos Pro infrastructure will be created- The workflows have adequate permission
In order to assume GitHub OIDC roles, a workflow needs the following:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
How To Setup
1 Vendor Components
The gitops
stacks depends on components that may already exist in your component library (s3-bucket
and dynamodb
) and adds new components to manage the GitHub OIDC access. Vendor these components either with the included Atmos Workflows or using Atmos Vendoring.
- Commands
- Atmos Workflow
vendor
workflow in the examples/snippets/stacks/workflows/gitops.yaml
file:- No commands found
Too many commands? Consider using the Atmos workflow! 🚀
Run the following from your Geodesic shell using the Atmos workflow:
atmos workflow vendor -f gitops
2 Deploy Atmos Pro Infrastructure
Deploy the Atmos Pro infrastructure components with the following workflow:
- Commands
- Atmos Workflow
deploy/all
workflow in the examples/snippets/stacks/workflows/gitops.yaml
file:- No commands found
Too many commands? Consider using the Atmos workflow! 🚀
Run the following from your Geodesic shell using the Atmos workflow:
atmos workflow deploy/all -f gitops
Review
Congratulations! The Atmos components have now deployed:
- An IAM role configured with trusted relationships for GitHub Actions
- An S3 bucket to store Terraform plan files
- A DynamoDB table for managing those plan files
You're now ready to start using Atmos Pro with GitHub Actions.