polite-king-94596
05/17/2022, 3:53 AM* Error putting IAM role policy fargate-role-policy: MalformedPolicyDocument: Partition "
1" is not valid for resource "arn:
1: o.apply(v => v.toJSON())
2: o.apply(v => JSON.stringify(v))
const fargateTaskRole = fargateTaskDefinition.taskRole;
const fargateTaskRoleId = fargateTaskRole!.id
const fargateRolePolicy = new aws.iam.RolePolicy(
`fargate-role-policy`,
{
role: fargateTaskRoleId,
policy: JSON.stringify({
Version: '2012-10-17',
Statement: [
{
Action: ['s3:ListBucket', 's3:PutObject'],
Effect: 'Allow',
Resource: [someBucket.bucket.apply(bucket => "arn:aws:s3:::${bucket}/*")],
},
],
}),
},
);
Any help appreciated!little-cartoon-10569
05/17/2022, 4:03 AMsomeBucket.bucket
value isn't available until deploy time.policy
.JSON.stringify(
at the beginning, and )
at the end. Then check your IDE for validation errors, and all should be well.polite-king-94596
05/18/2022, 5:10 PMlittle-cartoon-10569
05/18/2022, 8:37 PM