#terraform-aws-modules - July 2023

Hans D
Hans Dover 3 years ago
Hi, seeing various patterns like source = "../account-map/modules/iam-roles" (eg https://github.com/cloudposse/terraform-aws-components/blob/a63341e8fb54178294c4f42be78a9b2e0c205870/modules/vpc/providers.tf#L17), basically one module referring to modules in another module.
Max Lobur
Max Loburover 3 years ago(edited)
Hi Everyone! About a month ago we have rolled out the new github shared workflows to all our terraform modules. Here are the docs covering this change: https://docs.cloudposse.com/community/automated-testing/

tl;dr
1. feature-branch/* is requried and runs automatically on every commit to a PR. You can also run it locally with make precommit/terraform . This will do auto-format and build readme for you. We no longer do auto-commits since it’s a bad security practice.
2. test/terratest is required and runs on request, using the /terratest comment on a PR. You need to have at least triage level of access on a repo to trigger it.
Max Lobur
Max Loburover 3 years ago
Here’s a proposal to include this docs ref into a PR template https://github.com/cloudposse/build-harness/pull/353
Moritz
Moritzover 3 years ago(edited)
Hi,

I'd like to add (optional) alarms to cloudfront-cdn/aws, do you prefer those as a new module or to be added directly?
Brian
Brianover 3 years ago(edited)
I may be wrong, but I dont believe account-map (at this current time) is not ready for account names in the {tenant}-{stage} format. The issue isn't with deploying the account-map component. Issues arise at lookup-time for the account-map component via cloudposse/stack-config/yaml//modules/remote-state .

e.g. If account-map dns_account_account_name variable is dns, terraform will error (The given key does not identify an element in this collection value) whenever it tries to get information about the dns account from account-map becuase the key for the dns account should be core-dns.

This may also be as simple as updating the descriptions of *_account_account_name variables in account-map. Currently, the description says it should be the stage name, not the {tenant}-{stage} name if using that format.