0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【CFn】yamlフォーマットでJson型の書き方

Posted at

CloudFormationで値がjson型の場合の書き方でハマったので、そのときの解決した書き方を残しておく。

SNSのポリシードキュメントを書くときにjson型となっていたので、インラインでyaml内にjson形式でポリシーを書いたらエラーになった。

Type: AWS::SNS::TopicInlinePolicy
Properties:
  PolicyDocument: Json
  TopicArn: String

実際の書き方は↓になる。

Type: AWS::SNS::TopicInlinePolicy
Properties:
  PolicyDocument:
    Version: '2012-10-17'
    Statement:
      - Effect: Allow
        Principal:
          AWS: "*"
        Action:
          - "SNS:GetTopicAttributes"
          - "SNS:SetTopicAttributes"
          - "SNS:AddPermission"
          - "SNS:RemovePermission"
          - "SNS:DeleteTopic"
          - "SNS:Subscribe"
          - "SNS:ListSubscriptionsByTopic"
          - "SNS:Publish"
        Resource: !Sub "arn:aws:sns:ap-northeast-1:${AWS::AccountId}:${MySNSTopic}"
        Condition:
          StringEquals:
            "AWS:SourceOwner": !Sub ${AWS::AccountId}
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?