JSON语法错误:修复创建策略时的JSON语法错误

ezykj2lf  于 2023-02-01  发布在  其他
关注(0)|答案(2)|浏览(169)

我正在AWS上学习一个教程,创建了一个策略。但是我得到了一个json错误。它没有告诉我太多,也不知道如何修复它。

我试图将其粘贴到VS代码中以获得该想法,但VS代码抱怨Invalid escape character in string.json(261)

ubof19bj

ubof19bj1#

你错过了"在云形成时
应该是

"Action": [
"cloudformation:*",
"iam\;PassRole"
]
tgabmvqs

tgabmvqs2#

已解决

{
"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"
    }
]

}
在这里找到这个https://github.com/aws-samples/aws-cross-account-cicd-pipeline

相关问题