Skip to content

logs.restApi: true - automatic IAM role creation not working, deploy fails #78

@pheck

Description

@pheck

Expected behaviour

When I set provider.restApi: true to enable Logs for my API, serverless should create the required IAM role to allow writing logs as per the docs:

Let Serverless create and assign an IAM role for you (default behavior). Note that since this is a shared setting, this role is not removed when you remove the deployment.

Actual behaviour

Role is not created and deployment fails with error:
CREATE_FAILED: CustomApiGatewayAccountCloudWatchRole (Custom::ApiGatewayAccountRole) Received response status [FAILED] from custom resource. Message returned: The role with name serverlessApiGatewayCloudWatchRole cannot be found. See details in CloudWatch Log: 2025/08/21/[$LATEST]73241d9ab1404f1785cd345309c53c98 (RequestId: dd30dbef-3b64-41e9-a2b0-fd3ad57b2a6d)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions