Closed jurgenweber closed 4 years ago
@jurgenweber Thank you for reaching out. You are creating 2 conflicting terraform backends, so let's sort this out:
We just realized that there was a mistake in our documentation. The issue is that root_path
was NOT supposed to be there, therefore we are removing it now and your main.tf
should look now like this:
module "landing_zone" {
source = "MitocGroup/landing-zone/aws"
version = "0.2.2"
landing_zone_providers = var.landing_zone_providers
landing_zone_components = var.landing_zone_components
terraform_backend = var.terraform_backend
}
I would update terraform.tfvars
like this:
landing_zone_providers = {
default = {
account_id = "121212121212121212"
region = "us-east-2"
}
}
landing_zone_components = {
landing_zone_vpc = "s3://terraform-aws-landing-zone/components/landing_zone_vpc/default.tfvars"
}
terraform_backend = {
backend = "s3"
region = "us-east-2"
bucket = "bucketname" # Needs to be globally unique
key = "terraform.tfstate"
dynamodb_table = "TerraformStatelock"
encrypt = true
profile = "master-terraform-init"
shared_credentials_file = "$HOME/.aws/credentials"
skip_metadata_api_check = true
}
NOTE: Make sure to include in
landing_zone_components
the list of all required components that you need for your AWS Landing Zone. And replaces3://terraform-aws-landing-zone/components/landing_zone_vpc/default.tfvars
with your s3 bucket and path where each.tfvars
file will be stored for each component. If you prefer to use local path, replace it with./default.tfvars
or something like that relative to each component's root folder...
Please let us know if it works with above described changes.
Sorry, this issue was closed automatically. Reopening and waiting for your feedback...
@jurgenweber fyi, this pull request should resolve deprecation warning - https://github.com/MitocGroup/terraform-aws-landing-zone/pull/163
All reported issues have been fixed and published in v0.2.3 release: https://github.com/MitocGroup/terraform-aws-landing-zone/releases/tag/v0.2.3
Describe the Bug
the module doesn't validate nor plan.
To Reproduce
create a AWS account, setup s3 backend and state table requirements. main.tf:
module "landing_zone" { source = "MitocGroup/landing-zone/aws" version = "0.2.2" root_path = path.module landing_zone_providers = var.landing_zone_providers landing_zone_components = var.landing_zone_components terraform_backend = var.terraform_backend }
bucket = "bucketname" # Needs to be globally unique dynamodb_table = "TerraformStatelock" key = "terraform.tfstate" profile = "master-terraform-init" region = "us-east-2"
landing_zone_providers = { default = { account_id = "121212121212121212" region = "us-east-2" } } landing_zone_components = { landing_zone_vpc = "s3://terraform-aws-landing-zone/components/landing_zone_vpc/default.tfvars" } terraform_backend = { backend = "s3" path = "master/terraform.tfstate" }
Warning: External references from destroy provisioners are deprecated
on .terraform/modules/landing_zone/MitocGroup-terraform-aws-landing-zone-22b8584/modules/landing_zone/main.tf line 24, in resource "null_resource" "landing_zone_config": 24: command = "node ${path.module}/scripts/remove-config.js"
Destroy-time provisioners and their connection configurations may only reference attributes of the related resource, via 'self', 'count.index', or 'each.key'.
References to other resources during the destroy phase can cause dependency cycles and interact poorly with create_before_destroy.
(and 5 more similar warnings elsewhere)
Error: Unsupported argument
on main.tf line 19, in module "landing_zone": 19: root_path = path.module
An argument named "root_path" is not expected here.
$ tf version Terraform v0.12.18
*edit: added node + terrahub versions