Skip to content

Instantly share code, notes, and snippets.

@clstokes
Created December 3, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clstokes/288c2a4664576865b3bbbe21c9f54b29 to your computer and use it in GitHub Desktop.
Save clstokes/288c2a4664576865b3bbbe21c9f54b29 to your computer and use it in GitHub Desktop.
Pulumi Example: Create multiple AWS IAM Roles.
import * as aws from "@pulumi/aws";
const assumeRolePolicyDocument = JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Principal: {
Service: "ec2.amazonaws.com"
},
Effect: "Allow",
Sid: ""
}]
});
// IAM
const role1 = new aws.iam.Role("role1", {
assumeRolePolicy: assumeRolePolicyDocument
});
const role2 = new aws.iam.Role("role2", {
assumeRolePolicy: assumeRolePolicyDocument
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment