aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
461 stars 116 forks source link

How enable SSR logs for existing Amplify App #3964

Closed ashokvaddevalli closed 2 weeks ago

ashokvaddevalli commented 2 weeks ago

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

Other

Which UI component?

Other

How is your app built?

Svelte

What browsers are you seeing the problem on?

No response

Which region are you seeing the problem in?

No response

Please describe your bug.

Enable SSR logs for existing Amplify App? We are missed to enable SSR logs during create app but we want enable now for existing App. But we didn't see any options in settings for enable SSR logs for existing App.

What's the expected behaviour?

Enable SSR logs for existing Amplify App? We are missed to enable SSR logs during create app but we want enable now for existing App. But we didn't see any options in settings for enable SSR logs for existing App.

Help us reproduce the bug!

Enable SSR logs for exiting Amplify App? We are missed to enable SSR logs during create app but we want enable now for existing App. But we didn't see any options in settings for enable SSR logs for existing App.

Code Snippet

// Put your code below this line.

Console log output

No response

Additional information and screenshots

No response

ferdingler commented 2 weeks ago

Hi, yes, Amplify will deliver logs automatically so long as your app has an IAM role attached to it with the right permissions.

  1. Attach an IAM role to your app:
aws amplify update-app --app-id YOUR_APP_ID --iam-service-role-arn arn:aws:iam::YOUR_ACCOUNT_ID:role/YOUR_ROLE_NAME

Ensure that the role has the following trust policy that allows Amplify to assume it:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "amplify.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

and the role needs at least the following permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogStream",
                "logs:CreateLogGroup",
                "logs:PutLogEvents"
            ],
            "Resource": "arn:aws:logs:*:*:*"
        }
    ]
}
  1. Kickoff a deployment of your App, this is necessary whenever you update the role.
aws amplify start-job --app-id YOUR_APP_ID --branch-name YOUR_BRANCH_NAME --job-type RELEASE
github-actions[bot] commented 2 weeks ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.