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

APIGW Snippets Should Enable APIGW to CW Service Role. #112

Open
1 of 2 tasks
anish-kunduru opened this issue Apr 13, 2023 · 1 comment
Open
1 of 2 tasks

APIGW Snippets Should Enable APIGW to CW Service Role. #112

anish-kunduru opened this issue Apr 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@anish-kunduru
Copy link
Contributor

Aws Connected Device Framework Affected Module(s):

snippets/cfn-apiGateway*

I'm submitting a ...

  • bug report
  • feature request

Description:

CDF deploy fails with the error: "CloudWatch Logs role ARN must be set in account settings to enable logging."

Current behavior:

Any account where CDF is configured with EnableApiGatewayAccessLogs = true, and the service-linked role hasn't been defined.

Expected behavior:

The pipeline should deploy the SLR.

Steps to reproduce:

Deploy CDF with an APIGW configured for access logs in a fresh AWS account.

Additional Information:

@anish-kunduru anish-kunduru added the bug Something isn't working label Apr 13, 2023
@anish-kunduru
Copy link
Contributor Author

The following CloudFormation does what we want. Unfortunately, it is not straightforward to add to the snippets because those are already defined as AWS::Serverless::API.

  ApiCloudWatchRoleArn:
    Condition: EnableApiGatewayAccessLogs
    Type: AWS::ApiGateway::Account
    Properties: 
      CloudWatchRoleArn: !GetAtt CloudWatchRole.Arn
  
  CloudWatchRole:
    Condition: EnableApiGatewayAccessLogs
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          Action: 'sts:AssumeRole'
          Effect: Allow
          Principal:
            Service: apigateway.amazonaws.com
      Path: /
      ManagedPolicyArns:
        - 'arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant