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

AWS::Logs::ResourcePolicy.PolicyDocument - YAML support #91

Open
mbarneyjr opened this issue Mar 18, 2022 · 1 comment
Open

AWS::Logs::ResourcePolicy.PolicyDocument - YAML support #91

mbarneyjr opened this issue Mar 18, 2022 · 1 comment

Comments

@mbarneyjr
Copy link

Name of the resource

AWS::Logs::ResourcePolicy

Description

As with most other resource policies and identity policies, you're able to define these in YAML within a CloudFormation template. However, with the AWS::Logs::ResourcePolicy resource, you have to define the JSON string within your CloudFormation, which is less ideal. For instance, this example resource will fail with an error message Properties validation failed for resource MyLogGroupPolicy with message: #/PolicyDocument: expected type: String, found: JSONObject:

MyLogGroupPolicy:
  Type: AWS::Logs::ResourcePolicy
  Properties:
    PolicyName: MyLogGroupPolicy
    PolicyDocument:
      Version: '2012-10-17'
      Statement:
        - Effect: Allow
          Principal:
            Service: someservice.amazonaws.com
          Action: logs:PutLogEvents
          Resource: !GetAtt MyLogGroup.Arn

Other Details

Resource spec: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-resourcepolicy.html

AWS::IAM::Policy spec showing the definition of a policy in YAML: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants