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

(amplify-alpha): The default created role is empty #28986

Open
johnf opened this issue Feb 5, 2024 · 3 comments
Open

(amplify-alpha): The default created role is empty #28986

johnf opened this issue Feb 5, 2024 · 3 comments
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. effort/medium Medium work item – several days of effort p3

Comments

@johnf
Copy link
Contributor

johnf commented Feb 5, 2024

Describe the bug

When I create an amplify app, the associated role has no policies.

Expected Behavior

If I do the same thing in the web interface it creates a role with the managed policy AdministratorAccess-Amplify attached

Current Behavior

The role has no policies

Reproduction Steps

    const app = new amplify.App(this, 'WebApp', {
      appName: 'web',
      platform: amplify.Platform.WEB_COMPUTE,
      sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
        owner,
        repository,
        oauthToken,
      }),
});

Possible Solution

I've worked around this by manually creating and passing in a role

Additional Information/Context

No response

CDK CLI Version

2.125.0

Framework Version

No response

Node.js Version

20.11.0

OS

Linux

Language

TypeScript

Language Version

No response

Other information

No response

@johnf johnf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 5, 2024
@github-actions github-actions bot added the @aws-cdk/aws-amplify Related to AWS Amplify label Feb 5, 2024
@johnf
Copy link
Contributor Author

johnf commented Feb 5, 2024

I'm happy to kick off a pull request adding the managed policy if that's a good fix

@pahud
Copy link
Contributor

pahud commented Feb 5, 2024

Thank you for the report. I am not sure if it's a good idea but feel free to submit a PR for that.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 5, 2024
@Pr0fil3
Copy link

Pr0fil3 commented Mar 29, 2024

It's very user unfriendly, mainly for an inexperienced CDK user, that it doesn't even setup the CloudWatch log roles for Web Compute Apps.

In case anyone else with as little experience as me stumbles upon this, here's a quick and dirty way to setup the CloudWatch log roles to be able to debug your deployed app.

    const app = new amplify.App(...)
    app.grantPrincipal.addToPrincipalPolicy(
      new PolicyStatement({
        actions: ['logs:CreateLogStream', 'logs:CreateLogGroup', 'logs:DescribeLogGroups', 'logs:PutLogEvents'],
        resources: ['*'],
      }),
    );

@pahud pahud added p3 and removed p2 labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. effort/medium Medium work item – several days of effort p3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants