Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Then get the aws account id:
aws sts get-caller-identity --query "Account"
```

Then create a `config.yml` file and fill in the appropriate values:
Then create a `zero.yml` file and fill in the appropriate values:

```yaml
name: my-project
Expand All @@ -48,8 +48,13 @@ params:
region: us-east-1
accountId: <from above>
kubeWorkerAMI: ami-<from above>
productionHost: domain.com
stagingHost: domain-staging.com
productionHostRoot: domain.com
productionFrontendHost: domain.com
productionBackendHost: api.domain.com
stagingHostRoot: domain-staging.com
stagingFrontendHost: domain-staging.com
stagingBackendHost: api.domain-staging.com
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More like "lets talk about this later" but this is the kind of place where we'll benefit by having these configuration values but also providing reasonable defaults too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are already good suggestions. Use different domains for staging and production, have the front end served from the root, provide your backend on a subdomain called api


```

And run `stack`:
Expand Down
26 changes: 0 additions & 26 deletions commit0.module.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
name: basic-infrastructure
description: ''
author: ''
icon: ''
thumbnail: ''

prompts:
- field: region
label: Select AWS Region
options:
- "us-west-1"
- "us-west-2"
- "us-east-1"
- "us-east-2"
- "ca-central-1"
- "eu-central-1"
- "eu-west-1"
- "ap-east-1"
- "ap-south-1"
- field: accountId
label: AWS Account ID
- field: productionHost
label: Production Root Host Name (e.g. mydomain.com)
- field: stagingHost
label: Staging Root Host Name (e.g. mydomain-staging.com)

template:
strictMode: true
delimiters:
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/terraform/environments/development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module "kubernetes" {
# Authenticate with the EKS cluster via the cluster id
cluster_name = "<% .Name %>-dev-<% index .Params `region` %>"

external_dns_zone = "<% index .Params `stagingHost` %>"
external_dns_zone = "<% index .Params `stagingHostRoot` %>"
external_dns_owner_id = "<% GenerateUUID %>" # randomly generated ID

# Registration email for LetsEncrypt
cert_manager_acme_registration_email = "devops@<% index .Params `stagingHost` %>"
cert_manager_acme_registration_email = "devops@<% index .Params `stagingHostRoot` %>"
}
4 changes: 2 additions & 2 deletions kubernetes/terraform/environments/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module "kubernetes" {
# Authenticate with the EKS cluster via the cluster id
cluster_name = "<% .Name %>-production-<% index .Params `region` %>"

external_dns_zone = "<% index .Params `productionHost` %>"
external_dns_zone = "<% index .Params `productionHostRoot` %>"
external_dns_owner_id = "<% GenerateUUID %>" # randomly generated ID

# Registration email for LetsEncrypt
cert_manager_acme_registration_email = "devops@<% index .Params `productionHost` %>"
cert_manager_acme_registration_email = "devops@<% index .Params `productionHostRoot` %>"
}
4 changes: 2 additions & 2 deletions kubernetes/terraform/environments/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module "kubernetes" {
# Authenticate with the EKS cluster via the cluster id
cluster_name = "<% .Name %>-staging-<% index .Params `region` %>"

external_dns_zone = "<% index .Params `stagingHost` %>"
external_dns_zone = "<% index .Params `stagingHostRoot` %>"
external_dns_owner_id = "<% GenerateUUID %>" # randomly generated ID

# Registration email for LetsEncrypt
cert_manager_acme_registration_email = "devops@<% index .Params `stagingHost` %>"
cert_manager_acme_registration_email = "devops@<% index .Params `stagingHostRoot` %>"
}
4 changes: 2 additions & 2 deletions terraform/environments/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module "production" {

# Hosting configuration
s3_hosting_buckets = [
"assets.<% index .Params `productionHost` %>"
"<% index .Params `productionFrontendHost` %>"
]
domain_name = "<% index .Params `productionHost` %>"
domain_name = "<% index .Params `productionHostRoot` %>"

# DB configuration
db_instance_class = "db.t3.small"
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module "staging" {

# Hosting configuration
s3_hosting_buckets = [
"assets.<% index .Params `stagingHost` %>",
"<% index .Params `stagingFrontendHost` %>",
]
domain_name = "<% index .Params `stagingHost` %>"
domain_name = "<% index .Params `stagingHostRoot` %>"

# DB configuration
db_instance_class = "db.t3.small"
Expand Down