Hi everybody! - I started using pulumi and I not s...
# general
v
Hi everybody! - I started using pulumi and I not sure how to do it, maybe if anyone can help it will be great. I'm creating a IAM Role and I need to attach to an existent  aws policy
Copy code
const roleES = new aws.iam.Role(`es-role-test`, {
   name: `CognitoAccessForAmazonES`,
   assumeRolePolicy: {
   Version: '2012-10-17',
   Statement: [
   {
     Effect: 'Allow',
     Principal: {
        Service: '<http://es.amazonaws.com|es.amazonaws.com>',
     },
     Action: 'sts:AssumeRole',
     Sid: '',
   },
 ],
}
  I wanna add the 
AmazonESCognitoAccess
l
Use an aws.iam.RolePolicyAttachment resource.
🙌 1
It takes both a policy and a role.