https://pulumi.com logo
#dotnet
Title
# dotnet
s

sticky-jordan-27156

09/23/2022, 8:13 AM
Hello, I'm trying to create a new AWS role policy but something is wrong in my json:
Copy code
let _policy =
        let args =
            Iam.RolePolicyArgs (
                Policy =
                    input
                        """
{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Action": [
            "logs:CreateLogGroup",
            "logs:CreateLogStream",
            "logs:PutLogEvents"
        ],
        "Resource": "arn:aws:logs:*:*:*"
    }]
}
""",
                Role = io lambdaRole.Id
            )

        Iam.RolePolicy ($"{loweredProjectName}-log-policy", args)
Leads to
Copy code
aws:iam:RolePolicy (autograph-log-policy):
    error: aws:iam/rolePolicy:RolePolicy resource 'project-log-policy' has a problem: "policy" contains an invalid JSON policy. Examine values at 'RolePolicy.Policy'.
I'm not sure why. Any ideas?
2 Views