diff --git a/.changelog/36933.txt b/.changelog/36933.txt new file mode 100644 index 00000000000..f9b8927ea92 --- /dev/null +++ b/.changelog/36933.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_vpc_dhcp_options: Fix `NotFound` error handling on delete +``` diff --git a/internal/service/ec2/errors.go b/internal/service/ec2/errors.go index aa1f4c79e07..4213ded62a8 100644 --- a/internal/service/ec2/errors.go +++ b/internal/service/ec2/errors.go @@ -41,6 +41,7 @@ const ( errCodeInvalidConversionTaskIdMalformed = "InvalidConversionTaskId.Malformed" errCodeInvalidCustomerGatewayIDNotFound = "InvalidCustomerGatewayID.NotFound" errCodeInvalidDHCPOptionIDNotFound = "InvalidDhcpOptionID.NotFound" + errCodeInvalidDHCPOptionsIDNotFound = "InvalidDhcpOptionsID.NotFound" errCodeInvalidFleetIdNotFound = "InvalidFleetId.NotFound" errCodeInvalidFlowLogIdNotFound = "InvalidFlowLogId.NotFound" errCodeInvalidGatewayIDNotFound = "InvalidGatewayID.NotFound" diff --git a/internal/service/ec2/vpc_dhcp_options.go b/internal/service/ec2/vpc_dhcp_options.go index 4c4bec1a185..429fd26e421 100644 --- a/internal/service/ec2/vpc_dhcp_options.go +++ b/internal/service/ec2/vpc_dhcp_options.go @@ -214,7 +214,7 @@ func resourceVPCDHCPOptionsDelete(ctx context.Context, d *schema.ResourceData, m return conn.DeleteDhcpOptionsWithContext(ctx, input) }, errCodeDependencyViolation) - if tfawserr.ErrCodeEquals(err, errCodeInvalidDHCPOptionIDNotFound) { + if tfawserr.ErrCodeEquals(err, errCodeInvalidDHCPOptionsIDNotFound) { return diags }