hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.85k stars 9.2k forks source link

[Bug]: Inconsistent Final Plan with aws_apigw_base_path_mapping #39714

Open LucaMali opened 1 month ago

LucaMali commented 1 month ago

Terraform Core Version

1.9.1

AWS Provider Version

5.70.0

Affected Resource(s)

aws_apigw_base_path_mapping aws_apigw_gateway_domain_name

Expected Behavior

Successfully map of the custom domain name to the created API GW

Actual Behavior

Get an inconsistent final plan error :

-------------
Error: Provider produced inconsistent final plan
│
│ When expanding the plan for aws_api_gateway_base_path_mapping.mapping to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for    
│ .domain_name: inconsistent values for sensitive attribute.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
-------

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_api_gateway_domain_name" "domain_name_api_gw" {
  domain_name = "${var.name}.${lower(data.aws_ssm_parameter.stage.value)}.${lower(data.aws_ssm_parameter.scope.value)}.myexampledomain.com"
  regional_certificate_arn = data.aws_acm_certificate.certificate.arn
  endpoint_configuration {
    types = ["REGIONAL"]
  }
}

resource "aws_api_gateway_base_path_mapping" "mapping" {
  depends_on = [ aws_api_gateway_domain_name.domain_name_api_gw ]
  api_id = aws_api_gateway_rest_api.api_gw_rest.id
  domain_name = aws_api_gateway_domain_name.domain_name_api_gw.domain_name
}

Steps to Reproduce

To reprodue the error the resources needed on AWS are the one requested through the data structure, that are:

Then a variable "name" is needed as input, then the "terraform apply" comand can be run and the name variable can be passed through the terminal.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue