Hi I'm trying to create a role using 2 managed AW...
# typescript
b
Hi I'm trying to create a role using 2 managed AWS policies
Copy code
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
@blue-mouse-93986 this looks like there isn’t an enum for that, just use the string instead
b
ok, thx