diff --git a/examples/callbackfunction/index.ts b/examples/callbackfunction/index.ts index d2acf34508d..6fa7b637cb6 100644 --- a/examples/callbackfunction/index.ts +++ b/examples/callbackfunction/index.ts @@ -16,11 +16,16 @@ import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; const config = new pulumi.Config("aws"); -const providerOpts = { provider: new aws.Provider("prov", { region: config.require("envRegion") }) }; +const provider = new aws.Provider("prov", { + region: config.require("envRegion") +}) +// const providerOpts = { +// provider: provider +// }; const role = new aws.iam.Role("role", { assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({ Service: "lambda.amazonaws.com" }), -}, providerOpts); +}, { provider }); const policy = new aws.iam.Policy("policy", { policy: { @@ -36,29 +41,29 @@ const policy = new aws.iam.Policy("policy", { const functions = [ new aws.lambda.CallbackFunction("a", { callback: async () => ({ success: true }), - }, providerOpts), + }, { provider }), new aws.lambda.CallbackFunction("b", { role: role, callback: async () => ({ success: true }), - }, providerOpts), + }, { provider }), new aws.lambda.CallbackFunction("c", { role: role.arn, callback: async () => ({ success: true }), - }, providerOpts), + }, { provider }), new aws.lambda.CallbackFunction("d", { policies: [aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole], callback: async () => ({ success: true }), - }, providerOpts), + }, { provider }), new aws.lambda.CallbackFunction("e", { callbackFactory: () => { const ret = { success: true }; return async () => ret; }, - }, providerOpts), - // new aws.lambda.CallbackFunction("f", { - // policies: { one: policy.arn }, - // callback: async () => ({ success: true }), - // }, providerOpts), + }, { provider }), + new aws.lambda.CallbackFunction("f", { + policies: { one: policy.arn }, + callback: async () => ({ success: true }), + }, { provider }), ]; export const arns = functions.map(f => f.arn);