elegant-dress-88912
12/12/2019, 5:32 AMexport x
works because let x: string | undefined
also assigns default type valueambitious-ram-5811
12/12/2019, 5:33 AMbored-jackal-93148
12/12/2019, 5:33 AMelegant-dress-88912
12/12/2019, 5:50 AM// somewhere in index.ts
let serviceAccount: TypeOfServiceAccount;
export let serviceAccountPrivateKey = pulumi.Output("");
if (config.createServiceAccount) {
serviceAccount = new TypeOfServiceAccount(...)
const serviceAccountKey = new ...
serviceAccountPrivateKey = serviceAccountKey.PrivateKey
}
So serviceAccount and serviceAccountPrivateKey are global vars and can be used later, private key is exported during declaration, serviceAccountKey is local var in if
block cause I don't need it elsewhereelegant-dress-88912
12/12/2019, 6:37 AMlet
only `Output`'s above if
because I can instantiate real objects only inside if
and later usage of declared serviceAccount will cause error 'usage before assignment'adamant-postman-86832
12/12/2019, 10:32 AMbetter-actor-92669
12/12/2019, 11:02 AMgcp:sql:DatabaseInstance (cloud_pgsql_main):
error: Error, failed to create instance smth-pulumi-1-psql-main: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
Reference to a class:
https://github.com/pulumi/pulumi-gcp/blob/d5c103b63474e73b7a0ea0639a6e162be70726ac/sdk/python/pulumi_gcp/sql/database_instance.py#L12 (GCP Python).
I use a separate service account to issue pulumi API calls. Both $GOOGLE_APPLICATION_CREDENTIALS
and $GOOGLE_CLOUD_KEYFILE_JSON
are set. I have assigned a CloudSQL Admin Role for this service account. I also tried to make it an owner of the entire project, but it doesn't help.
Thank you so much in advance!glamorous-waitress-51149
12/12/2019, 11:28 AMglamorous-waitress-51149
12/12/2019, 11:28 AMconst databasePassword = config.requireSecret("databasePassword")
glamorous-waitress-51149
12/12/2019, 11:29 AMconst cluster = new aws.rds.Cluster("default", {
masterPassword: databasePassword,
glamorous-waitress-51149
12/12/2019, 11:32 AMmasterPassword
is Input<string>
but databasePasssword
is Output<string>
glamorous-waitress-51149
12/12/2019, 11:32 AMconfig.requireSecret("databasePassword").get()
but docs suggest not to do thiscool-egg-852
12/12/2019, 3:27 PMrhythmic-hair-33677
12/12/2019, 6:49 PMapply
method on an instance of k8s.apiextensions.CustomResource
. Is there a workaround to perform an action after the object is applied to the cluster?rhythmic-hair-33677
12/12/2019, 7:16 PMthankful-optician-22583
12/12/2019, 8:00 PMthankful-optician-22583
12/12/2019, 8:00 PMthankful-optician-22583
12/12/2019, 8:03 PMcrooked-jelly-50877
12/12/2019, 10:14 PMbreezy-agency-15661
12/13/2019, 1:47 AMconst lambda = new aws.lambda.Function("myfunc", {
code: undefined,
role: ";)",
handler: "index.handler",
runtime: aws.lambda.NodeJS10dXRuntime
},
{}
);
breezy-agency-15661
12/13/2019, 1:48 AMaws.cloudwatch.onSchedule("test", "rate(1 minute)", async (event) => {
try {
console.log(`current time: ${Date.now()}`);
} catch (e) {
console.log(e);
}
});
breezy-agency-15661
12/13/2019, 1:49 AMsquare-rocket-59657
12/13/2019, 2:19 AMlambda
to the onSchedule as it accepts a handler something like:
const lambda = new aws.lambda.Function("myfunc", {
code: undefined,
role: ";)",
handler: "index.handler",
runtime: aws.lambda.NodeJS10dXRuntime
},
{}
);
aws.cloudwatch.onSchedule("test", "rate(1 minute)", lambda.handler);
breezy-butcher-78604
12/13/2019, 6:34 AMpulumi plugin install KIND NAME VERSION
but i’d prefer to just grab the latest (and not provide a version) is this possible? or will i need to always pass a specific version number?breezy-butcher-78604
12/13/2019, 7:15 AMincalculable-diamond-5088
12/13/2019, 11:03 AMincalculable-diamond-5088
12/13/2019, 11:03 AMgoroutine 280 [running]:
<http://github.com/pulumi/pulumi/pkg/util/contract.failfast(...)|github.com/pulumi/pulumi/pkg/util/contract.failfast(...)>
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/failfast.go:23
<http://github.com/pulumi/pulumi/pkg/util/contract.Assert(...)|github.com/pulumi/pulumi/pkg/util/contract.Assert(...)>
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/assert.go:26
<http://github.com/pulumi/pulumi/pkg/resource/plugin.(*provider).Diff(0xc0036c9f20|github.com/pulumi/pulumi/pkg/resource/plugin.(*provider).Diff(0xc0036c9f20>, 0xc006027e00, 0xea, 0x0, 0x0, 0xc002a1ca50, 0xc001ed8d20, 0x203001, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/plugin/provider_plugin.go:504 +0x15ba
<http://github.com/pulumi/pulumi/pkg/resource/deploy.diffResource(0xc006027e00|github.com/pulumi/pulumi/pkg/resource/deploy.diffResource(0xc006027e00>, 0xea, 0x0, 0x0, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, 0x19d5340, 0xc0036c9f20, 0xc004632501, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:1049 +0x118
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).diff(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).diff(0xc0057c7440>, 0xc006027e00, 0xea, 0xc0029b6b00, 0xc00330e900, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, 0x19d5340, 0xc0036c9f20, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:1037 +0x30d
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateStepsFromDiff(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateStepsFromDiff(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0xc006027e00, 0xea, 0xc0029b6b00, 0xc00330e900, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:499 +0xf6
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateSteps(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateSteps(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0xc00119d200, 0x3, 0xc001401aa0, 0x1, 0xc00119d200)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:432 +0xead
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).GenerateSteps(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).GenerateSteps(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0x7f6ab8111fc0, 0xc00486efa0, 0x1, 0xc001401ac0, 0x45d9c0)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:155 +0x5a
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).handleSingleEvent(0xc00577b200|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).handleSingleEvent(0xc00577b200>, 0x1988bc0, 0xc00486efa0, 0x0, 0x1)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:361 +0x138
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute.func3(0xc005879440|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute.func3(0xc005879440>, 0xc00577b200, 0xc005726bf0, 0x19b4280, 0xc001e25c80, 0x0, 0x0, 0x19b4340, 0xc00570a030, 0x0, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:235 +0x210
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute(0xc00577b200|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute(0xc00577b200>, 0x19b4340, 0xc00570a030, 0x19b4680, 0xc0057c70e0, 0x7fffffff, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:251 +0x7da
<http://github.com/pulumi/pulumi/pkg/resource/deploy.(*Plan).Execute(...)|github.com/pulumi/pulumi/pkg/resource/deploy.(*Plan).Execute(...)>
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan.go:335
<http://github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk.func1(0x19b4680|github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk.func1(0x19b4680>, 0xc0057c70e0, 0xc0057c6ea0, 0x19b4340, 0xc00570a030, 0xc00570a001, 0xc005726b20, 0xc005878ba0)
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:192 +0x24a
created by <http://github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk|github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk>
/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:178 +0x177
adamant-motorcycle-38425
12/13/2019, 12:55 PMconst SingleRunFargateTaskProvider = {
async create(inputs) {
const id = crypto.randomBytes(16).toString("hex");
const result = await inputs.fargateTaskDefn.run({
cluster: inputs.ecsCluster
});
return { id };
}
};
However I receive this Error:
error: update failed
pulumi-nodejs:dynamic:Resource (repro-customfgtask):
error: inputs.fargateTaskDefn.run is not a function
When I inspect the inputs, inputs.fargateTaskDefn is at that runtime, a string URN.
Any guidance on how to make this work would be really appreciated! (My eventual use-case will be a database migration task that I tie to my RDS resource's lifetime).
P.S/Sidenote: I am modelling this after the lambda/fargate example that captures a reference to a FargateTaskDefinition and uses the run() call at runtime (and I've tested that scenario/function serialization works fine. See: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ecs/#task-definitions):
const helloTask = new awsx.ecs.FargateTaskDefinition("hello-world", {
container: {
image: "hello-world",
memory: 20,
},
});
const api = new awsx.apigateway.API("examples-containers", {
routes: [{
path: "/run",
method: "GET",
eventHandler: async (req) => {
const result = await helloTask.run({ cluster });
return { statusCode: 200, body: "OK" };
},
}],
});
steep-printer-55468
12/13/2019, 2:22 PMindex.ts
to pull in various modules, then I switch on pulumi.getStack()
to execute the right "stack module" for the selected stack. Is there a better way to organize around multiple stacks or is that the more or less standard way to do it?cuddly-leather-18640
12/13/2019, 3:00 PM