polite-king-94596
05/18/2022, 5:55 PMvictorious-church-57397
05/18/2022, 7:51 PMconst examplePolicyDocument: iam.PolicyDocument = {
Version: '2012-10-17',
Statement: [
{
Effect: 'Allow',
Action: ['s3:GetBucketAcl', 's3:ListBucket', 's3:PutObject'],
Resource: [pulumi.interpolate`${bucket.arn}`, pulumi.interpolate`${bucket.arn}/*`],
},
],
};
and you can use like this:
new iam.RolePolicy(
'exampleRolePolicy',
{
role: exampleRole.id,
policy: examplePolicyDocument,
},
);
polite-king-94596
05/18/2022, 8:18 PMlittle-cartoon-10569
05/18/2022, 8:40 PMbucket.arn
.victorious-church-57397
05/18/2022, 8:41 PMlittle-cartoon-10569
05/18/2022, 8:41 PMbucket
is an object and bucket.arn
is an ARN, then you don't need interpolate.interpolate
is just a convenience function for s.apply(s => s.toString())
victorious-church-57397
05/18/2022, 8:43 PM