|
| 1 | +--- |
| 2 | +title: "Setup Atmos Pro" |
| 3 | +sidebar_label: "Setup" |
| 4 | +sidebar_position: 1 |
| 5 | +--- |
| 6 | +import Intro from '@site/src/components/Intro'; |
| 7 | +import KeyPoints from '@site/src/components/KeyPoints'; |
| 8 | +import Steps from '@site/src/components/Steps'; |
| 9 | +import Step from '@site/src/components/Step'; |
| 10 | +import StepNumber from '@site/src/components/StepNumber'; |
| 11 | +import TaskList from '@site/src/components/TaskList'; |
| 12 | +import Tabs from '@theme/Tabs'; |
| 13 | +import TabItem from '@theme/TabItem'; |
| 14 | +import CodeBlock from '@theme/CodeBlock'; |
| 15 | +import PartialAtmosPro from '@site/examples/snippets/.github/workflows/atmos-pro.yaml'; |
| 16 | +import PartialAtmosProTerraformPlan from '@site/examples/snippets/.github/workflows/atmos-pro-terraform-plan.yaml'; |
| 17 | +import PartialAtmosProTerraformApply from '@site/examples/snippets/.github/workflows/atmos-pro-terraform-apply.yaml'; |
| 18 | + |
| 19 | +<Intro> |
| 20 | + Setting up Atmos Pro is straightforward: install the GitHub App, grant repository permissions, set up the workflows, and deploy the AWS infrastructure. This guide provides an overview of each step, with detailed instructions available in the linked pages. |
| 21 | +</Intro> |
| 22 | + |
| 23 | +## Setup Process |
| 24 | + |
| 25 | +<Steps> |
| 26 | + <Step> |
| 27 | + ### <StepNumber/> Install the GitHub App |
| 28 | + |
| 29 | + The first step is to install the Atmos Pro GitHub App into your infrastructure repository. This will set up the initial connection between your repository and Atmos Pro. |
| 30 | + |
| 31 | + <TaskList> |
| 32 | + - Sign up for Atmos Pro using GitHub |
| 33 | + - Create or join a workspace |
| 34 | + - Install the Atmos Pro GitHub App |
| 35 | + - Import your repositories |
| 36 | + </TaskList> |
| 37 | + |
| 38 | + For step-by-step instructions, see the [official Atmos Pro installation guide](https://atmos-pro.com/docs/install). |
| 39 | + </Step> |
| 40 | + |
| 41 | + <Step> |
| 42 | + ### <StepNumber/> Grant Repository Permissions |
| 43 | + |
| 44 | + The second step is to grant repository permissions in Atmos Pro to enable ordered deployments and other features. |
| 45 | + |
| 46 | + <TaskList> |
| 47 | + - Permission: `Affected Stacks Create` |
| 48 | + - Workflow: `*` |
| 49 | + - Branch: `*` |
| 50 | + - Environment: `*` |
| 51 | + </TaskList> |
| 52 | + |
| 53 | + For detailed instructions on repository permissions, see the [official Atmos Pro repository permissions guide](https://atmos-pro.com/docs/ordered-deployments/repository-permissions). |
| 54 | + </Step> |
| 55 | + |
| 56 | + <Step> |
| 57 | + ### <StepNumber/> Set Up Workflows |
| 58 | + |
| 59 | + The third step is to configure the workflows in your repository. This includes reviewing the generated workflows, setting up environment variables, and configuring branch protection rules. |
| 60 | + |
| 61 | + <TaskList> |
| 62 | + - Review the 3 GitHub Action workflows |
| 63 | + - Add the Workspace ID to GitHub repository variables |
| 64 | + - Merge the workflows into the default branch |
| 65 | + </TaskList> |
| 66 | + |
| 67 | + _The dispatched workflows need to exist in the default branch before they can be triggered!_ |
| 68 | + |
| 69 | + The following workflows should be added to your repository: |
| 70 | + |
| 71 | + <Tabs> |
| 72 | + <TabItem value="atmos-pro" label="atmos-pro.yaml"> |
| 73 | + This workflow is triggered by GitHub on pull request events (opened, synchronized, reopened) and when the PR is merged (closed). It uses the `atmos describe affected` command to identify affected components and upload them to Atmos Pro. |
| 74 | + |
| 75 | + <CodeBlock language="yaml" title=".github/workflows/atmos-pro.yaml"> |
| 76 | + {PartialAtmosPro} |
| 77 | + </CodeBlock> |
| 78 | + </TabItem> |
| 79 | + <TabItem value="atmos-pro-terraform-plan" label="atmos-pro-terraform-plan.yaml"> |
| 80 | + This workflow is dispatched by Atmos Pro to create Terraform plans for affected components. It is a reusable workflow that takes stack and component as inputs. |
| 81 | + |
| 82 | + <CodeBlock language="yaml" title=".github/workflows/atmos-pro-terraform-plan.yaml"> |
| 83 | + {PartialAtmosProTerraformPlan} |
| 84 | + </CodeBlock> |
| 85 | + </TabItem> |
| 86 | + <TabItem value="atmos-pro-terraform-apply" label="atmos-pro-terraform-apply.yaml"> |
| 87 | + This workflow is dispatched by Atmos Pro to apply Terraform changes for affected components. It is a reusable workflow that takes stack and component as inputs. |
| 88 | + |
| 89 | + <CodeBlock language="yaml" title=".github/workflows/atmos-pro-terraform-apply.yaml"> |
| 90 | + {PartialAtmosProTerraformApply} |
| 91 | + </CodeBlock> |
| 92 | + </TabItem> |
| 93 | + </Tabs> |
| 94 | + |
| 95 | + For additional workflow setup instructions, see the [official Atmos Pro workflow configuration guide](https://atmos-pro.com/docs/ordered-deployments/github-workflow-config). |
| 96 | + </Step> |
| 97 | + |
| 98 | + <Step> |
| 99 | + ### <StepNumber/> Deploy AWS Infrastructure |
| 100 | + |
| 101 | + The final step is to deploy the required AWS infrastructure. This will create all necessary resources for running Atmos Terraform Plan and Apply from GitHub Actions. |
| 102 | + |
| 103 | + <TaskList> |
| 104 | + - Configure Terraform State Backend |
| 105 | + - For role assumption, deploy the GitHub OIDC provider and roles |
| 106 | + - To store Terraform planfiles, deploy the S3 bucket and DynamoDB table. |
| 107 | + </TaskList> |
| 108 | + |
| 109 | + For step-by-step AWS deployment instructions, choose one of the following options: |
| 110 | + - [Atmos and Terraform deployment](/layers/atmos-pro/tutorials/deploy-with-terraform) |
| 111 | + - [CloudFormation deployment](/layers/atmos-pro/tutorials/deploy-with-cloudformation) |
| 112 | + </Step> |
| 113 | +</Steps> |
| 114 | + |
| 115 | +<KeyPoints title="Tips"> |
| 116 | + 1. Make sure you have admin access to both GitHub and AWS before starting the setup |
| 117 | + 2. Follow the detailed instructions in each linked guide for specific steps |
| 118 | + 3. Test the setup with a small change before deploying major infrastructure changes |
| 119 | +</KeyPoints> |
| 120 | + |
| 121 | +## Verification |
| 122 | + |
| 123 | +After completing all four steps, you can verify the setup by: |
| 124 | + |
| 125 | +<Steps> |
| 126 | + <Step> |
| 127 | + ### <StepNumber/> Test GitHub Integration |
| 128 | + |
| 129 | + - Create a new pull request with a small stack change |
| 130 | + - The Atmos Pro GitHub App will automatically comment on the PR |
| 131 | + - The comment will show the status of affected components |
| 132 | + - As workflows are dispatched for each component, the comment will automatically update |
| 133 | + </Step> |
| 134 | + |
| 135 | + <Step> |
| 136 | + ### <StepNumber/> Verify AWS Resources |
| 137 | + |
| 138 | + - Check that the S3 bucket for storing Terraform plans exists |
| 139 | + - Verify the DynamoDB table for tracking deployments is created |
| 140 | + - Confirm the IAM roles have the correct permissions |
| 141 | + </Step> |
| 142 | +</Steps> |
0 commit comments