Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

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 <davidhsingyuchen@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant