$ terraform version
Terraform v0.12.20
+ provider.aws v2.70.0
provider "aws" {
access_key = var.ACCESS_KEY_ID
secret_key = var.SECRET_ACCESS_KEY
region = "eu-west-1"
}
resource "aws_vpc_dhcp_options" "vpc_dhcp_options" {
domain_name = "eu-west-1.compute.internal"
domain_name_servers = ["AmazonProvidedDNS"]
}
resource "aws_vpc" "vpc" {
cidr_block = "10.222.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
resource "aws_vpc_dhcp_options_association" "vpc_dhcp_options_association" {
vpc_id = aws_vpc.vpc.id
dhcp_options_id = aws_vpc_dhcp_options.vpc_dhcp_options.id
}
terraform destroy to be able to destroy even when the vpc is manually deleted.
terraform destroy fails to destroy when the vpc is manually deleted.
terraform apply$ terraform apply -var-file=creds.tfvars
aws_vpc.vpc: Creating...
aws_vpc_dhcp_options.vpc_dhcp_options: Creating...
aws_vpc_dhcp_options.vpc_dhcp_options: Creation complete after 2s [id=dopt-0f75930fb1a3d1234]
aws_vpc.vpc: Creation complete after 8s [id=vpc-025b8d051734e1234]
aws_vpc_dhcp_options_association.vpc_dhcp_options_association: Creating...
aws_vpc_dhcp_options_association.vpc_dhcp_options_association: Creation complete after 1s [id=dopt-0f75930fb1a3d1234-vpc-025b8d051734e1234]
Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
aws ec2 delete-vpc --vpc-id vpc-025b8d051734e1234
terraform destroy fails to destroy the aws_vpc_dhcp_options_association$ terraform destroy -var-file=creds.tfvars
aws_vpc_dhcp_options_association.vpc_dhcp_options_association: Destroying... [id=dopt-0f75930fb1a3d1234-vpc-025b8d051734e1234]
Error: InvalidVpcID.NotFound: The vpc ID 'vpc-025b8d051734e1234' does not exist
status code: 400, request id: foo
opened #14367 to fix
Related to: https://github.com/terraform-providers/terraform-provider-aws/issues/13826
The fix for this has been merged and will release with version 3.1.0 of the Terraform AWS Provider, Thursday next week. Thanks to @DrFaust92 for the fix. 👍
This has been released in version 3.1.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!
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!
Most helpful comment
Related to: https://github.com/terraform-providers/terraform-provider-aws/issues/13826
The fix for this has been merged and will release with version 3.1.0 of the Terraform AWS Provider, Thursday next week. Thanks to @DrFaust92 for the fix. 👍