aws-ia / terraform-aws-control_tower_account_factory

AWS Control Tower Account Factory
Apache License 2.0
604 stars 386 forks source link

AFT Account Customisation Pipeline not able to read .tfvars and .auto.tfvars files #379

Closed awsomeinfra closed 11 months ago

awsomeinfra commented 11 months ago

Terraform Version & Prov:

AFT Version: 1.10.3

Terraform Version & Provider Versions Please provide the outputs of terraform version and terraform providers from within your AFT environment

terraform version

1.5.3

terraform providers

>= 3.68.0

Bug Description In aft-account-customisation-repo, we have Terraform configuration that includes tfvars or .auto.tfvars files for variable declaration. But AFT account customisation pipeline is running into error "Error: No value for required variable". If default values are assigned along with variable definition then it runs fine, but if we use .tfvars or .auto.tfvars then it does not work.

To Reproduce Steps to reproduce the behavior:

  1. Deploy AFT
  2. In aft-account-customisation-repo, create a Terafom configuration with .tfvars or .auto.tfvars file fot variable declaration.
  3. Run the account customisation pipeline.
  4. See error

Expected behavior AFT pipeline should pick variable declaration form tfvars or .auto.tfavrs

Related Logs NA

Additional context NA

snebhu3 commented 11 months ago

@awsomeinfra thank you for reaching out. Please may you confirm the path for the .tfvars or .auto.tfvars within the aft-account-customizations repository?

awsomeinfra commented 11 months ago

@snebhu3 .tfvars or .auto.tfvars is in the same module as main.tf

Screenshot 2023-08-05 at 9 26 22 AM
snebhu3 commented 11 months ago

@awsomeinfra can you confirm that yourterraform.auto.tfvars file is not ignored by git and that its present in the respective remote github repository?

awsomeinfra commented 11 months ago

@snebhu3 Thanks for pointing this out, .tfvars was not present in github as its was ignored by gitignore. I have made this correction and not its working fine.