Skip to content

Commit 4ffbdea

Browse files
committed
Client vpn endpoint not found implies authorization rule does not exists
1 parent 5bcbfd0 commit 4ffbdea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

aws/resource_aws_ec2_client_vpn_authorization_rule.go

+8
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func resourceAwsEc2ClientVpnAuthorizationRuleRead(d *schema.ResourceData, meta i
111111
d.SetId("")
112112
return nil
113113
}
114+
if isAWSErr(err, tfec2.ErrCodeClientVpnEndpointIdNotFound, "") {
115+
log.Printf("[WARN] EC2 Client VPN (%s) not found, removing rule from state", d.Id())
116+
d.SetId("")
117+
return nil
118+
}
114119
if err != nil {
115120
return fmt.Errorf("error reading Client VPN authorization rule: %w", err)
116121
}
@@ -174,6 +179,9 @@ func deleteClientVpnAuthorizationRule(conn *ec2.EC2, input *ec2.RevokeClientVpnI
174179
if isAWSErr(err, tfec2.ErrCodeClientVpnAuthorizationRuleNotFound, "") {
175180
return nil
176181
}
182+
if isAWSErr(err, tfec2.ErrCodeClientVpnEndpointIdNotFound, "") {
183+
return nil
184+
}
177185
if err != nil {
178186
return err
179187
}

0 commit comments

Comments
 (0)