skip to Main Content

I am following a tutorial in AWS and came across to create a policy. But I am getting a json error. It doesn’t tell me much and not sure how to fix it.

enter image description here

I tried to paste it in the VS code to get the idea but vs code is complaining about Invalid escape character in string.json(261)

2

Answers


  1. Chosen as BEST ANSWER

    Resolved

    {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "cloudformation:*",
                "iam:PassRole"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "s3:Get*",
                "s3:Put*",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::artifact-bucket-{DEV_ACCOUNT_ID}",
                "arn:aws:s3:::artifact-bucket-{DEV_ACCOUNT_ID}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [ 
                "kms:DescribeKey", 
                "kms:GenerateDataKey*", 
                "kms:Encrypt", 
                "kms:ReEncrypt*", 
                "kms:Decrypt" 
            ], 
            "Resource": "{KEY_ARN}",
            "Effect": "Allow"
        }
    ]
    

    }

    Found this here https://github.com/aws-samples/aws-cross-account-cicd-pipeline


  2. You are missing the " at cloudformation

    it should be

    "Action": [
    "cloudformation:*",
    "iam;PassRole"
    ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search