Skip to content

Commit ebe60c8

Browse files
authored
Point Workflows to Copy (#795)
1 parent ebb76a5 commit ebe60c8

35 files changed

+1925
-2
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Atmos Workflows
2+
3+
Atmos Workflows are used to automate deployment or destructions steps within the context of Atmos. Workflows
4+
combine multiple commands into one executable unit of work.
5+
6+
## Usage
7+
8+
Run any Workflow from the root of the directory by calling `atmos workflow -f filename`. Some workflow require a stack
9+
parameter, whereas others have the stack predetermined. Add a stack (where applicable) with `-s stack-name`
10+
11+
## Naming Convention
12+
13+
Workflow Jobs can have any name, but in order to maintain consistency, we have chosen to follow a pattern similar to
14+
Terraform commands.
15+
16+
**Note**: Not all Workflows include each of these commands. These are guidelines for naming any Workflow job.
17+
18+
### `vendor`
19+
20+
Use `vendor` to pull all the latest components for a given layer.
21+
22+
Example
23+
24+
```
25+
atmos workflow vendor -f baseline
26+
```
27+
28+
### `init`
29+
30+
Use `atmos workflow init -f {{ filename }}` to run any commands required before deployment.
31+
32+
Example
33+
34+
```
35+
atmos workflow init -f baseline
36+
```
37+
38+
### `deploy`
39+
40+
Use `atmos workflow deploy -f {{ filename }}` to deploy all components for a given layer.
41+
42+
```
43+
atmos workflow deploy -f baseline
44+
```
45+
46+
Use `atmos workflow deploy/{{ component or group name }} -f {{ filename }}` to deploy a specific component or group of
47+
components
48+
49+
```
50+
atmos workflow deploy/vpc -f network
51+
atmos workflow deploy/tgw -f network
52+
```
53+
54+
### `all`
55+
56+
Use `atmos workflow all -f {{ filename }}` to run all steps together. This will execute all included jobs in the given
57+
Workflow in order.
58+
59+
For example,
60+
61+
```
62+
atmos workflow all -f baseline
63+
```
64+
65+
66+
67+
## References
68+
69+
- [Atmos Workflows](https://atmos.tools/core-concepts/workflows/)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: workflow deploy/accounts -f accounts
6+
- command: workflow deploy/account-settings -f accounts
7+
8+
deploy/organization:
9+
description: |
10+
Deploy the AWS Organization. This is required before finishing the root account requirements.
11+
steps:
12+
- command: terraform deploy account -target=aws_organizations_organization.this[0] -s core-gbl-root
13+
- command: aws ram enable-sharing-with-aws-organization
14+
type: shell
15+
16+
deploy/accounts:
17+
description: Deploys all AWS Organization accounts
18+
steps:
19+
- command: terraform apply account -s core-gbl-root
20+
- command: terraform deploy account-map -s core-gbl-root
21+
22+
deploy/account-settings:
23+
description: Apply AWS Account settings for best practices.
24+
steps:
25+
- command: terraform deploy account-settings -s core-gbl-artifacts
26+
- command: terraform deploy account-settings -s core-gbl-audit
27+
- command: terraform deploy account-settings -s core-gbl-auto
28+
- command: terraform deploy account-settings -s core-gbl-dns
29+
- command: terraform deploy account-settings -s core-gbl-identity
30+
- command: terraform deploy account-settings -s core-gbl-network
31+
- command: terraform deploy account-settings -s core-gbl-root
32+
- command: terraform deploy account-settings -s core-gbl-security
33+
- command: terraform deploy account-settings -s plat-gbl-dev
34+
- command: terraform deploy account-settings -s plat-gbl-prod
35+
- command: terraform deploy account-settings -s plat-gbl-sandbox
36+
- command: terraform deploy account-settings -s plat-gbl-staging
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: workflow vendor -f addons
6+
- command: workflow deploy/all -f addons
7+
8+
vendor:
9+
description: Vendor addon components.
10+
steps:
11+
- command: workflow vendor -f addons/alb
12+
- command: workflow vendor -f addons/api-gateway
13+
- command: workflow vendor -f addons/cognito
14+
- command: workflow vendor -f addons/ec2-instance
15+
- command: workflow vendor -f addons/kinesis-stream
16+
- command: workflow vendor -f addons/kms
17+
- command: workflow vendor -f addons/lambda
18+
- command: workflow vendor -f addons/memorydb
19+
- command: workflow vendor -f addons/s3-bucket
20+
- command: workflow vendor -f addons/ses
21+
- command: workflow vendor -f addons/sns-topic
22+
- command: workflow vendor -f addons/spa-s3-cloudfront
23+
- command: workflow vendor -f addons/sqs-queue
24+
- command: workflow vendor -f addons/ssm-parameters
25+
- command: workflow vendor -f addons/waf
26+
27+
deploy/all:
28+
description: run all deploy workflows
29+
steps:
30+
- command: workflow deploy/alb -f addons
31+
- command: workflow deploy/api-gateway -f addons
32+
- command: workflow deploy/cognito -f addons
33+
- command: workflow deploy/ec2-instance -f addons
34+
- command: workflow deploy/kinesis-stream -f addons
35+
- command: workflow deploy/kms -f addons
36+
- command: workflow deploy/lambda -f addons
37+
- command: workflow deploy/memorydb -f addons
38+
- command: workflow deploy/s3-bucket -f addons
39+
- command: workflow deploy/ses -f addons
40+
- command: workflow deploy/sns-topic -f addons
41+
- command: workflow deploy/spa-s3-cloudfront -f addons
42+
- command: workflow deploy/sqs-queue -f addons
43+
- command: workflow deploy/ssm-parameters -f addons
44+
- command: workflow deploy/waf -f addons
45+
46+
deploy/alb:
47+
description: >-
48+
Deploy Alb Component.
49+
Please modify the stacks/workflows/addons/alb.yaml to customize
50+
steps:
51+
- command: workflow all -f addons/alb
52+
deploy/api-gateway:
53+
description: >-
54+
Deploy Api-Gateway Component.
55+
Please modify the stacks/workflows/addons/api-gateway.yaml to customize
56+
steps:
57+
- command: workflow all -f addons/api-gateway
58+
deploy/cognito:
59+
description: >-
60+
Deploy Cognito Component.
61+
Please modify the stacks/workflows/addons/cognito.yaml to customize
62+
steps:
63+
- command: workflow all -f addons/cognito
64+
deploy/ec2-instance:
65+
description: >-
66+
Deploy Ec2-Instance Component.
67+
Please modify the stacks/workflows/addons/ec2-instance.yaml to customize
68+
steps:
69+
- command: workflow all -f addons/ec2-instance
70+
deploy/kinesis-stream:
71+
description: >-
72+
Deploy Kinesis-Stream Component.
73+
Please modify the stacks/workflows/addons/kinesis-stream.yaml to customize
74+
steps:
75+
- command: workflow all -f addons/kinesis-stream
76+
deploy/kms:
77+
description: >-
78+
Deploy Kms Component.
79+
Please modify the stacks/workflows/addons/kms.yaml to customize
80+
steps:
81+
- command: workflow all -f addons/kms
82+
deploy/lambda:
83+
description: >-
84+
Deploy Lambda Component.
85+
Please modify the stacks/workflows/addons/lambda.yaml to customize
86+
steps:
87+
- command: workflow all -f addons/lambda
88+
deploy/memorydb:
89+
description: >-
90+
Deploy Memorydb Component.
91+
Please modify the stacks/workflows/addons/memorydb.yaml to customize
92+
steps:
93+
- command: workflow all -f addons/memorydb
94+
deploy/s3-bucket:
95+
description: >-
96+
Deploy S3-Bucket Component.
97+
Please modify the stacks/workflows/addons/s3-bucket.yaml to customize
98+
steps:
99+
- command: workflow all -f addons/s3-bucket
100+
deploy/ses:
101+
description: >-
102+
Deploy Ses Component.
103+
Please modify the stacks/workflows/addons/ses.yaml to customize
104+
steps:
105+
- command: workflow all -f addons/ses
106+
deploy/sns-topic:
107+
description: >-
108+
Deploy Sns-Topic Component.
109+
Please modify the stacks/workflows/addons/sns-topic.yaml to customize
110+
steps:
111+
- command: workflow all -f addons/sns-topic
112+
deploy/spa-s3-cloudfront:
113+
description: >-
114+
Deploy Spa-S3-Cloudfront Component.
115+
Please modify the stacks/workflows/addons/spa-s3-cloudfront.yaml to customize
116+
steps:
117+
- command: workflow all -f addons/spa-s3-cloudfront
118+
deploy/sqs-queue:
119+
description: >-
120+
Deploy Sqs-Queue Component.
121+
Please modify the stacks/workflows/addons/sqs-queue.yaml to customize
122+
steps:
123+
- command: workflow all -f addons/sqs-queue
124+
deploy/ssm-parameters:
125+
description: >-
126+
Deploy Ssm-Parameters Component.
127+
Please modify the stacks/workflows/addons/ssm-parameters.yaml to customize
128+
steps:
129+
- command: workflow all -f addons/ssm-parameters
130+
deploy/waf:
131+
description: >-
132+
Deploy Waf Component.
133+
Please modify the stacks/workflows/addons/waf.yaml to customize
134+
steps:
135+
- command: workflow all -f addons/waf
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy alb --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component alb
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy api-gateway/account-settings --stack plat-use1-sandbox
6+
- command: terraform deploy api-gateway/rest-api --stack plat-use1-sandbox
7+
8+
vendor:
9+
description: vendor all components required for this addon
10+
steps:
11+
- command: vendor pull --component api-gateway/account-settings
12+
- command: vendor pull --component api-gateway/rest-api
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy cognito --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component cognito
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy ec2-instance --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component ec2-instance
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy kinesis-stream/example --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component kinesis-stream
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy kms --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component kms
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflows:
2+
all:
3+
description: run all workflows
4+
steps:
5+
- command: terraform deploy lambda/hello-world-py --stack plat-use1-sandbox
6+
7+
vendor:
8+
description: vendor all components required for this addon
9+
steps:
10+
- command: vendor pull --component lambda

0 commit comments

Comments
 (0)