https://pulumi.com logo
Title
b

blue-mouse-93986

02/21/2023, 4:10 PM
Hi I'm trying to create a role using 2 managed AWS policies
const CloudWatch_CrossAccountSharingRole = new aws.iam.Role(
  `MyEnv_CloudWatch-CrossAccountSharingRole`,
  {
    assumeRolePolicy: {
      Statement: [
        {
          Action: 'sts:AssumeRole',
          Effect: 'Allow',
          Principal: { AWS: `arn:aws:iam::${MONITORING_ACCOUNT_ID}:root` },
        },
      ],
      Version: '2012-10-17',
    },
    managedPolicyArns: [
      aws.iam.ManagedPolicy.CloudWatchReadOnlyAccess,
      aws.iam.ManagedPolicy.CloudWatchAutomaticDashboardsAccess
    ],
    name: `MyEnv_CloudWatch-CrossAccountSharingRole`,
  }
)
As you can see the AWS Managed Policy Is there, but I'm getting an exception are there any ways to get it?
b

billowy-army-68599

02/21/2023, 4:22 PM
@blue-mouse-93986 this looks like there isn’t an enum for that, just use the string instead
b

blue-mouse-93986

02/22/2023, 11:49 AM
ok, thx