fix(iam): support adding permissions to imported roles#2805
Merged
Conversation
4 tasks
skinny85
approved these changes
Jun 15, 2019
Contributor
skinny85
left a comment
There was a problem hiding this comment.
Just some tiny comments/questions.
| // FIXME: Add warning that we're ignoring this | ||
| public attachInlinePolicy(policy: Policy): void { | ||
| this.attachedPolicies.attach(policy); | ||
| policy.attachToRole(this); |
Contributor
There was a problem hiding this comment.
The methods addToPolicy and attachInlinePolicy are the same as in the Role class. I wonder whether we could use inheritance here to remove the duplication.
| ], | ||
| Version: "2012-10-17" | ||
| }, | ||
| Roles: [ "MyRole" ] |
Contributor
There was a problem hiding this comment.
I'm not sure I understand this test. Where does the Role with the logical ID MyRole come from?
Contributor
There was a problem hiding this comment.
Oh wait, is this the physical name of the Role? Does that work in CFN?
Contributor
Author
There was a problem hiding this comment.
CFN is just doing a put-role-policy call with this parameter.
This was referenced Aug 22, 2019
This was referenced Dec 12, 2019
This was referenced Jan 20, 2020
This was referenced Sep 24, 2024
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now create a Policy and attach it to imported roles as well.
This will only work for imported roles in the same account. If you
need to reference roles in other accounts without trying to add
these policy statements, use an
AwsPrincipal.Relates to #2381, #2651, #2652, #2662.
Pull Request Checklist
designfolderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.