Terraform-provider-aws: aws_service_discovery_private_dns_namespace missing last error

Created on 2 Jan 2018  ยท  9Comments  ยท  Source: hashicorp/terraform-provider-aws

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.11.1

  • provider.aws v1.6.0

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_service_discovery_private_dns_namespace

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "aws_service_discovery_private_dns_namespace" "internal" {
  name = "example.internal"
  description = "Default service discovery namespace"
  vpc = "${aws_vpc.default.id}"
}

Debug Output

* module.vpc.aws_service_discovery_private_dns_namespace.internal: 1 error(s) occurred:

* aws_service_discovery_private_dns_namespace.internal: unexpected state 'FAIL', wanted target 'SUCCESS'. last error: %!s(<nil>)

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Expected Behavior

An actual error message with debug information

Actual Behavior

last error: %!s()

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
bug servicservicediscovery

Most helpful comment

This happened to me when trying to use terraform to create a namespace that already existed.

All 9 comments

This happened to me when trying to use terraform to create a namespace that already existed.

I later figured out that was the issue when working directly with the AWS CLI

For anyone that stumbles across this, I also got the error when creating a namespace with a name that overlapped an existing private hosted zone. For example I already had:

foo.bar.local

as a private hosted zone, then tried to create a aws_service_discovery_private_dns_namespace with:

foo.baz.bar.local

which failed, if you try it using the CLI it just returns an operation id but the namespace doesn't get created and isn't show when listing namespaces.

I've just hit the same issue.

some solution?

Pull request submitted: #7118

Merged in support for the resources to report extended status from ErrorCode and ErrorMessage from the operations API response when Status is FAIL. This gives full details about why it failed, e.g.

aws_service_discovery_private_dns_namespace.subdomain: CANNOT_CREATE_HOSTED_ZONE: The VPC that you chose, vpc-0c04acdb2f40a49d6 in region us-west-2, is already associated with another private hosted zone that has an overlapping name space, wavsx.example.com.. (Service: AmazonRoute53; Status Code: 400; Error Code: ConflictingDomainExists; Request ID: 600b3096-15c4-11e9-97af-ade1478492a8)

This will release in version 1.56.0 of the Terraform AWS provider, likely middle of this week.

This has been released in version 1.56.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings