-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(amplify): add the default amplify policy to the auto-generated role #29076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
b408d78
to
5402ad5
Compare
5402ad5
to
c6db37b
Compare
I've also updated the customRule integ to set a status. |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @johnf, thanks for the contribution. I'm not sure if we want to add this set of permissions to the role. I came to this conclusion independent of @pahud, so that is a pretty strong signal for me. I'm going to close this PR as something we are not willing to accept in its current iteration. Lets discuss with @pahud and myself on the issue if you want to figure something out.
@@ -224,6 +224,7 @@ export class App extends Resource implements IApp, iam.IGrantable { | |||
|
|||
const role = props.role || new iam.Role(this, 'Role', { | |||
assumedBy: new iam.ServicePrincipal('amplify.amazonaws.com'), | |||
managedPolicies: [iam.ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess-Amplify')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm down to add common sense permissions to this role, but I balk at the idea of adding this managed policy. We typically don't like adding managed policies to our roles in CDK, and instead opt for fine grained controls (so our users know exactly what policy they are adding.
As always, if you want to use AdministratorAccess-Amplify, you can easily add it in as your role. But I don't want to push that on to everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's precisely the conversation I wanted to have in the issue before creating a PR :)
I can try to develop a smaller set of permissions, i.e., the minimum required to deploy a basic app. But I might miss some key things I'm not using myself.
The main thing missing for me was permission to talk to the backend to grab the amplify configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense and I'm wary of my initial disdain towards the black box of the managed policy. Just need someone to confirm w me.
Hmm I've had an instant change of heart and will source another opinion :). Stay with me @johnf |
I think it's key that something is added to support amplify apps. Even if we define some prebaked permissions that someone can use or at a minimum add something to the documentation. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
1 similar comment
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
@kaizencc Any more thoughts on this? |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
2 similar comments
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
2 similar comments
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Issue # (if applicable)
Closes #28986
Reason for this change
The default created role for the Amplify App has no managed policy applied. So it can't do things like pull details of the backend config.
Description of changes
I've attached the Managed policy
AdministratorAccess-Amplify
which is what happens when you create an Amplify application in the console.Description of how you validated changes
I've added unit tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license