Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider produced inconsistent result after apply - aws_vpc_dhcp_options_association.dns_resolver #16142

Closed
JustLeo opened this issue Nov 11, 2020 · 3 comments · Fixed by #18472
Assignees
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@JustLeo
Copy link

JustLeo commented Nov 11, 2020

Terraform Version 0.12.26 aws provider version 3.14.1

Affected Resource(s)

aws_vpc_dhcp_options_association.dns_resolver

Terraform Configuration Files

resource "aws_vpc_dhcp_options" "aws_client_dhcp" {
  domain_name          = "mydomainname"
  domain_name_servers  = ["${aws_instance.node01.private_ip}", "${cidrhost(aws_subnet.subnet.0.cidr_block, 2)}"]
  ntp_servers          = ["${aws_instance.node01.private_ip}"]
  netbios_name_servers = ["${aws_instance.node01.private_ip}"]
  netbios_node_type    = 2
}
resource "aws_vpc_dhcp_options_association" "dns_resolver" {
  vpc_id          = aws_vpc.awsnononapvpc01.id
  dhcp_options_id = aws_vpc_dhcp_options.aws_client_dhcp.id
}

Debug Output

Error: Provider produced inconsistent result after apply
When applying changes to aws_vpc_dhcp_options_association.dns_resolver,
provider "registry.terraform.io/-/aws" produced an unexpected new value for
was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Expected Behavior

Terraform apply should have been successful

Actual Behavior

Terraform apply fails

Steps to Reproduce

This does not happen all the time, running apply multiple times

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Nov 11, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 11, 2020
@militantslacker
Copy link

Same behavior with Terraform Version 0.14.6 and aws provider version 3.29.1

Debug output:

Error: Provider produced inconsistent result after apply
When applying changes to
module.test.aws_vpc_dhcp_options_association.dns_resolver, provider
"registry.terraform.io/hashicorp/aws" produced an unexpected new value: Root
resource was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 29, 2021
@bflad bflad self-assigned this Mar 29, 2021
bflad added a commit that referenced this issue Mar 29, 2021
…ventual consistency

Reference: #16142
Reference: #16796

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_vpc (19.27s)
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_dhcp (25.61s)
--- PASS: TestAccAWSDHCPOptionsAssociation_basic (25.84s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_vpc (21.51s)
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_dhcp (27.55s)
--- PASS: TestAccAWSDHCPOptionsAssociation_basic (28.10s)
```
bflad added a commit that referenced this issue Apr 1, 2021
…ventual consistency (#18472)

* resource/aws_vpc_dhcp_options_association: Handle read-after-create eventual consistency

Reference: #16142
Reference: #16796

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_vpc (19.27s)
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_dhcp (25.61s)
--- PASS: TestAccAWSDHCPOptionsAssociation_basic (25.84s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_vpc (21.51s)
--- PASS: TestAccAWSDHCPOptionsAssociation_disappears_dhcp (27.55s)
--- PASS: TestAccAWSDHCPOptionsAssociation_basic (28.10s)
```

* Update CHANGELOG for #18472

* r/vpc_dhcp_options_association: Tweak delete

Co-authored-by: Dirk Avery <dirk.avery@gmail.com>
@github-actions github-actions bot added this to the v3.35.0 milestone Apr 1, 2021
@ghost
Copy link

ghost commented Apr 1, 2021

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 2, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
3 participants