mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #9583 from hashicorp/aws-iam-delete-force_destroy
provider/aws: Delete Loging Profile from IAM User on force_destroy
This commit is contained in:
commit
df18307662
@ -190,6 +190,16 @@ func resourceAwsIamUserDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
return fmt.Errorf("Error deleting access key %s: %s", k, err)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = iamconn.DeleteLoginProfile(&iam.DeleteLoginProfileInput{
|
||||
UserName: aws.String(d.Id()),
|
||||
})
|
||||
if err != nil {
|
||||
if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Error deleting Account Login Profile: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
request := &iam.DeleteUserInput{
|
||||
|
Loading…
Reference in New Issue
Block a user