scalefactory / tfctl Goto Github PK
View Code? Open in Web Editor NEWTerraform wrapper for managing multi-account AWS infrastructures
License: MIT License
Terraform wrapper for managing multi-account AWS infrastructures
License: MIT License
Can we please enable alias support in the config file? This can be done by specifying aliases: true
(https://ruby-doc.org/stdlib-2.6.1/libdoc/psych/rdoc/Psych.html#safe_load-method) at
https://github.com/scalefactory/tfctl/blob/master/bin/tfctl#L149
This way we can have more flexible and DRY configuration files. In fact, the output produced by tfctl --show-config
uses anchors and aliases.
I am doing my initials test using the example-profile
provided on the repo. I just changed the accounts in tfctl.yml
to match the ones on my organization. I have setup the credentials using environment variables. When I run tfctl --all -- init
I get
info: tfctl running
info: Using config: default
info: Working out AWS account topology
info: Merging configuration
info: account-production: Generating Terraform run directory
info: account-dev: Generating Terraform run directory
info: account-staging: Generating Terraform run directory
info: account-dev: Executing Terraform init
info: account-production: Executing Terraform init
info: account-staging: Executing Terraform init
info: account-staging: Initializing modules...
info: account-staging:
info: account-staging: Initializing the backend...
error: account-staging:
error: account-staging: Error: No valid credential sources found for AWS Provider.
error: account-staging: Please see https://terraform.io/docs/providers/aws/index.html for more information on
error: account-staging: providing credentials for the AWS Provider
error: account-staging:
error: account-staging:
info: account-production: Initializing modules...
info: account-production:
info: account-production: Initializing the backend...
error: account-production:
error: account-production: Error: No valid credential sources found for AWS Provider.
error: account-production: Please see https://terraform.io/docs/providers/aws/index.html for more information on
error: account-production: providing credentials for the AWS Provider
error: account-production:
error: account-production:
info: account-dev: Initializing modules...
info: account-dev:
info: account-dev: Initializing the backend...
error: account-dev:
error: account-dev: Error: No valid credential sources found for AWS Provider.
error: account-dev: Please see https://terraform.io/docs/providers/aws/index.html for more information on
error: account-dev: providing credentials for the AWS Provider
error: account-dev:
error: account-dev:
error: terraform failed with exit code: 1
If you're using multiple provider aliases in a profile, then this is omitted when compiling to a terraform run directory. This prevents moving to Terraform 0.13
Hi,
Just wondering how you normally deal with multi-region deployments. For example, ACM certificates for CloudFront are only valid on us-east-1 region while I am deploying the infrastructure on us-east-2. How you normally deal with that on tfctl
? Is it possible to deploy resources on different regions using tfctl
?
Seems like it was introduced with: knu/ruby-unf_ext#72
And there is an upstream issue opened: knu/ruby-unf_ext#74
Pinning could be solution for now as the compilation of the native extension is failing due upstream changes.
Sorry to rise an issue about that but didn't know where to ask.
Is it possible to use the output of a module implementation in a profile (like this one supposing it has some outputs) into another profile definition?
Thanks
This is a feature request
Terraform lets you set input variables using OS environment variables, eg TF_VAR_foo
.
Support that method of setting variables for tfctl
.
Starting in Terraform 0.14, we started to see the following warning from tfctl
's Terraform output for all commands:
Warning: Version constraints inside provider configuration blocks are deprecated
I took a stab at supporting this quickly for our org, by adding the AWS provider version specified to the terraform
block and removing it from the provider
block when the version of Terraform specified is 0.14+, and it seems to work well for both 0.13 and 0.14. My implementation works OK for our org because we don't do anything too fancy with the tf_required_version
string, but there are definitely ways to for that to go wrong, in addition to the version comparison not being robust.
I was wondering if you guys had any thoughts on supporting this, or if you had plans.
Hi I have tried few things but I don't seems to find a way to get terrafom outputs. Is there something special about it? Can it be done?
Thanks
I created my own profile called vpc-profile
that uses the terraform vpc module
main.tf
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "2.44.0"
...
when I run tfctl --all -d -- init
I get (twice)
info: account-dev: Initializing modules...
info: account-dev: Downloading terraform-aws-modules/vpc/aws 2.44.0 for vpc-profile.vpc...
error: account-dev:
error: account-dev: Error: Failed to download module
error: account-dev:
error: account-dev: Could not download module "vpc" (../../../profiles/vpc-profile/main.tf:10)
error: account-dev: source code from
error: account-dev: "git::https://github.com/terraform-aws-modules/terraform-aws-vpc?ref=v2.44.0":
error: account-dev: error downloading
error: account-dev: 'https://github.com/terraform-aws-modules/terraform-aws-vpc?ref=v2.44.0': git
error: account-dev: must be available and on the PATH.
error: account-dev:
error: account-dev:
It is like it is not finding git command, which I obviously have installed on my computer.
$ which git
/usr/bin/git
Hi, I am testing with the example-profile provided and I am getting
info: account-production: module.example-profile.data.aws_caller_identity.current: Refreshing state...
info: account-staging: persisted to local or remote state storage.
info: account-staging:
error: account-production:
info: account-staging: module.example-profile.data.aws_caller_identity.current: Refreshing state...
error: account-production: Error: Invalid index
error: account-production:
error: account-staging:
error: account-production: on ../../../profiles/example-profile/main.tf line 3, in module "bucket":
error: account-production: 3: name = "${local.account_id}-${local.account["example_bucket_name"]}"
error: account-staging: Error: Invalid index
error: account-production: |----------------
error: account-staging:
error: account-production: | local.account is object with 11 attributes
error: account-production:
error: account-staging: on ../../../profiles/example-profile/main.tf line 3, in module "bucket":
error: account-production: The given key does not identify an element in this collection value.
error: account-production:
error: account-staging: 3: name = "${local.account_id}-${local.account["example_bucket_name"]}"
info: account-production: Releasing state lock. This may take a few moments...
error: account-staging: |----------------
error: account-staging: | local.account is object with 11 attributes
error: account-staging:
error: account-staging: The given key does not identify an element in this collection value.
error: account-staging:
info: account-staging: Releasing state lock. This may take a few moments...
error: terraform failed with exit code: 1
Any ideas?
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.