I am trying to add a managed policy to a role that contains an account id:
const role = iam.Role.fromRoleArn(
this,
'Role',
`arn:aws:iam::${cdk.Stack.of(this).account}:role/example-role`,
);
role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonDynamoDBFullAccess'));
role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonKinesisFullAccess'));
on the aws console i can't see the policy being added to the role.
fyi My aws-cli
is logged with the right account.