we want to be able to use the same terraform configuration for both localstack and our production environment. in order to do this, we need to set the provider arguments (things like access_key) conditionally. the default will still be the localstack settings, but now we can override these by changing the terraform workspace to something else (e.g. "prod").
Details
Details
from the services directory, run yarn init-local-cloud.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
services/terraform/main.tf | ||
---|---|---|
2 ↗ | (On Diff #17495) | as implied by the name, this is the default workspace when you initialize terraform |
38–40 ↗ | (On Diff #17495) | unfortunately terraform does not give us a way to tweak their formatting rules... stuck with 120 character lines |
45 ↗ | (On Diff #17495) | From SO: Using [*] with a non-list value automatically converts it into a zero-element list or a one-element list, depending on whether the value is null. That allows us to dynamically declare the endpoints block only if the override_endpoint attribute is non-null, and then write its value into all three of the overridden endpoint arguments. |