tfutils / tfscaffold Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Tools are increasing popular and we like to fail fast can you add support for "terraform fmt" and "terraform validate"
https://developer.hashicorp.com/terraform/cli/commands/fmt
https://developer.hashicorp.com/terraform/cli/commands/validate
Line 611 in the terraform.sh file contains module-depth=-1 which is removed in 0.12
Hello,
We're using tfscaffold along with Terraform 0.12.6. Tf 12 returns the following warning when we run a component.
Warning: Value for undeclared variable
on ...../terraform/etc/env_eu-west-1_staging.tfvars line 28:
28: service_plugin_list = [
29: "key-auth",
30: "syslog"
31: ]
The root module does not declare a variable named "service_plugin_list". To
use this value, add a "variable" block to the configuration.
Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization
I'm using a standard setup of an env file containing variables for multiple components. Is there any plan to change how tfscaffold works to get around how terraform will be handling environment variables?
If the secrets file (stored in S3) contains certain characters, terraform.sh fails to export them as TF_VARs.
Specifically, I came across the issue when a password contained an open round bracket: (
.
bash -x bin/terraform.sh -p my_proj -e my_env -c my_comp -r eu-west-1 -a apply
bin/terraform.sh: eval: line 399: syntax error near unexpected token `('
bin/terraform.sh: eval: line 399: `export TF_VAR_my_secret=char(fail'
...
...
Error: Required variable not set: my_secret
Upgrade AWS provider used in bootstrap
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade
This project sounds really great! But I am unsure how to use it.
Current situation: 50 projects with their own Terraform states in S3. All of them have some variables in common like the account id.
As far as I understood the usage documents I have to move the whole infrastructure into the components folder. But then I have only one repository holding everything. I'd like to stay with 50 single repositories.
Any chance to use tfscaffold or is this a nogo?
Ideally we should test for getopt flavour, and provide a solution using e.g. the homebrew-installed version of gnu-getopt, with a prompt to tell the user how to install?
When bootstrapping for the first time, it's possible to get into a state where the S3 state bucket when initially created has the correct name but is placed in the wrong region.
When the region is specified via -r <region>
the expectation is that this is honoured throughout all areas of the bootstrap.
However, if you have a different region specified in any of the .tfvars
file within etc
(such as global.tfvars
) the S3 bootstrapping bucket ends up associated to this region, not the region that was specified by -r
flag.
I would have the expectation that the -r
flag overrides any other regions it adopts from .tfvars
as an explicit value and overrides any picked up through vars.
The bucket is placed in the expected region if the -r
value and any it finds in .tfvars
matches up
Tested in version:
Steps to reproduce:
./etc/global.tfvars
and amend the value for region
to region = eu-west-1
./bin/terraform.sh --bootstrap -r us-east-1 -p myproject -a plan
Expected:
-r
- us-east-1
Actual:
.tfvars
files picked up in the project - eu-west-1
us-east-1
Add dynamodb to TF for state locking.
https://developer.hashicorp.com/terraform/language/settings/backends/s3
So- when I'm trying to pass additional arguments to terraform call after --
, those arguments aren't being propagated to any terraform call.
Example invocation:
bash -x ./bin/terraform.sh --action plan --project XXX --environment XXX --component XXX --bucket-prefix XXX --region eu-west-1 -- -var journal_sha256sum=wRFZ/rvP3I8H4what3v3r9/qSmD2b1kZRQ=
invocation of terraform plan
later in the script:
terraform plan -input=false -refresh=true -module-depth=-1 -var region=eu-west-1 -var project=XXX -var bucket_name=XXX -var aws_account_id=XXX -var-file=../../etc/env_eu-west-1_XXX.tfvars
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.