Skip to content

Commit 5493d6c

Browse files
authored
Additional override locations (#68)
1 parent aad63b0 commit 5493d6c

File tree

4 files changed

+166
-49
lines changed

4 files changed

+166
-49
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ fabric.properties
116116
.ionide
117117

118118
# End of https://www.toptal.com/developers/gitignore/api/pycharm+all,visualstudiocode
119+
.venv/

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,42 @@ The following environment variables can be configured:
4242
* falls back to the default `AWS_ACCESS_KEY_ID` mock value
4343
* `AWS_ACCESS_KEY_ID`: AWS Access Key ID to use for multi account setups (default: `test` -> account ID: `000000000000`)
4444
* `SKIP_ALIASES`: Allows to skip generating AWS provider overrides for specified aliased providers, e.g. `SKIP_ALIASES=aws_secrets,real_aws`
45+
* `ADDITIONAL_TF_OVERRIDE_LOCATIONS`: Comma-separated list of folder paths that will also receive a temporary `localstack_providers_override.tf` file
4546

4647
## Usage
4748

4849
The `tflocal` command has the same usage as the `terraform` command. For detailed usage,
4950
please refer to the man pages of `terraform --help`.
5051

52+
### Validation errors when using local terraform modules
53+
54+
Note that if your project uses local terraform modules, and those modules reference providers, those folders *also* need to receive a temporary `localstack_providers_override.tf` file. Without it, you would get an error that looks like this when starting to process code from inside the module
55+
56+
```
57+
58+
│ Error: No valid credential sources found
59+
60+
│ with module.lambda.provider["registry.terraform.io/hashicorp/aws"],
61+
│ on ../../providers.tf line 11, in provider "aws":
62+
│ 11: provider "aws" {
63+
64+
│ Please see https://registry.terraform.io/providers/hashicorp/aws
65+
│ for more information about providing credentials.
66+
67+
│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or "AWS_EC2_METADATA_DISABLED" environment variable
68+
```
69+
70+
To address this issue, you may include a comma-separated list of folder paths that will recieve additional override files via an environment variable
71+
72+
```
73+
ADDITIONAL_TF_OVERRIDE_LOCATIONS=/path/to/module1,path/to/module2 tflocal plan
74+
```
75+
76+
[See this issue for more discussion](https://github.com/localstack/terraform-local/issues/67)
77+
5178
## Change Log
5279

80+
* v0.21.0: Add ability to drop an override file in additional locations
5381
* v0.20.1: Fix list config rendering
5482
* v0.20.0: Fix S3 backend option merging
5583
* v0.19.0: Add `SKIP_ALIASES` configuration environment variable

0 commit comments

Comments
 (0)