-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add tf-account to support multiple customers #1
Conversation
81e4fe5
to
a6db2c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. Key feedback here is that this should support n
customers, not n=2
.
For terraform to apply this workspace, additional customer MUST have a mapping present in the tf-account provider.tf!
Let's pare back the misuse of secrets instead of creating extra indirection. You should not have to touch your Terraform configuration whatsoever to get this working or make it aware of workspaces. The workflow should handle passing in the right values.
a6db2c5
to
d330af5
Compare
d330af5
to
5241158
Compare
Avoid force push. It's a bad habit we've ingrained in people via workflows all over worry that a trivial config (squash and merge) won't be enforced reliably in all calling repos. Outside of observeinc/terraform-observe-* repos that enforce otherwise, it's good PR etiquette to use commits to provide a timeline of meaningful changes. Not too small but not too large. Rewriting and squashing or amending commits in a PR (vs on merge) prevents reviewers from seeing that history. |
@bendrucker @jta I'd like to get this merged fairly soon and iterate on it later if needed, as I'll have to switch priorities shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! All should be quick fixes but feel free to merge this and follow up.
Description
tf-account-*
to multiple customersadditional_customers
)-backend-config="workspace_key_prefix=${{ github.event.repository.name }}"
which gets mapped in the bucket as
<repo_name>/<workspace>/<key>
where key is<repo_name>/tf-state
Note: For terraform to apply this workspace, additional customer MUST have a mapping present in the tf-account
provider.tf
!See: https://github.com/observeinc/tf-account-dual-terraform/pull/2/files
Testing
cap2
which is mapped asOBSERVE_CUSTOMER_2
secrets keyOBSERVE_CUSTOMER_CAP2
etc.. as specified here where this is added as another key value pair to the Jenkins job. In this testing case, I just addedOBSERVE_CUSTOMER_2
as key and the second required environment as the value (https://www.notion.so/observeinc/tf-account-GitOps-Tutorial-fd38d97057bd40f8b615e63bbeb5325c)