aws-ia / terraform-aws-control_tower_account_factory

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

modules/aft/modules/aft-customizations/states.tf uses deprecated template #407

Closed docspy closed 7 months ago

docspy commented 7 months ago

Terraform Version & Prov: 1.5.X or 1.6.X

AFT Version: (Can be found in the AFT Management Account in the SSM Parameter /aft/config/aft/version) 1.11.0

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

terraform version

❯ terraform version
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v4.36.0
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/hashicorp/random v3.4.3
+ provider registry.terraform.io/hashicorp/time v0.9.0

tested on terraform 1.6.7 too

terraform providers

❯ terraform providers

Providers required by configuration:
.
└── module.aft
    ├── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    ├── provider[registry.terraform.io/hashicorp/local]
    ├── module.aft_account_provisioning_framework
    │   └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    ├── module.aft_backend
    │   └── provider[registry.terraform.io/hashicorp/aws] >= 4.27.0
    ├── module.aft_customizations
    │   ├── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── provider[registry.terraform.io/hashicorp/local]
    │   └── provider[registry.terraform.io/hashicorp/template]
    ├── module.aft_ssm_parameters
    │   ├── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   └── provider[registry.terraform.io/hashicorp/random]
    ├── module.aft_feature_options
    │   └── provider[registry.terraform.io/hashicorp/aws] >= 4.27.0
    ├── module.aft_iam_roles
    │   ├── provider[registry.terraform.io/hashicorp/aws] >= 4.27.0
    │   ├── module.aft_exec_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.aft_service_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.audit_exec_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.audit_service_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.ct_management_exec_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.ct_management_service_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── module.log_archive_exec_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   └── module.log_archive_service_role
    │       └── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    ├── module.aft_lambda_layer
    │   ├── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
    │   ├── provider[registry.terraform.io/hashicorp/random]
    │   └── provider[registry.terraform.io/hashicorp/local]
    ├── module.packaging
    │   └── provider[registry.terraform.io/hashicorp/archive]
    ├── module.aft_account_request_framework
    │   ├── provider[registry.terraform.io/hashicorp/aws] >= 4.9.0
    │   └── provider[registry.terraform.io/hashicorp/time]
    └── module.aft_code_repositories
        ├── provider[registry.terraform.io/hashicorp/aws] >= 5.11.0, < 6.0.0
        └── provider[registry.terraform.io/hashicorp/local]

Providers required by state:

    provider[registry.terraform.io/hashicorp/aws]

    provider[registry.terraform.io/hashicorp/time]

    provider[registry.terraform.io/hashicorp/archive]

    provider[registry.terraform.io/hashicorp/local]

    provider[registry.terraform.io/hashicorp/random]

Bug Description The output of terraform init shows a missing prvider (I am on MacOS/arm64):

│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms supported.

The Repo clearly states, that this functionality is deprecated since 2020: https://github.com/hashicorp/terraform-provider-template and here https://github.com/hashicorp/terraform-provider-template/issues/85

To Reproduce Steps to reproduce the behavior:

  1. Simply do terrafrom init on a arm64 platform device.
  2. See the error shown under Bug Description

Expected behavior The template modules/aft/modules/aft-customizations/states.tfshould be migrated to use templatefile instead of template_file

Related Logs all has been given

Additional context nothing here

stumins commented 7 months ago

Hi @docspy,

Thanks for raising this issue. We've released AFT 1.11.1 as a hotfix for this bug.

Please try again with 1.11.1 and let us know if it does not resolve the problem.

docspy commented 7 months ago

Hi @stumins ,

Just tried it. It's working.

Thx for the quick support!