Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't make the clean up to succeed #653

Open
birojnayak opened this issue Jun 28, 2022 · 1 comment
Open

can't make the clean up to succeed #653

birojnayak opened this issue Jun 28, 2022 · 1 comment
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue queued

Comments

@birojnayak
Copy link

birojnayak commented Jun 28, 2022

Describe the bug

when the 'Application IAM Role: *** Create new *** ' is selected for Beanstalk deployment, the delete-deployment is failing to delete the newly IAM role created.

Expected Behavior

It should delete all resources the cli has created.

Current Behavior

the delete deployment failing...

Reproduction Steps

Used the new CLI,

  1. => dotnet aws deploy --project-path . --application-name testthedelete
    opted for the Beanstalk linux with rest default
  2. => Deployment succeeded
    3)=> dotnet aws delete-deployment testthedelete --silent

It can't delete the AWS::IAM::Role (the default IAM role) it's creating.

06/28/2022 05:13:14 | DELETE_IN_PROGRESS | AWS::IAM::Role | RecipeAppIAMRole9E73EEFA
06/28/2022 05:13:15 | DELETE_FAILED | AWS::IAM::Role | RecipeAppIAMRole9E73EEFA
06/28/2022 05:13:43 | DELETE_COMPLETE | AWS::ElasticBeanstalk::Application | RecipeBeanstalkApplication3558EA83
06/28/2022 05:13:44 | DELETE_FAILED | AWS::CloudFormation::Stack | testthedelete

Cannot delete entity, must detach all policies first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; Request ID: da4a8d50-7b6d-4c95-8c68-4bc4e7376d8c; Proxy: null)

Possible Solution

No response

Additional Information/Context

No response

Version used

latest

Operating System and version

Windows 10

@birojnayak birojnayak added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2022
@normj
Copy link
Member

normj commented Jun 28, 2022

This happens when IAM roles get policies added to them outside of the CloudFormation stack. When the delete happens that is essentially calling a CF stack delete and CloudFormation is unable to delete roles with policies not added as part of the stack.

We could potentially add a pre-step in the delete-deployment command that clears out policies in IAM roles before initiating the CF stack delete.

@ashishdhingra ashishdhingra added needs-review p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 24, 2023
@ashishdhingra ashishdhingra added p3 This is a minor priority issue queued and removed needs-review p2 This is a standard priority issue labels Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue queued
Projects
None yet
Development

No branches or pull requests

3 participants