1 Risposta
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
1
In order to create a Role with the trust policy you have provided with the managed policy attached, you will need to do the following:
// Create a Role that can be assumed by the Lambda's Role.
val role = Role(
stackInstance, "StsChimeChatAssumeRole",
RoleProps.builder()
.assumedBy(ArnPrincipal("arn:aws:iam::<account-number>:role/dev"))
.build()
)
// Add the managed policy to the Role.
role.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName("AmazonChimeFullAccess"))
The addToPolicy method allows you to attach IAM policies to a Role, not trust policies.
con risposta un anno fa
Contenuto pertinente
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata 4 mesi fa