salmon-ghost-86211
03/24/2021, 4:15 PMconst iamGroup = pulumi.output(aws.iam.getGroup({
groupName: "myGroup",
}, { async: true }));
const usernames = iamGroup.apply(group => group.users.map(user => user.userName));
If I export
const usernames, I see
Outputs:
usernames: [
[0]: "username1"
[1]: "username2"
[2]: "username3"
]
However, later when attempting to use both .filter
and .map
on the usernames
list, I get
TSError: ⨯ Unable to compile TypeScript:
index.ts(312,13): error TS2488: Type 'Output<string[]>' must have a '[Symbol.iterator]()' method that returns an iterator.
index.ts(469,42): error TS2339: Property 'map' does not exist on type 'Output<string[]>'.
I have tried many variations of .apply
but am so far unable to use the above methods or return this list from the function it is in. I have read the Inputs and Outputs doc many times but it is still painful to figure out how to make it work.microscopic-dress-1605
03/24/2021, 5:22 PMaws-resource
for creating AWS resources. The package aws-resource
is used inside a Pulumi stack.
When I execute the unit tests of the Pulumi stack, it complains with ‘_Error: Program run without the Pulumi engine available; re-run using the pulumi
CLI_’. Although the unit tests of the stack contain the mocking code for Pulumi resources.
pulumi.runtime.setMocks({
newResource: function(...) { ... }
});
I guess the pulumi API calls inside the Nodejs package aws-resource
don’t get mocked.
What should I do to also have the resources created by the package aws-resource
mocked?better-shampoo-48884
03/27/2021, 12:07 PMbetter-shampoo-48884
03/27/2021, 12:10 PMmysterious-wolf-74677
03/30/2021, 3:31 PMpulumi import
without updating state possibly?little-cartoon-10569
03/30/2021, 10:06 PMgifted-island-55702
04/02/2021, 10:18 AMconst promise = new Promise<Map<string, string>>((resolve, reject) => new Map<string, string>());
const output: pulumi.Output<Map<string, string>> = pulumi.output(promise);
as it fails with:
TS2322: Type 'Output<UnwrappedObject<Map<string, string>>>' is not assignable to type 'Output<Map<string, string>>'. Type 'Output<UnwrappedObject<Map<string, string>>>' is not assignable to type 'OutputInstance<Map<string, string>>'. Types of property 'apply' are incompatible. Type '{ <U>(func: (t: UnwrappedObject<Map<string, string>>) => Promise<U>): Output<U>; <U>(func: (t: UnwrappedObject<Map<string, string>>) => OutputInstance<...>): Output<...>; <U>(func: (t: UnwrappedObject<...>) => U): Output<...>; }' is not assignable to type '{ <U>(func: (t: Map<string, string>) => Promise<U>): Output<U>; <U>(func: (t: Map<string, string>) => OutputInstance<U>): Output<U>; <U>(func: (t: Map<...>) => U): Output<...>; }'. Types of parameters 'func' and 'func' are incompatible. Types of parameters 't' and 't' are incompatible. Type 'UnwrappedObject<Map<string, string>>' is missing the following properties from type 'Map<string, string>': [Symbol.iterator], [Symbol.toStringTag]
Am I missing something? I thought that I can "repackage" whatever I have in the promise object into an output object.gifted-island-55702
04/09/2021, 12:01 PMgifted-island-55702
04/09/2021, 12:01 PMacceptable-army-69872
04/09/2021, 8:59 PMis:issue waf is:closed
is 1 issue.mysterious-oyster-86659
04/12/2021, 5:01 PMstocky-address-37940
04/12/2021, 6:52 PMstocky-address-37940
04/12/2021, 6:52 PMpurple-train-14007
04/13/2021, 9:47 PMpurple-train-14007
04/13/2021, 10:26 PMalert-oyster-87530
04/13/2021, 11:36 PMpurple-train-14007
04/14/2021, 1:41 AMpurple-train-14007
04/14/2021, 1:41 AMprehistoric-ocean-52185
04/14/2021, 5:27 AMcuddly-dusk-95227
04/14/2021, 11:36 AMpulumi-eks
. what am I missing?purple-train-14007
04/15/2021, 6:05 PMconst USNetWork = new azure_native.network.VirtualNetwork(usNetName, {
resourceGroupName: RG,
location: "WestUS",
virtualNetworkName: usNetName,
addressSpace: {
addressPrefixes: [usAddr],
},
});
const domainSubnetUSA = new azure_native.network.Subnet(usADDSSubnetName, {
resourceGroupName: RG,
subnetName: usADDSSubnetName,
virtualNetworkName: USNetWork.name,
addressPrefix: usADDSSubnetaddr,
});
const meshSubnetUSA = new azure_native.network.Subnet(usMESHSubnetName, {
resourceGroupName: RG,
subnetName: usMESHSubnetName,
virtualNetworkName: USNetWork.name,
addressPrefix: usMESHSubnetaddr,
});
const InboundSGUSA = new azure_native.network.NetworkSecurityGroup("InboundSG", {
location: "WestUS",
networkSecurityGroupName: "Test",
resourceGroupName: RG,
securityRules: [allowPSRM,allowRDP],
});
worried-queen-62794
04/18/2021, 9:41 AMOutputInstance
defines these:
apply<U>(func: (t: T) => Promise<U>): Output<U>;
apply<U>(func: (t: T) => OutputInstance<U>): Output<U>;
apply<U>(func: (t: T) => U): Output<U>;
Shouldn't they be?
apply<U>(func: (t: T) => Promise<U> | OutputInstance<U> | U): Output<U>;
Otherwise if func
is something like string => number | Promise<number>
then it returns Output<number | Promise<number>>
rather than Output<number>
. Unless that was intentional?melodic-easter-82419
04/20/2021, 7:35 PMmelodic-easter-82419
04/20/2021, 8:38 PMcolossal-australia-65039
04/20/2021, 11:20 PM$ pulumi up
Previewing update (eks-dev):
[resource plugin kubernetes-2.8.2] installing
Downloading plugin: 0 B / 28.83 MiB [----------------------------------] 0.00%[resource plugin aws-3.31.0] installing
Downloading plugin: 28.83 MiB / 28.83 MiB [=========================] 100.00% 2s
Downloading plugin: 74.84 MiB / 74.84 MiB [=========================] 100.00% 4s
Type Name Plan Info
pulumi:pulumi:Stack infrastructure-eks-dev
└─ pulumi:providers:eks default 1 error
Diagnostics:
pulumi:providers:eks (default):
error: no resource plugin 'eks' found in the workspace or on your $PATH
elegant-pager-5412
04/22/2021, 5:11 AMtarget
I can use? Currently the default seems to be es2016
. Is there any reason why won’t I bump it to es2020
?
Also, as for the module
definition, can I use ES2020
or ESNext
?elegant-pager-5412
04/22/2021, 5:41 AMlittle-cartoon-10569
04/27/2021, 12:38 AMunhandled rejection: CONTEXT(3262): transferDeps( ...
elegant-pager-5412
04/28/2021, 9:28 AMtarget: "es2020"
in our tsconfig.json
file? Why are we locked to es2016
?elegant-pager-5412
04/28/2021, 9:32 AMtarget: "es2020"
and compile the project myself, piping the output JS to Pulumi?