LoginSignup
2
0

More than 1 year has passed since last update.

samでCloudWatchLogsのログ記録を有効化しようとすると「CloudWatch Logs role ARN must be set in account settings to enable logging」と出る

Posted at

エラーメッセージ

CloudWatch Logs role ARN must be set in account settings to enable logging

原因

API Gatewayに設定するCloudwatchLogs書き込み用のRoleがセットされていないから
image.png

対処方法

このように、Roleをセットする。

Resources:
  ApiCWLRoleArn:
    Type: AWS::ApiGateway::Account
    Properties:
      CloudWatchRoleArn: !GetAtt CloudWatchRole.Arn

  CloudWatchRole:
      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'

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0