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.7k stars 9.07k forks source link

[Bug]: unexpected state PENDING during aws_mwaa_environment creation #37223

Open maxmuffin opened 3 months ago

maxmuffin commented 3 months ago

Terraform Core Version

1.5.0

AWS Provider Version

5.39.0

Affected Resource(s)

aws_mwaa_environment

Expected Behavior

resource creation without errors

Actual Behavior

resource creation with error: waiting for MWAA Environment (airflow-environment) create: unexpected state 'PENDING', wanted target 'AVAILABLE', last error: %!s()

Relevant Error/Panic Output Snippet

waiting for MWAA Environment (airflow-environment) create: unexpected state 'PENDING', wanted target 'AVAILABLE', last error: %!s(<nil>)

Terraform Configuration Files

resource "aws_mwaa_environment" "airflow" {

  name                  = var.airflow_service_name
  execution_role_arn    = var.airflow_execution_role
  source_bucket_arn     = "arn:aws:s3:::${var.apps_bucket}"
  dag_s3_path           = "dags/"
  endpoint_management   = "CUSTOMER"

  network_configuration {
    security_group_ids = var.airflow_security_group_ids
    subnet_ids         = var.airflow_subnet_ids
  }
}

Steps to Reproduce

add attribute endpoint_management = "CUSTOMER" in aws_mwaa_environment resource

Debug Output

No response

Panic Output

No response

Important Factoids

MWAA required VPC endpoints needs to be managed by CUSTOMER. Selecting attribute endpoint_management equal to CUSTOMER, mwaa enter in PENDING state during creation, that is not supported.

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

preetsindhal commented 1 month ago

Hi @maxmuffin did you use any workaround for now? Something like making terraform wait for a specific timeout after it initiated the mwaa creation?

Thanks

github-actions[bot] commented 1 month ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

maxmuffin commented 1 month ago

Hi @preetsindhal , for now the resource has been created manually from the AWS console and imported directly into the terraform state to manage at least the update and delete operations.