-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: aws_servicecatalog_principal_portfolio_association does not correctly clean up IAM_PATTERN principal types #32229
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
👍 |
I am having the same issue - when will this be fixed roughly? |
@tanyuzhuo - while I can't comment on a timeline, I can point you to the Prioritization Guide - one of the factors that helps is as follows Please be sure to 👍 a PR proposed to address the issue - #32243 |
Upvoted fix... does anyone have any potential workarounds in the meanwhile? Perhaps an AWS-CLI type command to disassociate on run of destroy? |
Workaround for anyone struggling:
|
@ewbankkit This is a good fix that would alleviate some pain for some that are having to implement workarounds (see above) |
This functionality has been released in v5.16.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.5.1
AWS Provider Version
5.5.0
Affected Resource(s)
aws_servicecatalog_principal_portfolio_association
Expected Behavior
When you run a
terraform destroy
the principal type should be disassociated, regardless if it is a type ofIAM
or ofIAM_PATTERN
.Actual Behavior
When you run a
terraform destroy
the principal types ofIAM
are successfully deleted, but the principal types ofIAM_PATTERN
are retained.This behavior is explained by how the golang SDK is called.
If you have a principal type of
IAM_PATTERN
and you callDisassociatePrincipalFromPortfolio
without specifying aPrincipalType
ofIAM_PATTERN
in theDisassociatePrincipalFromPortfolioInput
you'll receiveAn error occurred (ResourceNotFoundException) when calling the DisassociatePrincipalFromPortfolio operation
.The AWS Provider is treating this resource not found exception as believing the resource is already cleaned up, and skips the removal.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
aws_servicecatalog_portfolio
resourceaws_servicecatalog_principal_portfolio_association
resourceterraform plan
to create the resourcesterraform destroy
and receive an errorError: deleting Service Catalog Portfolio (port-************): ResourceInUseException: Portfolio port--************): still has associated Principals
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: