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

stop making IAM role assume itself #109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidhsingyuchen
Copy link

Before This PR

An error would occur when one is following this step:

workshop:~/environment $ aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing" || aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com"

An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::<redacted_account_id>:assumed-role/ecsworkshop-admin/i-<redacted_instance_id> is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::<redacted_account_id>:role/ecsworkshop-admin

An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::<redacted_account_id>:assumed-role/ecsworkshop-admin/i-<redacted_instance_id> is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::<redacted_account_id>:role/ecsworkshop-admin

Why

From this IAM blog post:

AWS is changing role assumption behavior to always require self-referential role trust policy grants

This explains why it doesn't work for now. Next question, do we need to add that policy?

the self-assuming role behavior exhibited by code or human users is very likely to be unnecessary and counterproductive

Since the role is already assumed, it's redundant to assume itself again, so those 2 related lines are removed in this PR.

Signed-off-by: Hsing-Yu (David) Chen <[email protected]>
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.

1 participant