Skip to content

Commit 0998049

Browse files
authored
feat: Add info for parameters in zero module definition (#209)
* feat: Add info for parameters in zero module definition * fix: template syntax
1 parent 0cff4aa commit 0998049

2 files changed

Lines changed: 42 additions & 20 deletions

File tree

templates/terraform/environments/shared/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ locals {
1414
region = "<% index .Params `region` %>"
1515
account_id = "<% index .Params `accountId` %>"
1616
random_seed = "<% index .Params `randomSeed` %>"
17-
shared_resource_prefix = "<% index .Params `sharedResourcePrefix` %>"
17+
shared_resource_prefix = "<% if ne (index .Params `sharedResourcePrefix`) "none" %><% index .Params `sharedResourcePrefix` %><% end %>"
1818
}
1919

2020
provider "aws" {

zero-module.yml

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ requiredCredentials:
2020
parameters:
2121
- field: useExistingAwsProfile
2222
label: "Use credentials from an existing AWS profile?"
23+
info: "You can choose either a currently existing profile if you've already configured your AWS CLI, or manually enter a pair of AWS access keys."
2324
options:
2425
"yes": "Yes"
2526
"no": "No"
@@ -33,6 +34,7 @@ parameters:
3334
matchField: useExistingAwsProfile
3435
- field: accessKeyId
3536
label: AWS AccessKeyId
37+
info: "AWS access is controlled by a pair of keys tied to a user account.\nhttps://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html "
3638
envVarName: "AWS_ACCESS_KEY_ID"
3739
conditions:
3840
- action: KeyMatchCondition
@@ -41,106 +43,124 @@ parameters:
4143
- field: secretAccessKey
4244
envVarName: "AWS_SECRET_ACCESS_KEY"
4345
label: AWS SecretAccessKey
46+
info: "AWS access is controlled by a pair of keys tied to a user account.\nhttps://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html "
4447
conditions:
4548
- action: KeyMatchCondition
4649
whenValue: "no"
4750
matchField: useExistingAwsProfile
4851
- field: githubAccessToken
4952
label: "Github API Key to setup your repository and optionally CI/CD"
53+
info: "This API key will let us set up new repositories to check in your code.\nhttps://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token"
5054
envVarName: GITHUB_ACCESS_TOKEN
5155
- field: region
5256
label: Select AWS Region
57+
info: "This is the region your resources will be created in.\nMost regions have all the same features and functionality, but depending on your product you may need to choose a different region for data sovereignty reasons."
5358
options:
54-
"us-west-2": "us-west-2 (Oregon)"
55-
"us-east-1": "us-east-1 (N. Virginia)"
56-
"us-east-2": "us-east-2 (Ohio)"
59+
"us-east-1": "us-east-1 - US East (N. Virginia)"
60+
"us-east-2": "us-east-2 - US East (Ohio)"
61+
"us-west-2": "us-west-2 - US West (Oregon)"
62+
"ca-central-1": "ca-central-1 - Canada (Central)"
63+
"eu-west-1": "eu-west-1 - Europe (Ireland)"
64+
"ap-southeast-1": "ap-southeast-1 - Asia Pacific (Singapore)"
5765
- field: productionHostRoot
58-
label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain.
66+
label: Production Root Host Name (e.g. mydomain.com)
67+
info: "This must be the root of the chosen domain, not a subdomain. You will also be prompted for the subdomains to use for your application."
5968
fieldValidation:
6069
type: regex
6170
value: '^([a-z0-9]+(-[a-z0-9]+)*\.{1})+[a-z]{2,}$'
6271
errorMessage: Invalid root domain name
6372
- field: productionFrontendSubdomain
6473
label: Production Frontend Host Name (e.g. app.)
74+
info: "The subdomain that will point to the static assets of your frontend hosted in Cloudfront."
6575
default: app.
6676
fieldValidation:
6777
type: regex
6878
value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$'
6979
errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.')
7080
- field: productionBackendSubdomain
7181
label: Production Backend Host Name (e.g. api.)
82+
info: "The subdomain that will point to the API of your backend running in Kubernetes."
7283
default: api.
7384
fieldValidation:
7485
type: regex
7586
value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$'
7687
errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.')
7788
- field: stagingHostRoot
78-
label: Staging Root Host Name (e.g. mydomain-staging.com) - this must be the root of the chosen domain, not a subdomain.
89+
label: Staging Root Host Name (e.g. mydomain-staging.com)
90+
info: "This must be the root of the chosen domain, not a subdomain. You will also be prompted for the subdomains to use for your application.\nIt's recommended that you use different hostnames for staging and production instead of trying to have staging as a subdomain of your production domain."
7991
fieldValidation:
8092
type: regex
8193
value: '^([a-z0-9]+(-[a-z0-9]+)*\.{1})+[a-z]{2,}$'
8294
errorMessage: Invalid root domain name
8395
- field: stagingFrontendSubdomain
8496
label: Staging Frontend Host Name (e.g. app.)
97+
info: "The subdomain that will point to the static assets of your frontend hosted in Cloudfront."
8598
default: app.
8699
fieldValidation:
87100
type: regex
88101
value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$'
89102
errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.')
90103
- field: stagingBackendSubdomain
91104
label: Staging Backend Host Name (e.g. api.)
105+
info: "The subdomain that will point to the API of your backend running in Kubernetes."
92106
default: api.
93107
fieldValidation:
94108
type: regex
95109
value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$'
96110
errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.')
97111
- field: CIVendor
98-
label: Using either circleCI or github Actions to build / test your repository
112+
label: Which CI vendor would you like to use?
113+
info: "Build pipelines will be set up which will deploy your code to your infrastructure whenever PRs are merged to the main branch."
99114
default: "circleci"
100115
options:
101-
"circleci": "CircleCi"
116+
"circleci": "CircleCI"
102117
"github-actions": "Github Actions"
103118
- field: circleciApiKey
104-
label: "Circle CI API Key to setup your CI/CD for repositories"
119+
label: "CircleCI API Key"
120+
info: "This will let us configure your CircleCI account to automatically enable CI for these newly created projects.\nhttps://circleci.com/docs/2.0/managing-api-tokens/"
105121
envVarName: CIRCLECI_API_KEY
106122
conditions:
107123
- action: KeyMatchCondition
108124
matchField: CIVendor
109125
whenValue: "circleci"
110126
- field: database
111-
label: Database engine to use (postgres)
127+
label: Database engine to use
128+
info: "This will set up a database for you using RDS.\nIt will be accessible only by your application, credentials will be created automatically."
112129
options:
113130
"postgres": "PostgreSQL"
114131
"mysql": "MySQL"
115132
- field: cacheStore
116-
label: "Cache store to use (default: no cache)"
133+
label: "Cache store to use"
134+
info: "If necessary for your application, this will set up a cache using AWS ElastiCache."
117135
options:
118136
"none": "none"
119137
"redis": "Redis"
120138
"memcached": "Memcached"
121139
- field: loggingType
122-
label: Application logging to configure. Cloudwatch is cheaper with a more limited feature set. Elasticsearch + Kibana will set up more infrastructure but enable a much richer logging search and visualization experience.
140+
label: Which application logging to configure.
141+
info: "Cloudwatch is usually cheaper and simpler but with a limited feature set.\nElasticsearch + Kibana will set up more infrastructure but enable a much richer logging search and visualization experience."
123142
options:
124143
"cloudwatch": "AWS CloudWatch"
125144
"kibana": "Kibana"
126145
- field: metricsType
127-
label: Additional application metrics method to configure. Metrics are available through CloudWatch, but choosing prometheus will install Prometheus and Grafana, for a richer metrics experience. No additional infrastructure is required, but a number of prometheus pods will need to exist in the cluster, utilizing some resources.
146+
label: Additional application metrics method to configure.
147+
info: "Metrics are available through CloudWatch, but choosing prometheus will install Prometheus and Grafana, for a richer metrics experience.\nNo additional infrastructure is required, but a number of prometheus pods will need to exist in the cluster, utilizing some resources."
128148
options:
129149
"none": "none"
130150
"prometheus": "Prometheus"
131151
- field: notificationServiceEnabled
132152
label: "Install the Zero Notification Service in your cluster?"
133-
info: Provides easy notification capability through email, slack, etc. - https://github.com/commitdev/zero-notification-service
153+
info: "Provides easy notification capability through email, slack, SMS, etc.\nhttps://github.com/commitdev/zero-notification-service"
134154
default: yes
135155
options:
136156
"yes": "Yes"
137157
"no": "No"
138158
- field: sendgridApiKey
139159
label: "API key to setup email integration (optional: leave blank to opt-out of Sendgrid setup)"
140-
info: Signup at https://signup.sendgrid.com or create an API key at https://app.sendgrid.com/settings/api_keys - Sendgrid is an email delivery service enabling transactional email sending and more.
160+
info: "Signup at https://signup.sendgrid.com or create an API key at https://app.sendgrid.com/settings/api_keys\nSendgrid is an email delivery service enabling transactional email sending and more."
141161
- field: notificationServiceSlackApiKey
142-
label: "API key of your Slack bot if you want to use Slack with the Zero Notification Service. Leave blank if not applicable."
143-
info: See https://slack.com/intl/en-ca/help/articles/215770388-Create-and-regenerate-API-tokens
162+
label: "API key of your Slack bot if you want to use Slack with the Zero Notification Service."
163+
info: "Leave blank if you don't intend to use the Slack functionality.\nSee https://slack.com/intl/en-ca/help/articles/215770388-Create-and-regenerate-API-tokens"
144164
conditions:
145165
- action: KeyMatchCondition
146166
whenValue: "yes"
@@ -152,17 +172,19 @@ parameters:
152172
label: Random seed that will be shared between projects to come up with deterministic resource names
153173
execute: uuidgen | head -c 8
154174
- field: fileUploads
155-
label: Enable file uploads using S3 and Cloudfront signed URLs? (Will require manual creation of a Cloudfront keypair in AWS)
175+
label: Enable file uploads using S3 and Cloudfront signed URLs?
176+
info: "This will allow secure file uploads and downloads through your application.\nIt will require manual creation of a Cloudfront keypair in AWS. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html"
156177
default: yes
157178
options:
158179
"yes": "Yes"
159180
"no": "No"
160181
- field: userAuth
161-
label: Enable user management using Kratos and authentication using the Oathkeeper access proxy?
182+
label: Enable user management and auth access proxy?
183+
info: "This will enable infrastructure and application code that uses Kratos for user management and the Oathkeeper access proxy.\nhttps://ory.sh"
162184
default: yes
163185
options:
164186
"yes": "Yes"
165187
"no": "No"
166188
- field: sharedResourcePrefix
167189
label: "Mostly for development - Allow shared resources to have a unique prefix. This is only necessary if many zero projects will be run in the same AWS account."
168-
value: ""
190+
value: "none"

0 commit comments

Comments
 (0)