limited-rainbow-51650
10/27/2021, 9:17 PMComponentResource
, doesn't pass the opts
to the child resources. It only passes it to super
. I assume the correct explicit provider is used then for the child resources.
But if I pass transformations
in ComponentResourceOptions
, are these implicitely passed to all the child resources as well?clever-painter-96148
10/27/2021, 10:25 PMError: failed to register new resource createTeam [aws:lambda/function:Function]: 2 UNKNOWN: failed to compute asset hash for "node_modules/@theboxescapegame/dhvg-core-types": asset path 'node_modules/@theboxescapegame/dhvg-core-types' is a directory; try using an archive
(It's an in-house package in our monorepo).
Any clue?
Cc @prehistoric-kite-30979elegant-crayon-4967
10/28/2021, 3:39 PM{{ assumeRole }}
that handlebars uses for automation doc itself to pass variables back and forth. AKA, I can’t figure out how to escape the double braces to have the literal string {{ assumerole }}
without it becoming null because handlebars is reading it. I’ve tried many different escape methods using \
but nothing works. When the template makes it up to AWS all the fields I’ve tried to escape are nulllittle-cartoon-10569
10/28/2021, 8:26 PMastonishing-afternoon-15745
11/01/2021, 8:17 PMlimited-rainbow-51650
11/02/2021, 11:10 AMpulumi.all(...).apply(callbackFn)
, or can I also use someOutput.apply(callbackFn)
?clever-painter-96148
11/02/2021, 2:36 PM"installConfig": {"hoistingLimits": "workspace"}
Not super happy with it as we have dozen of other packages in the monorepo and disabling hoisting make us pay some penalty (mostly longer CI builds and bigger FS usage for node_modules).
Yarn 3 has a new feature that replaces node_modules directories completely: https://yarnpkg.com/features/pnp
It's amazingly fast! We do not even need to run "yarn install" anymore (cf https://yarnpkg.com/features/zero-installs)
To use it, I need to do this before running the Pulumi program:
require('./.pnp.cjs').setup();
However, I cannot find a way to do this in a TypeScript program. Guess I should configure TS to allow importing .cjs files and import it using an import statement in the TS file?
What about native support for Yarn's PnP in Pulumi? Would you accept such a PR? If so, is this the right place: https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/cmd/run/run.ts#L247 ?clever-painter-96148
11/02/2021, 10:23 PMmysterious-wolf-74677
11/04/2021, 9:01 PMPulumi Import Resource Operation
(found here) do we have to include the {name: <resource name>}
in the args
? Doesn't {import: <resource name>}
take care of that? So you can just do something like
const foo = new aws.iam.User('foo', {}, { import: 'foo' })
mysterious-wolf-74677
11/04/2021, 9:01 PMconst foo = new aws.iam.User('foo', {name: 'foo'}, { import: 'foo' })
echoing-actor-55539
11/04/2021, 10:20 PMlittle-whale-73288
11/05/2021, 3:03 PMaws.lb.ListenerRule
to the ones set on an aws.lb.TargetGroup
like:
new aws.lb.ListenerRule(name, {[...], tags: tg.tags})
but I am getting:
error TS2322: Type 'Output<{ [key: string]: string; } | undefined>' is not assignable to type 'Input<{ [key: string]: Input<string>; }> | undefined'.
Type 'OutputInstance<{ [key: string]: string; } | undefined>' is not assignable to type 'Input<{ [key: string]: Input<string>; }> | undefined'.
Type 'OutputInstance<{ [key: string]: string; } | undefined>' is not assignable to type 'OutputInstance<{ [key: string]: Input<string>; }>'.
Type '{ [key: string]: string; } | undefined' is not assignable to type '{ [key: string]: Input<string>; }'.
Type 'undefined' is not assignable to type '{ [key: string]: Input<string>; }'.
am I missing something obvious or should this just work?orange-kite-80991
11/07/2021, 5:29 PMpulumi.runtime.allConfig()
The following doesn't work:
const config = new pulumi.Config()
const all_envs_str = "'" +
Object.entries(config).map(([key, value]) => `${key}=${value}`).join('\n') + "'"
Result:
name=my_project_name
BTW my overall objective is sending all the Config key-values, including secrets to Docker. If there's a less hacky way to do this I'm all ears.orange-kite-80991
11/08/2021, 12:10 AMpulumi.runtime.allConfig()
sparse-intern-71089
11/08/2021, 7:20 PMlimited-rainbow-51650
11/09/2021, 4:30 PMenv
section of a k8s Deployment
. The value of one of the env variables, set by the transformation function, is an Output. I now want to test that the function added the right key-value pairs. Anyone have an example handy on how to unit test such a transformation function? I struggle again with the async behaviour of Inputs & Outputs.fast-easter-23401
11/10/2021, 6:07 PMwitty-monitor-18849
11/10/2021, 6:42 PMconst ids: Promise<pulumi.Output<string>[]>
const otherIds: Promise<pulumi.Output<string>[]>
ids.concat(otherIds)
I've tried with then
and also apply
like; pulumi.output(ids).apply()
etc... To no avail. Any help would be greatly appreciated. 🙏orange-kite-80991
11/11/2021, 8:15 PMorange-kite-80991
11/12/2021, 5:39 AM- ingressNginx : {
- resources: {
- v1/Service::infra-92vjemsb/ingress-nginx-controller : {
- apiVersion: "v1"
- id : "infra-92vjemsb/ingress-nginx-controller"
- kind : "Service"
- status : {
- loadBalancer: {
- ingress: [
- [0]: {
- ip: "20.112.55.186"
} ]
} } } } }
prehistoric-kite-30979
11/12/2021, 12:54 PMOutput<Object<string>>
to Object<Input<string>>
without having to explicitly list all the fields?magnificent-lifeguard-15082
11/12/2021, 3:05 PMgetOutput
or any getter for that matter, on the component type?prehistoric-kite-30979
11/12/2021, 9:49 PMError: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
I think this is because the function I’m testing instantiates a provider?busy-magazine-6225
11/13/2021, 7:31 PMminiature-king-36473
11/15/2021, 2:13 PMlittle-cartoon-10569
11/16/2021, 5:00 AMaws.identitystore.getGroup()
.rough-hydrogen-27449
11/16/2021, 4:15 PMCluster
resource representing a Kafka cluster in Confluent Cloud:
class Cluster extends pulumi.dynamic.Resource {
public readonly endpoint!: pulumi.Output<string>;
constructor(
name: string,
props: IClusterInputs,
opts?: pulumi.CustomResourceOptions,
) {
super(new ClusterProvider(), name, props, opts);
}
}
and I've written a dynamic provider for this resource:
class ClusterProvider implements pulumi.dynamic.ResourceProvider {
async create(
inputs: IClusterProviderInputs
): Promise<pulumi.dynamic.CreateResult> {
const cmd = `kafka cluster create ${inputs.clusterName}`
+ ` --cloud aws`
+ ` --region ${inputs.region}`
+ ` --availability ${inputs.availability}`
+ ` --type ${inputs.clusterType}`
+ ` --environment ${inputs.environmentId}`;
const result: IClusterCreateResult = await runConfluentCliCommand(cmd, true);
return {
id: result.id,
outs: { // implements IClusterCreateOutputs
endpoint: result.endpoint,
environmentId: inputs.environmentId,
},
};
}
async update(
_id: string,
olds: IClusterProviderInputs,
_news: IClusterProviderInputs
): Promise<pulumi.dynamic.UpdateResult> {
return {outs: olds}; // FIXME: implement a real update method
}
async delete(
id: string,
props: IClusterCreateOutputs
): Promise<void> {
const cmd = `kafka cluster delete ${id} --environment ${props.environmentId}`;
return await runConfluentCliCommand(cmd, false);
}
}
Then I construct a Cluster
instance and export
an object as a stack output:
const cluster = new Cluster("MyCluster", { ... });
export let stackOutputs = {
cluster_id: cluster.id,
cluster_endpoint: cluster.endpoint,
};
When I spin up this stack and look at the stack outputs, the cluster_id
is present but the cluster_endpoint
is absent. I was able to determine that the cluster.endpoint
value was undefined
.
To "fix" this, I did the following:
export let stackOutputs = {
cluster_id: cluster.id,
cluster_endpoint: pulumi.output(cluster.endpoint),
};
cluster_endpoint
shows up in my stack outputs!pulumi.output(..)
cause it to be reified to a non undefined
value? What is actually going on here?
A corollary question:
Why did I not have to also do this for the id
?
EDIT: I was a little confused, actually. My pulumi.output(..)
edit did not, in fact, cause anything to show up in the stack output. The correct fix was to "initialize" the endpoint
with an undefined
in the call to super(..)
in the Cluster
constructor (see thread).refined-terabyte-65361
11/17/2021, 12:26 AMcould not read plugin [/home/ssm-user/.pulumi/plugins/resource-eks-v0.34.0/pulumi-resource-eks] stdout: EOF
i tried npm install but dint help
how to fix this ?magnificent-lifeguard-15082
11/17/2021, 8:45 PMpulumi.cloud.Table()
will register and deploy resources when run with the cli but is also used as a reference for table.get()
in a serverless function. This is a holy grail and looking forward to seeing more of this from pulumi!
My question though is around how would pulumi optimise the bundling of functions to not include all of the deployment runtime & engine? I'm wondering if the module level deploymentOnlyModule
export has anything to do with it and wondering how I would optimise similar code/components in user land?
For additional context I have a separate process for bundling and do not want to rely on pulumi inline handlers as they may also be other runtimes (ie. not typescript->nodejs)purple-application-23904
11/17/2021, 9:15 PMexport
? I've got helper functions to help wrap some common group of resources, but by only using export
I can't programmatically export parts of those resources. The other languages seem to have this (eg. python has pulumi.export(name, value)
)purple-application-23904
11/17/2021, 9:15 PMexport
? I've got helper functions to help wrap some common group of resources, but by only using export
I can't programmatically export parts of those resources. The other languages seem to have this (eg. python has pulumi.export(name, value)
)billowy-army-68599
11/17/2021, 9:32 PMexport const
will do the same thingpurple-application-23904
11/17/2021, 9:36 PMMap<string, pulumi.Output<any>>
could I export that?export const vars = output
)billowy-army-68599
11/17/2021, 9:38 PMpurple-application-23904
11/18/2021, 6:08 PMvars
at all)orange-kite-80991
11/21/2021, 7:37 AMpurple-application-23904
11/22/2021, 5:25 PMconsole.log
the value I can see the values, but at the end there's no output.const cloudLib = new ...
cloudLib.createWebsocketGateway(...)
export const vars = cloudLib.outputs
console.log("vars", vars)
where outputs is
outputs: Map<string, pulumi.Output<any>> = new Map();
export const vars = Array.from(cloudLib.outputs).reduce((obj, [key, value]) => (
Object.assign(obj, { [key]: value })
), {});
So it looks like it just doesn't like Map
but object
is okay