-
Notifications
You must be signed in to change notification settings - Fork 341
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
iam_managed_policy - Unknown parameter in input: "RoleName", must be one of: GroupName, PolicyArn #2067
Comments
One more thing that I didn't realize when I gave my example: There's a role with the policy as well. A fuller example involving both the create and destroy steps would be - hosts: localhost
tasks:
- amazon.aws.iam_managed_policy:
policy_name: DeleteMePolicy
policy: "{{ delete_me_policy | to_json }}"
state: present
- amazon.aws.iam_role:
assume_role_policy_document: "{{ assume_role_policy | to_json }}"
managed_policies:
- DeleteMePolicy
name: delete-me-access-role
wait: true
- amazon.aws.iam_managed_policy:
policy_name: DeleteMePolicy
state: absent
vars:
assume_role_policy:
Statement:
- Action:
- sts:AssumeRole
Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Version: '2012-10-17'
delete_me_policy:
Statement:
- Action: s3:PutObject
Effect: Allow
Resource: "arn:aws:s3:::*/ec2_instances/${aws:userid}/*"
Sid: VisualEditor0
Version: '2012-10-17' This works fine on Ansible 9.3.0, but fails on Ansible 9.5.1. |
@vonschultz Thanks for this, I've found the copy and paste failure that's triggered this. |
…mValidationError during policy deletion (#2068) iam_managed_policy - fix ParamValidationError during policy deletion SUMMARY fixes: #2067 Introduced by #1998 A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user. ISSUE TYPE Bugfix Pull Request COMPONENT NAME iam_managed_policy plugins/module_utils/iam.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis
…mValidationError during policy deletion (#2068) iam_managed_policy - fix ParamValidationError during policy deletion SUMMARY fixes: #2067 Introduced by #1998 A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user. ISSUE TYPE Bugfix Pull Request COMPONENT NAME iam_managed_policy plugins/module_utils/iam.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis (cherry picked from commit 970c303)
…mValidationError during policy deletion (#2068) (#2071) [PR #2068/970c3032 backport][stable-7] iam_managed_policy - fix ParamValidationError during policy deletion This is a backport of PR #2068 as merged into main (970c303). SUMMARY fixes: #2067 Introduced by #1998 A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user. ISSUE TYPE Bugfix Pull Request COMPONENT NAME iam_managed_policy plugins/module_utils/iam.py ADDITIONAL INFORMATION Reviewed-by: Mark Chappell
@vonschultz, the fix has now been merged. We hope to release 7.6.0 in about 1 weeks time, at which point you should be able to pull the update from galaxy.ansible.com. |
…mValidationError during policy deletion (ansible-collections#2068) iam_managed_policy - fix ParamValidationError during policy deletion SUMMARY fixes: ansible-collections#2067 Introduced by ansible-collections#1998 A copy and paste mistake in ansible-collections#1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user. ISSUE TYPE Bugfix Pull Request COMPONENT NAME iam_managed_policy plugins/module_utils/iam.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis
Summary
According to the documentation of
amazon.aws.iam_managed_policy
it should be possible to remove an existing IAM Managed Policy by just giving the name and the stateabsent
toiam_managed_policy
and this worked fine when running Ansible 9.3.0:After upgrading to Ansible 9.5.1, it gives the following error:
Issue Type
Bug Report
Component Name
iam_managed_policy
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Ubuntu 20.04
Steps to Reproduce
EC2-instance-S3-access
.Expected Results
No errors, the policy disappears.
Actual Results
Including
-vvv
(but changing AWS account id to 1234... to be on the safe side):Code of Conduct
The text was updated successfully, but these errors were encountered: