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

Replace deprecated service-role policy #115

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Nov 13, 2020

Thanks to @maxeaubrey (ansible-collections/community.aws#278) the failures for the aws_ssm connection plugin have been identified as related to Amazon deprecating a policy: https://aws.amazon.com/blogs/mt/applying-managed-instance-policy-best-practices/

Plan for replacing the AmazonEC2RoleforSSM policy

To help you through the transition of your existing environments, the AmazonEC2RoleforSSM policy remains in place after the introduction of the new AmazonSSMManagedInstanceCore policy.

In the near future, the AmazonEC2RoleforSSM policy will be deprecated. The policy will continue to provide the included permissions to any currently attached users, groups, and roles. However, it will not be available for attachment to new resources and cannot be re-attached once detached from a resource. For more details, see Deprecated AWS Managed Policies.

Testing against a separate account I have been able to confirm that using AmazonSSMManagedInstanceCore instead of AmazonEC2RoleforSSM gets the tests running.

@jillr
Copy link
Collaborator

jillr commented Nov 14, 2020

@tremble the policy change itself looks fine but I'm getting attachment errors when trying to run the tests against staging

Unable to attach policy arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM to role ansible-test-ansible-test-lab-62411740-aws-ssm-role: An error occurred (AccessDenied) when calling the AttachRolePolicy operation: User: arn:aws:sts::966509639900:assumed-role/ansible-core-ci-test-dev/dev=remote=jillr  is not authorized to perform: iam:AttachRolePolicy on resource: role ansible-test-ansible-test-lab-62411740-aws-ssm-role"

@tremble
Copy link
Contributor Author

tremble commented Nov 14, 2020

@jillr - We also need ansible-collections/community.aws@5163d20

Which switches the policy it uses.

Copy link
Collaborator

@jillr jillr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get token errors when testing with community.aws/pull/295, but I believe that's unrelated to this change and we still need to deal with the policy deprecation. This lgtm and I'll leave a comment on the other PR.

@jillr jillr merged commit 6406276 into mattclay:master Nov 23, 2020
@tremble tremble deleted the connection_aws_ssm branch February 12, 2021 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants