{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": "*"
        },
        {
            "Resource": [
                "arn:aws:sns:us-east-1:${account_id}:${environment}-asset_encoding_status"
            ],
            "Action": [
                "sns:GetPlatformApplicationAttributes",
                "sns:GetTopicAttributes",
                "sns:Publish"
            ],
            "Effect": "Allow"
        },
        {
            "Effect": "Allow",
            "Action": [
                "dynamodb:GetItem"
            ],
            "Condition": {
                "ForAllValues:StringLike": {
                    "dynamodb:LeadingKeys": [
                        "lambda-assets-images-encoding:*"
                    ]
                }
            },
            "Resource": [
                "arn:aws:dynamodb:us-east-1:${account_id}:table/${environment}-ows-request-authorization"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "dynamodb:PutItem"
            ],
            "Condition": {
                "ForAllValues:StringNotLike": {
                    "dynamodb:LeadingKeys": [
                        "lambda-assets-images-encoding:*"
                    ]
                }
            },
            "Resource": [
                "arn:aws:dynamodb:us-east-1:${account_id}:table/${environment}-ows-request-authorization"
            ]
        },
        {
            "Resource": "arn:aws:s3:::*",
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets"
            ]
        },
        {
            "Resource": [
                "arn:aws:s3:::${environment}-orcd-mezzanine-assets/*",
                "arn:aws:s3:::${environment}-asset-storage/*"
            ],
            "Effect": "Allow",
            "Action": [
                "s3:GetBucketAcl",
                "s3:GetObject",
                "s3:GetObjectAcl",
                "s3:GetObjectVersion",
                "s3:GetObjectVersionAcl",
                "s3:ListBucket",
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:PutObjectVersionAcl"
            ]
        },
        {
            "Effect": "Allow",
            "Resource": "arn:aws:s3:::*",
            "Action": "s3:ListAllMyBuckets"
        },
        {
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::${environment}-orcd-raw-assets"
            ],
            "Action": [
                "s3:ListBucket"
            ]
        },
        {
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::${environment}-orcd-raw-assets/*"
            ],
            "Action": [
                "s3:GetObject",
                "s3:GetObjectAcl"
            ]
        }
    ]
}
