Skip to content

Commit 3966417

Browse files
author
ChadKluck
committed
updated doc
1 parent ee18192 commit 3966417

File tree

3 files changed

+167
-5
lines changed

3 files changed

+167
-5
lines changed

defaults/defaults.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"atlantis": {
33
"region": "us-east-2",
4-
"s3_bucket": "cf-asdf-deployments"
4+
"s3_bucket": "cf-asdf-deployments",
5+
"confirm_changeset": true
56
},
67
"parameter_overrides": {
78
"RolePath": "/app-role/",
89
"ServiceRolePath": "/service-role/",
910
"S3BucketNameOrgPrefix": "xcme",
1011
"S3ArtifactsBucket": "cf-asdf-deployments",
11-
"ParameterStoreHierarchy": "/",
12+
"ParameterStoreHierarchy": "/sam-apps/",
1213
"PermissionsBoundaryArn": "arn:aws:iam::123456789012:policy/MyPermissionsBoundary"
1314
},
1415
"tags": []

docs/00-Set-Up-Local-Environment.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ It is recommended you use a Virtual Python Environment so you don't have conflic
7979
After activating your python virtual environment, or to install without a virtual environment:
8080

8181
```bash
82-
pip install -r requirements.txt
82+
pip install -r ./cli/requirements.txt
8383
```
8484

8585
### Virtual Python Environment
@@ -105,7 +105,7 @@ Now you can safely install the requirements:
105105
```bash
106106
# Make sure your virtual environment is activated
107107
# (.ve) user@host ~/path/to/repo:
108-
pip install -r cli/requirements.txt
108+
pip install -r ./cli/requirements.txt
109109
```
110110

111111
Using the virtual environment:
@@ -116,7 +116,7 @@ To run Python scripts using this environment:
116116

117117
```bash
118118
# Example: Running a script from the cli directory
119-
python3 cli/deploy.py
119+
python3 ./cli/deploy.py
120120
```
121121

122122
When you're done working with the virtual environment, you can deactivate it:

docs/01-Set-Up-AWS-Account-and-Config-Repo.md

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,164 @@ This is not to be confused with Prefix or S3 object prefix. This is purely for n
7777
If supplied this will pre-pend this value to all S3 buckets created by infrastructure stacks (as long as it is included in the template).
7878

7979
This can be used to provide permissions (requires templates to only create S3 buckets under this prefix) and shorten the bucket name. If this is not required and not supplied then bucket names will include the account and region. This makes for a unique but long name. S3 names have a limit of 63 characters. If your organization requires a prefix, it is up to you to make sure they are unique.
80+
81+
### Set up defaults
82+
83+
Update `defaults/defaults.json` and `defaults/settings.json`
84+
85+
#### defaults.json
86+
87+
If SAM has been used on your account before, AWS SAM will have created an S3 bucket with the name `cf-*`. You may use that as both the `atlantis.s3_bucket` and `parameter_overrides.S3ArtifactsBucket` values in `defaults.json`.
88+
89+
If you do not require a `PermissionsBoundary` then remove the arn value from `parameter_overrides.PermissionsBoundary`.
90+
91+
Be sure to change `atlantis.region` and `parameter_overrides.S3BucketNameOrgPrefix` for your organization.
92+
93+
Finally, though the rest of the values are recommended, update to suit your needs.
94+
95+
You may also create `*-defaults.json` for each Prefix. After creating the Pipeline service role you will include the servie role's ARN in the appropriate defaults file.
96+
97+
#### settings.json
98+
99+
Out of the box, settings.json can remain the way it is with the default values.
100+
101+
##### templates
102+
103+
```json
104+
{
105+
"templates": [
106+
{
107+
"bucket": "63klabs",
108+
"prefix": "atlantis/templates/v2",
109+
"anonymous": true
110+
}
111+
]
112+
}
113+
```
114+
115+
Out of the box you can use the public templates provided by 63klabs. This is recommended for those just getting started or using these templates for training and educational purposes.
116+
117+
This is an S3 bucket that acts as a central source containing all the templates and template modules to be used for pipelines, storage, roles, and networks.
118+
119+
If you or or organization wants to manage your own S3 bucket of templates, you can use the deployment scripts and templates found on [Atlantis Template Repository for Serverless Deployments using AWS SAM and CloudFormation](https://github.com/63Klabs/atlantis-cfn-template-repo-for-serverless-deployments) which is the source repository for the 63klabs bucket.
120+
121+
Because the 63klabs bucket is public, `anonymous` is set to `true`. When using your own private bucket set it to `false` and ensure your developers have permission to access it when running the cli commands for configuration and deployments.
122+
123+
Since `template` is an array, you can list more than one bucket.
124+
125+
##### app_starters
126+
127+
```json
128+
{
129+
"app_starters": [
130+
{
131+
"bucket": "63klabs",
132+
"prefix": "atlantis/app-starters/v2",
133+
"anonymous": true
134+
}
135+
]
136+
}
137+
```
138+
139+
Like the templates bucket, this is a bucket for downloading starter code into a repository. Also, like the template bucket settings, more than one bucket may be used as a source.
140+
141+
Developers can run the `create_repo.py` command to automatically create a repository and seed it with starter code to quickly get started.
142+
143+
The `app-starters` provided by the 63klabs bucket are zipped directly from releases of their perpective GitHub repository. For a sampling of apps available, visit the [63Klabs GitHub](https://github.com/63klabs).
144+
145+
Developers can also point the `--source` to any public repository or zip file when invoking the `create_repo.py` script.
146+
147+
##### repositories
148+
149+
```json
150+
{
151+
"repositories": {
152+
"provider": "codecommit"
153+
}
154+
}
155+
```
156+
157+
There is only one setting for `repositories` at this time: `provider`.
158+
159+
This is the default provider for the `create_repo.py` script if `--provider` is not provided as a script argument.
160+
161+
The values are either `codecommit` or `github`.
162+
163+
If provider is `codecommit` when running the `create_repo` script then a CodeCommit repository is created. If it is `github` then a GitHub repository is created.
164+
165+
##### updates
166+
167+
```json
168+
{
169+
"updates": {
170+
"source": "https://github.com/63klabs/atlantis-cfn-configuration-repo-for-serverless-deployments",
171+
"ver": "release:latest",
172+
"target_dirs": ["docs", "cli"]
173+
}
174+
}
175+
```
176+
177+
When running the `update.py` script, this is where the updates will come from. The `source` needs to be a public GitHub repository or an S3 bucket the user profile has access to.
178+
179+
The `ver` value can be locked to a specific release, the latest release, or even the latest commit (only if you are brave).
180+
181+
For GitHub as a source, `ver` can be:
182+
183+
- `commit:latest`
184+
- `release:latest`
185+
- `release:<tag>`
186+
187+
For S3 as a source, `ver` can be:
188+
189+
- `latest`
190+
- `<version_id>` of the S3 object
191+
192+
You can specify either `docs`, `cli` or both to update. It is recommended you perform regular updates to receive the latest fixes and features.
193+
194+
##### regions
195+
196+
```json
197+
{
198+
"regions": [
199+
"us-east-1", "us-east-2", "us-west-1", "us-west-2"
200+
]
201+
}
202+
```
203+
204+
Out of the box `regions` includes all available regions for AWS (as of early 2025).
205+
206+
You can add or remove any region required by your organization.
207+
208+
##### tag_keys
209+
210+
These are default tags (not including default values) that are required by your organization for EVERY deployment.
211+
212+
You can set up default values in `defaults.json` and each Prefix's `*-defaults.json` file.
213+
214+
## 4. Create Pipeline Service Role
215+
216+
Developers will need an ARN of the service role to use for deploying application stacks using the pipeline.
217+
218+
Be sure to replace `acme` with your Prefix and `ADMIN_PROFILE` with a profile that has permissions to create service roles.
219+
220+
```bash
221+
./cli/configure.py service-role acme pipeline --profile ADMIN_PROFILE
222+
```
223+
224+
After configuring the role, deploy using the `deploy.py` script.
225+
226+
```bash
227+
./cli/deploy.py service-role acme pipeline --profile ADMIN_PROFILE
228+
```
229+
230+
Get the ARN of the service role from the output and add to the `*-defaults.json` file for the prefix.
231+
232+
For example, for the prefix `acme`, update `defaults/acme-defaults.json` and set `atlantis.PipelineServiceRoleArn`.
233+
234+
Be sure to commit your changes to the SAM config repository for others to use.
235+
236+
## Set-Up Complete
237+
238+
Do a run through of using the `create_repo.py`, `config.py`, and `deploy.py` scripts to ensure everything is working.
239+
240+
For information on using these scripts see the [In-Depth Guide](./in-depth/10-In-Depth-Guide.md)) or the [Atlantis Tutorials repository](http://github.com/63klabs/atlantis-tutorials).

0 commit comments

Comments
 (0)