famous-jelly-72366
05/29/2020, 8:24 AMfamous-jelly-72366
05/29/2020, 2:42 PMtsc -b
curved-pharmacist-41509
05/31/2020, 9:27 AMfamous-jelly-72366
06/02/2020, 3:39 PMlittle-cartoon-10569
06/08/2020, 11:17 PMsalmon-account-74572
06/09/2020, 4:49 PMpush
to create new items in an array deprecated/not supported in Pulumi 2.x? Example:
let privRtAssoc = [];
for (let i = 0; i < numberOfAZs; i++) {
privRtAssoc.push(new aws.ec2.RouteTableAssociation(`${baseName}-priv-rta-${i+1}`, {
routeTableId: privRt[i].id,
subnetId: privSubnetIds[i],
}));
};
I'm asking because I use this pattern a fair amount and need to find a replacement before migrating to Pulumi 2.x (yes, I'm lagging behind).calm-parrot-72437
06/10/2020, 4:26 AMassoc-${i}
, {
clientVpnEndpointId: vpnEndpoint.id,
subnetId: subnetId,
});
i++;
}busy-soccer-65968
06/11/2020, 4:37 PMDiagnostics:
pulumi:pulumi:Stack (infrastructure-stage):
error: Running program '/home/p/Code/ss/infrastructure' failed with an unhandled exception:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (/home/p/Code/ss/infrastructure/node_modules/@pulumi/helm/v3/helm.ts:125:33)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at Object.<anonymous> (/home/p/Code/ss/infrastructure/node_modules/@pulumi/helm/v3/index.ts:5:1)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
on a project that hasn't changed. In CI it suceeded friday, rerunning today it fails. anythoughts on what might h ave changed. I'm using pulumi/pulumi:latest
docker image. Any idea where to start debugging this? I've updated all packages to newest versions. Any help is greatly appreciated.numerous-lifeguard-13411
06/15/2020, 4:24 PMindex.ts
file more dynamic? I'm trying to modify an SG in runtime--make a permissive one, then bring up the instance and allow it to update packages, and then (hopefully) make the SG more restrictive. Does plumi + typescript allow that in some fashion?salmon-account-74572
06/16/2020, 10:17 PMnode_modules
directories?little-cartoon-10569
06/17/2020, 4:29 AMpulumi.runtime.setMocks
) supposed to be cleared manually? I'm writing test modules and expecting the Pulumi runtime to know about the resources created during calls to Mocha before()
and similar code, and the resources created during the test. Nothing else should exist. But I'm finding all resources there. Not just ones in the same file, but ones in completely unrelated files that are being run during the same call to npm run test
. Do I need to clear the fakes ("mocks") out? Or do I need to wrap every test module in a call to runInPulumiStack()
?steep-angle-29984
06/17/2020, 9:19 AMfunction getValue(optionalValue: pulumi.Input<number | undefined>, defaultValue: pulumi.Input<number>): pulumi.Input<number> {
return pulumi.output(optionalValue).apply( v => {
return v ?? defaultValue
})
}
Error:(91, 9) TS2322: Type 'Output<Input<number>>' is not assignable to type 'Input<number>'.
Type 'OutputInstance<Input<number>>' is not assignable to type 'Input<number>'.
Type 'OutputInstance<Input<number>>' is not assignable to type 'OutputInstance<number>'.
Type 'Input<number>' is not assignable to type 'number'.
Type 'Promise<number>' is not assignable to type 'number'.little-cartoon-10569
06/18/2020, 12:36 AMimport * from "@pulumi/pulumi";
.famous-bear-66383
06/18/2020, 2:41 PMpulumi.Output<string>
to a string
?
given
const pass = new random.RandomPassword("password", { length: 20, special: true },{additionalSecretOutputs: ["password"]}).result;
I want to use pass
as a string to set other resources.
const dbuser = new gcp.sql.User(`${user}-database-user`, {
instance: instanceName,
name: user,
password: pass.apply(p => p.toString()),
host: "cloudsqlproxy~%"
});
using apply
like the following throughs errors
pass.apply(p => p.toString()
little-cartoon-10569
06/18/2020, 11:44 PMaws.ec2.getInstances({ filters: filters });
.
The error is
typescript
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '@pulumi/aws/ec2/index.js'\nRequire stack:\n- /var/task/__index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module '@pulumi/aws/ec2/index.js'",
"Require stack:",
"- /var/task/__index.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:1133:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)",
" at Module.load (internal/modules/cjs/loader.js:977:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:877:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)",
" at internal/main/run_main_module.js:18:47"
]
}
famous-bear-66383
06/19/2020, 11:58 AMcert-manager
chart deployment keeps failing ?
A bit of context.
I install cert-manager
using his helm chart like the following.
const certmanager = new k8s.helm.v2.Chart("cert-manager", {
repo: "jetstack",
chart: "cert-manager",
version: "v0.10.0",
namespace: "cert-manager",
values: {
ingressShim: {
enabled: true,
extraArgs: [
"--default-issuer-name=letsencrypt-dev",
"--default-issuer-kind=ClusterIssuer",
"--dns01-recursive-nameservers-only=true"
]
}
}
},{dependsOn:[certmanagerSecret]);
The first pulumi up
was successful, but as soon as I change other resources on the file not related to certmanager it always throws those errors
error: resource cert-manager-controller-certificates was not successfully created by the Kubernetes API server : <http://clusterroles.rbac.authorization.k8s.io|clusterroles.rbac.authorization.k8s.io> "cert-manager-controller-certificates" already exists
13:55:21.102[cert-manager-control] failed create kubernetes:<http://rbac.authorization.k8s.io/v1beta1:ClusterRole|rbac.authorization.k8s.io/v1beta1:ClusterRole>
13:55:26.990[cert-manager-cainjec] Retry #0; creation failed: <http://clusterrolebindings.rbac.authorization.k8s.io|clusterrolebindings.rbac.authorization.k8s.io> "cert-manager-cainjector" already exists
13:55:26.990[cert-manager-cainjec] error: resource cert-manager-cainjector was not successfully created by the Kubernetes API server : <http://clusterrolebindings.rbac.authorization.k8s.io|clusterrolebindings.rbac.authorization.k8s.io> "cert-manager-cainjector" already exists
13:55:26.990[cert-manager-cainjec] failed create kubernetes:<http://rbac.authorization.k8s.io/v1beta1:ClusterRoleBinding|rbac.authorization.k8s.io/v1beta1:ClusterRoleBinding>
13:55:29.808[cert-manager-control] Retry #0; creation failed: <http://clusterroles.rbac.authorization.k8s.io|clusterroles.rbac.authorization.k8s.io> "cert-manager-controller-orders" already exists
13:55:29.808[cert-manager-control] error: resource cert-manager-controller-orders was not successfully created by the Kubernetes API server : <http://clusterroles.rbac.authorization.k8s.io|clusterroles.rbac.authorization.k8s.io> "cert-manager-controller-orders" already exists
13:55:29.809[cert-manager-control] failed create kubernetes:<http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>:
The resources are installed but pulumi detects as new or something and want to install them.
is there a way to make this idempotent ?curved-pharmacist-41509
06/22/2020, 12:36 AMcurved-pharmacist-41509
06/22/2020, 12:36 AMtsc -b
?salmon-account-74572
06/22/2020, 8:35 PMaws.getAvailabilityZones
and using the results to a) create an array of strings to capture the AZ names and b) use the length
function on said array of strings to determine how many AZs were in the region. I thought that wrapping the aws.getAvailabilityZones
in pulumi.output
and then using apply
would get me back to working, but it appears not. Code is threaded below.mammoth-address-60583
06/25/2020, 6:58 PMripe-russia-4239
06/27/2020, 9:35 PMlocation
property of the created resource has the value I require, as I’ve set it in my Pulumi.yaml
file and not in the new azure.core.ResourceGroup()
call, as described in the docs. There are two things I can’t work out:
• Is Pulumi.yaml
an accepted place to store config common to all stacks in a project? A closer reading of the docs suggest Pulumi.<stack name>.yaml
only 🤔
• At what point are the config values used in creating the resource group? I’ve tried modifying my newResource
fake as below, but the location
property stubbornly remains undefined
.
newResource: (type, name, inputs) => {
return {
id: `${inputs.name}_id`,
state: {
...inputs,
name: inputs.name || name,
location: inputs.location || config.get("azure:location"),
},
};
}
// ...
const config = new pulumi.Config();
Is the config, as loaded by Pulumi in the app, available in the test context, or these mock functions? Trying to use an exported config instance leaves me with leaked promises 😞rhythmic-flag-11093
06/29/2020, 2:58 AMimport * as awsx from "@pulumi/awsx";
// Allocate a new VPC with the default settings:
const vpc = new awsx.ec2.Vpc("custom");
// Export a few resulting fields to make them easy to use:
export const vpcId = vpc.id;
export const vpcPrivateSubnetIds = vpc.privateSubnetIds;
export const vpcPublicSubnetIds = vpc.publicSubnetIds;
from here:
https://www.pulumi.com/docs/guides/crosswalk/aws/vpc/
I get this error:
index.ts(6,13): error TS2554: Expected 2-3 arguments, but got 1.
It's referring to this line
const vpc = new awsx.ec2.Vpc("custom");
Any feedback is appreciatedlittle-cartoon-10569
06/30/2020, 1:45 AMexpect()
directly from the async function (passed as a parameter to it()
), unless there's an Output
or Promise
involved, in which case I call expect()
from within an apply()
. When everything passes, all good. And tests without apply
fail, all is good too: Test Explorer shows me my errors.
But when an expect()
inside an apply()
fails, Test Explorer shows the test as passing. I see the error message in VSCode's Output window, or in the console if that's where I running them, but Test Explorer isn't noticing that there was a failed expect()
. The failures always show up as *UnhandledPromiseRejectionWarning*s.
What am I doing wrong?little-cartoon-10569
07/01/2020, 1:24 AMreturn pulumi.all([this.vpc.publicSubnets, this.vpc.privateSubnets, this.vpc.isolatedSubnets]).apply(([pub, pri, iso]) => {
// ...
});
That's all good in VSCode, Pulumi CLI, and Mocha (when called from VSCode's Test Explorer). But when I run my tests from the command line, I'm getting implicit-any errors:
main/pulumi/resources/Vpc.ts:72:108 - error TS7031: Binding element 'pub' implicitly has an 'any' type.
72 return pulumi.all([this.vpc.publicSubnets, this.vpc.privateSubnets, this.vpc.isolatedSubnets]).apply(([pub, pri, iso]) => {
What might cause this? My tsconfig.json files are almost identical (the test one has an additional glob in the include section for the test directory), my package.json's scripts.test section is pretty straightforward
"scripts": {
"compile": "tsc",
"lint": "node_modules/tslint/bin/tslint --project tsconfig.json",
"prepare": "npm run compile",
"test": "env TS_NODE_PROJECT=\"tsconfig.test.json\" node --trace-warnings --unhandled-rejections=strict node_modules/mocha/bin/_mocha --config test/mocha/.mocharc.json",
},
I have no idea what I'm doing wrong...many-dress-88879
07/07/2020, 11:30 PMgsutil iam ch \
serviceAccount:service-PROJECT_NUM@cloud-cdn-fill.iam.gserviceaccount.com:objectViewer \
gs://[BUCKET]
dazzling-sundown-39670
07/08/2020, 1:50 PMconst registry = new digitalocean.ContainerRegistry(appName)
const credentials = new digitalocean.ContainerRegistryDockerCredentials(appName, {
registryName: registry.name,
});
const image = new docker.Image(appName, {
build: '../',
imageName: appName,
registry: ???, // What to put here?
})
quiet-hairdresser-18834
07/11/2020, 12:54 PMwhite-rainbow-68240
07/13/2020, 1:08 PM"foo-abc": "<git+ssh://git>@github.com/my-co/foo-abc.git#v1.0.1"
The relevant yaml for my github workflow looks like this:
- name: setup ssh
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan <http://github.com|github.com> >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GH_PRIVATE_SSH }}"
- name: npm install
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: npm install
white-rainbow-68240
07/13/2020, 1:09 PMwhite-rainbow-68240
07/13/2020, 1:10 PM