Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When creating a VPC with DHCP options set on it and then attempting to destroy it later, it is unable to due to their being no default options set.
Error: disassociating EC2 DHCP Options Set (dopt-37ceb7c8) from VPC (vpc-f9b613f1): InvalidDhcpOptionID.NotFound: DhcpOptionID default does not exist.
Expected Behavior
I expect to be able to run a terraform destroy on a VPC with a DHCP option set attached that was created previously with terraform inside localstack.
How are you starting LocalStack?
With the localstack
script
Steps To Reproduce
How are you starting localstack (e.g., bin/localstack
command, arguments, or docker-compose.yml
)
localstack start
Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
`terraform apply` followed by a `terraform destroy` after the VPC has been created.
Environment
- OS: MacOS 13.5.1
- LocalStack: 2.2.1.dev (latest image tag)
LocalStack version: 2.2.1.dev
LocalStack Docker container id: 3bc3cdc33c14
LocalStack build date: 2023-09-25
LocalStack build git hash: bfa47930
Anything else?
Error from the destroy:
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
module.core.module.vpc.module.vpc.aws_vpc_dhcp_options_association.this[0]: Destroying... [id=dopt-37ceb7c8-vpc-f9b613f1]
╷
│ Error: disassociating EC2 DHCP Options Set (dopt-37ceb7c8) from VPC (vpc-f9b613f1): InvalidDhcpOptionID.NotFound: DhcpOptionID default does not exist.
│ status code: 400, request id: 891941d7-1b42-4d39-83bd-825054e11c62
│
Output of describe-dhcp-options:
❯ awslocal ec2 describe-dhcp-options
{
"DhcpOptions": [
{
"DhcpConfigurations": [
{
"Key": "domain-name-servers",
"Values": [
{
"Value": "AmazonProvidedDNS"
}
]
},
{
"Key": "domain-name",
"Values": [
{
"Value": "core-test.co"
}
]
}
],
"DhcpOptionsId": "dopt-37ceb7c8",
"Tags": []
}
]
}