Skip to content

aws_datazone_environment resource fails with "unexpected state 'DISABLED'" despite successful environment creation #44872

@charan-177

Description

@charan-177

Terraform and AWS Provider Version

terraform version v1.5.7
awscc_provider 1.61.0

Affected Resource(s) or Data Source(s)

aws_datazone_environment

Expected Behavior

The aws_datazone_environment resource should recognize that 'DISABLED' is a valid terminal state for DataZone environments
Terraform should complete successfully when the environment is created, regardless of whether it's in 'DISABLED' or 'ACTIVE' state
The resource should not fail the apply operation if the environment exists and is functional but in 'DISABLED' state
The resource should either accept environment_role_arn as an input parameter OR handle 'DISABLED' state as a valid terminal state

Actual Behavior

Environment is successfully created in AWS DataZone
Environment remains in 'DISABLED' state
Terraform fails with: unexpected state 'DISABLED', wanted target 'ACTIVE'
Apply operation reports as failed despite successful resource creation
The resource does not accept environment_role_arn as an input parameter, preventing environments from reaching 'ACTIVE' state

Relevant Error/Panic Output

│ Error: waiting for creation AWS DataZone Environment ("glue-env"): unexpected state 'DISABLED', wanted target 'ACTIVE'. last error: %!s(<nil>)

│   with aws_datazone_environment.example,
│   on test.tf line 154, in resource "aws_datazone_environment" "example":
│  154: resource "aws_datazone_environment" "example" {

│ unexpected state 'DISABLED', wanted target 'ACTIVE'. last error: %!s(<nil>)

Sample Terraform Configuration

Click to expand configuration
resource "aws_datazone_environment" "example" {
  name                 = var.env_name
  blueprint_identifier = data.aws_datazone_environment_blueprint.custom_aws_service.id
  profile_identifier   = ""
  project_identifier   = awscc_datazone_project.test.project_id
  domain_identifier    = data.aws_datazone_domain.root.id
  description          = "Example environment"
  account_identifier   = data.aws_caller_identity.current.account_id
  account_region       = data.aws_region.current.region

}

Steps to Reproduce

terraform apply

Debug Logging

n/a

GenAI / LLM Assisted Development

n/a

Important Facts and References

No response

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/datazoneIssues and PRs that pertain to the datazone service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions