Skip to content

Commit 83e47cc

Browse files
committed
Update the readme with some steps, make worker ami a templated value
1 parent a054f7b commit 83e47cc

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,45 @@ diagram](./docs/architecture-overview.svg).
1515

1616
## Getting Started
1717

18-
This is meant to be used with commit0 and not directly. See
19-
the [commit0](https://github.com/commitdev/commit0) repository for more
20-
information. The commit0 tool will parse through configuration and fill in any
18+
This is meant to be used with the commit0 `stack` tool and not directly. See
19+
the [stack](https://github.com/commitdev/stack) repository for more
20+
information. The tool will parse through configuration and fill in any
2121
template variables which need to be encoded into the terraform configuration.
2222
Once that is done you'll have a directory containing the contents of this
2323
repository minus the `.git` directory.
2424

25-
### ⚠️ Edits Required
26-
27-
This repository requires post-template configuration edits to the AMI depending
28-
on the region you chose. To find the appropriate AMI for your region you can use
29-
the following snippet:
25+
To generate the templates you will need to provide some values to fill in.
3026

27+
First get the AMI for your region:
3128
```shell
3229
$ REGION=us-east-1
3330
$ aws ssm get-parameters \
3431
--names /aws/service/eks/optimized-ami/1.15/amazon-linux-2/recommended/image_id \
3532
--region $REGION \
36-
--query "Parameters[0].Value" | cat
33+
--query "Parameters[0].Value"
34+
```
35+
36+
Then get the aws account id:
37+
```shell
38+
aws sts get-caller-identity --query "Account"
39+
```
40+
41+
Then create a `config.yml` file and fill in the appropriate values:
42+
43+
```yaml
44+
name: my-project
45+
46+
params:
47+
region: us-east-1
48+
accountId: <from above>
49+
kubeWorkerAMI: ami-<from above>
50+
productionHost: domain.com
51+
stagingHost: domain-staging.com
52+
```
53+
54+
And run `stack`:
55+
```shell
56+
$ stack -config config.yml commit0-aws-eks-stack/ my-project-infrastructure/
3757
```
3858

3959
### Apply Configuration
@@ -47,7 +67,7 @@ $ make ENV=<environment>
4767
Configure your k8s context
4868

4969
```shell
50-
$ aws eks update-kubeconfig --name <cluster-name> --region us-west-2
70+
$ aws eks update-kubeconfig --name <cluster-name> --region us-east-1
5171
```
5272

5373
Then talk to Bill.

terraform/environments/production/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module "production" {
2929

3030
# EKS-Optimized AMI for your region: https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
3131
# https://us-east-1.console.aws.amazon.com/systems-manager/parameters/%252Faws%252Fservice%252Feks%252Foptimized-ami%252F1.15%252Famazon-linux-2%252Frecommended%252Fimage_id/description?region=us-east-1
32-
eks_worker_ami = "ami-0e710550577202c55"
32+
eks_worker_ami = "<% index .Params `kubeWorkerAMI` %>"
3333

3434
# Hosting configuration
3535
s3_hosting_buckets = [

terraform/environments/staging/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module "staging" {
2929

3030
# EKS-Optimized AMI for your region: https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
3131
# https://us-east-1.console.aws.amazon.com/systems-manager/parameters/%252Faws%252Fservice%252Feks%252Foptimized-ami%252F1.15%252Famazon-linux-2%252Frecommended%252Fimage_id/description?region=us-east-1
32-
eks_worker_ami = "ami-0e710550577202c55"
32+
eks_worker_ami = "<% index .Params `kubeWorkerAMI` %>"
3333

3434
# Hosting configuration
3535
s3_hosting_buckets = [

0 commit comments

Comments
 (0)