The base stack (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ti-infinite/GSMInfrastructure/llms.txt
Use this file to discover all available pages before exploring further.
devops/base/template.yml) is the foundation of the entire GSM Infrastructure deployment pipeline. It must be deployed manually, once, before the GitHub Actions workflows can authenticate with AWS. Without it, the workflows have no IAM role to assume and every push to a tracked branch will fail at the credential configuration step.
The stack creates two resources: a GitHub OIDC Provider that allows GitHub Actions runners to exchange a short-lived OIDC token for temporary AWS credentials, and an InfraExecutorRole with scoped policies covering CloudFormation, ECS, EC2, ECR, S3, CloudFront, Lambda, EventBridge Scheduler, and more. No long-lived AWS access keys are ever stored in GitHub.
Stack parameters
| Parameter | Default | Allowed values | Description |
|---|---|---|---|
Environment | dev | dev, qa, prod | Deployment environment tag; used as a prefix in the role name |
AppName | GSMApplication | Any string | Application name incorporated into all resource names |
GitHubOrg | (required) | Your org or username | GitHub organization or username that owns the repository |
GitHubRepo | (required) | Repo name or * | Repository name; use * to allow any repo in the organization to assume the role |
GitHubBranch | main | Branch name or * | The branch authorized to assume the role; use * to allow any branch |
CreateOIDCProvider | true | true, false | Whether to create the GitHub OIDC provider; set to false if one already exists in the account |
Deploy with AWS CLI
Run the following command from the root of the repository. Substitute your own values forGitHubOrg, GitHubRepo, and the Environment / AppName you are targeting.
Authenticate with AWS CLI
Make sure your local AWS credentials have permissions to create IAM roles, IAM policies, and (optionally) an OIDC provider. An admin role or a role with
iam:* and iam:CreateOpenIDConnectProvider is sufficient for this one-time operation.Run the deploy command
Execute the
aws cloudformation deploy command shown above. CloudFormation will create a change set, print progress events to stdout, and exit 0 on success. The deploy typically completes in under two minutes.Verify the stack
In the AWS Console, navigate to CloudFormation → Stacks and confirm the stack status is
CREATE_COMPLETE. Open the Outputs tab to retrieve the role ARN.Copy outputs to GitHub
Copy the
InfraRoleArn output value and add it as the AWS_INFRA_ROLE_ARN secret in your GitHub repository (see After deployment below).Stack outputs
Once the stack reachesCREATE_COMPLETE, the following outputs are available in the CloudFormation Console under the stack’s Outputs tab:
| Output key | Description |
|---|---|
InfraRoleArn | Full ARN of the created InfraExecutorRole. Copy this value into the AWS_INFRA_ROLE_ARN GitHub secret. Both the infrastructure and scheduler workflows use it as role-to-assume. |
InfraRoleName | Short name of the role (e.g., prod-gsmapplication-infrastructure-role). Useful for referencing the role in other stacks or manual CLI commands. |
OIDCProviderArn | ARN of the newly created GitHub OIDC provider. Only present when CreateOIDCProvider=true. Save this if you need to reference the provider in other IAM trust policies. |
After deployment
Add AWS_INFRA_ROLE_ARN to GitHub secrets
Go to your repository on GitHub → Settings → Secrets and variables → Actions → Secrets → New repository secret.
- Name:
AWS_INFRA_ROLE_ARN - Value: the
InfraRoleArnoutput from the base stack
Create GitHub environments
Navigate to Settings → Environments in your repository and create the following environments:
The workflows reference
| Environment name | Branch protection suggestion |
|---|---|
infra-dev | No required reviewers |
infra-qa | Optional: 1 reviewer |
infra-prod | Recommended: required reviewers + wait timer |
infra-${{ env }} dynamically, so the names must match exactly.Set repository variables
With the environments created and the secret in place, proceed to configure all required repository variables. See the Configuration page for the full list.