-
-
Save zombor/43cd30735aa72bc02be4ef878aa073c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as aws from "@pulumi/aws"; | |
import * as pulumi from "@pulumi/pulumi"; | |
const conf: any = { iamRoles: [ 'bar', 'baz' ] }; | |
const instanceAssumeRolePolicy = aws.iam.getPolicyDocument({ | |
statements: [{ | |
effect: "Allow", | |
actions: ["sts:AssumeRole"], | |
principals: [{ | |
type: "AWS", | |
identifiers: ["ec2.amazonaws.com"], | |
}], | |
}], | |
}); | |
const roles: aws.iam.Role[] = []; | |
for (const roleName of conf.iamRoles) { | |
const r = new aws.iam.Role(roleName, { | |
assumeRolePolicy: instanceAssumeRolePolicy.json, | |
}); | |
const foo = r.name.apply(name => `${name}`); | |
console.log(foo); | |
roles.push(r); | |
} | |
export const iamRoleNames: Array<pulumi.Output<string>> = roles.map((r: aws.iam.Role) => pulumi.interpolate`${r.name}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OutputImpl { | |
__pulumiOutput: true, | |
isKnown: Promise { <pending> }, | |
isSecret: Promise { <pending> }, | |
resources: [Function], | |
promise: [Function], | |
toString: [Function], | |
toJSON: [Function] | |
} | |
OutputImpl { | |
__pulumiOutput: true, | |
isKnown: Promise { <pending> }, | |
isSecret: Promise { <pending> }, | |
resources: [Function], | |
promise: [Function], | |
toString: [Function], | |
toJSON: [Function] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment