stocky-sundown-45608
01/16/2023, 3:52 PMconst issuer = new k8s.apiextensions.CustomResource(issuerName, {
apiVersion: "<http://cert-manager.io/v1|cert-manager.io/v1>",
kind: "Issuer",
metadata: {
namespace: appNs.metadata.name,
name: issuerName,
},
spec: {
acme: {
server: "<https://acme-v02.api.letsencrypt.org/directory>",
email: "",
privateKeySecretRef: {
name: issuerSecret.metadata.name,
},
solvers: [{
http01: {
ingress: {
name: "api-ingress-dev"
},
},
}],
},
},
brash-hairdresser-60389
01/19/2023, 9:20 AMpulmi.Outuput
, this output is a JSON string I have to split in 3 fields. I tried to use a single .apply
function from this output and there take the 3 values and assign to external variables but it doesn’t work clearly.
I don’t want to call the same .apply
and the internal JSON.parse
3 times to have the fields I need, can you suggest a better way to accomplish that from an Output?famous-jelly-72366
01/25/2023, 11:23 AMtype: module
in package.json, things sort of work, until I import some package (e.g. ip-address
) that isn't itself using type: module
. Was hoping this was just working by now :Sprehistoric-church-49998
01/25/2023, 12:04 PMvite
and others serve a nice and easy way to configure your project compilation but for deploying resources. Truth be told, I already put together a prototype but before I go deeper there I want to double-check 😄
This is how it looks like now:
import { postgres } from '@adaliszk/k8s-postgres-ha'
import { defineConfig } from '@adaliszk/pulumi'
export default defineConfig({
createNamespace: true,
resources: [
postgres()
]
})
wooden-room-54680
01/25/2023, 2:01 PMpulumi up
it complaints about not being able to install the language plugin with the following error:
error: failed to load language plugin nodejs: Could not automatically download and install language plugin 'pulumi-language-nodejs', install the plugin using `pulumi plugin install language nodejs`.
Underlying error: 404 HTTP error fetching plugin from <https://api.github.com/repos/pulumi/pulumi-nodejs/releases/latest>. If this is a private GitHub repository, try providing a token via the GITHUB_TOKEN environment variable. See: <https://github.com/settings/tokens>
magnificent-pizza-54661
01/31/2023, 12:29 AMmany-yacht-69481
01/31/2023, 3:04 PMawsx
in a custom vpc , and i following this doc https://www.pulumi.com/docs/guides/crosswalk/aws/elb/#creating-a-load-balancer-in-a-custom-vpc
However the code examples in here seems to be outdated ? as the code snippet in here seems to call alb.createListener
which i cannot find in the awsx.lb.ApplicationLoadBalancer
instance/type , i’ve also come across quite a few documentation which seems to have outdated info like this , am i missing something obvious ? am i looking in the wrong place ? is there another updated guide for this ?
any help would be greatly appreciated !future-xylophone-25549
02/01/2023, 3:30 AM${config.Stack}-ipset
, {`
addresses: [
"1.2.3.4/32",
"5.6.7.8/32",
],
`description: ${config.Stack}-description
,`
ipAddressVersion: "IPV4",
scope: "CLOUDFRONT",
}, { provider: usEast1 });
`export const wafAcl = new aws.wafv2.WebAcl(${config.Stack}-wafAcl
, {`
scope: "CLOUDFRONT",
defaultAction: {
block: {},
},
visibilityConfig: {
cloudwatchMetricsEnabled: false,
`metricName: ${config.dtack}-waf-metric
,`
sampledRequestsEnabled: false,
},
}, { provider: usEast1 });
Does anyone by chance know how to assign this ipset to the wafacl? Thank you very much in advanced!best-summer-38252
02/01/2023, 5:31 AMconst compliedApp = new pulumi.asset.FileAsset("src/app.ts").path
.then((inPath) => {
const name = path.parse(inPath).name;
const outPath = path.join("dist", name, "index.mjs");
return new local.Command(`compile${startcase(name)}`, {
assetPaths: [outPath],
dir: ".",
create: `pnpm exec ncc build -m -s ${inPath} -o ${path.join("dist", name)}`,
delete: `rm -rf ${path.dirname(outPath)}`,
});
})
.then((r) => ({
inputPath: "src/app.ts",
outputPath: r.assetPaths[0],
}));
bland-pharmacist-96854
02/01/2023, 2:11 PMbland-pharmacist-96854
02/01/2023, 2:11 PMbland-pharmacist-96854
02/01/2023, 4:18 PMbland-pharmacist-96854
02/01/2023, 6:49 PMsparse-intern-71089
02/02/2023, 4:09 PMnarrow-guitar-10891
02/02/2023, 9:45 PMexport async function applyRules(group: string, rules: Approval[]) {
let groupId = await findGroupsIds([group]);
if (groupId.length == 0) return;
try {
const groupProjects = await gitlab.getProjects({
groupId: groupId[0],
orderBy: "name",
includeSubgroups: true,
withShared: false,
});
groupProjects.projects.forEach(async (project) => {
const branches = await gitlab.getProjectProtectedBranches({
projectId: project.pathWithNamespace,
});
let branchIds = branches.protectedBranches.map(branch => branch.id);
const repoName = `${project.path.toLowerCase()}-${project.id}`;
rules.forEach((rule) => {
const ruleName = rule.name.replace(/\s/g, '-').toLowerCase();
const projectApproval = new gitlab.ProjectApprovalRule(`${repoName}-${ruleName}`, {
approvalsRequired: 1,
project: project.id.toString(),
name: rule.name,
userIds: rule.userIds,
groupIds: rule.groupIds,
protectedBranchIds: branchIds,
});
});
});
} catch (err) {
console.log(`Error: ${String(err).split('*').pop()}`)
}
}
Sure, the code is not perfect in some wayswitty-park-12681
02/02/2023, 11:31 PMawsx
It turns out that the syntax
const cluster = new aws.ecs.Cluster("cluster", {});
is no longer supported with import * as awsx from '@pulumi/awsx
Are there any guides for migrating from import * as awsx from '@pulumi/awsx/classic
to the latest Typescipt api? I don't see any documentation on this. Any direction is appreciated.
I'm using the following versions:
"@pulumi/aws": "5.29.0",
"@pulumi/awsx": "1.0.1",
"@pulumi/pulumi": "3.53.1",
bland-pharmacist-96854
02/03/2023, 12:48 PMbuckets.sourceBucket.name
jolly-window-25842
02/07/2023, 5:00 PMpulumi up
has become incredibly slow, it always was, but now it takes around 5-6 minutes to get the preview and another 2-3 minutes to update even a single resource: it hangs for 2 minutes and then starts updating. It's a Typescript GCP stack with around 150 resources and about 20-30 secrets. Any idea why this might be and/or suggestions to improve it? Thanks!enough-caravan-98871
02/08/2023, 2:29 PMconst certState = new terraform.state.RemoteStateReference("certs", {
backendType: "remote",
token: tfeToken,
organization: org,
workspaces: {
name: "acme-tf"
},
});
const certificate = new azure.keyvault.Certificate("cert-name", {
keyVaultId: vaultId,
certificate: {
contents: certState.getOutput("certificate_p12"),
password: certState.getOutput("certificate_p12_password"),
},
name: "cert-name"
});
brave-alarm-22747
02/08/2023, 6:57 PMnew k8s.yaml.ConfigFile(
'guestbook',
{
file: './aws/addons/autoscaler.yml',
},
{ provider: provider }
);
but when I do a pulumi up I get the following
error: Running program '/Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws' failed with an unhandled exception:
Error: ENOENT: no such file or directory, open './aws/addons/autoscaler.yml'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at new ConfigFile (/Users/fernando.barrera/Documents/GitHub/infrastructure/node_modules/@pulumi/yaml/yaml.ts:3005:39)
at /Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws/addons/dns-autoscaler.ts:15:5
at Generator.next (<anonymous>)
at /Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws/addons/dns-autoscaler.ts:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws/addons/dns-autoscaler.ts:4:12)
at module.exports (/Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws/addons/dns-autoscaler.ts:13:45)
at /Users/fernando.barrera/Documents/GitHub/infrastructure/infrastructure/applications/kubernetes/aws/addons/index.ts:15:42
any clue why this might be happening?calm-horse-33012
02/09/2023, 10:34 PMpulumi.Input<T>
of all fields, and I noticed that there is even a utility method in output.ts
, Lifted<T>
that can lift a whole structure into one that contains pulumi.Output<T>
, I think it could be nice to have a similar utility type for pulumi.Input<T>
?
For now I've made my own, but I'm sure I won't be the last person to want something like this. 🙂elegant-crayon-4967
02/10/2023, 5:37 PMpulumi.output((chartResources).apply((v) => {
for (const [k, x] of Object.entries(v)) {
for (const [m, n] of Object.entries(x)) {
pulumi.output(n).apply((maybe) =>
console.log(JSON.stringify(maybe)))
sparse-intern-71089
02/13/2023, 4:30 PMbest-summer-38252
02/14/2023, 12:15 AMapply
rather than .then
? Or am I completely off with the comparison?enough-caravan-98871
02/14/2023, 12:54 AMresources: {"com.cloudflare.api.account.zone.<zoneId>": "*",},
. How can I replace <zoneId> with a variable?bright-wall-79582
02/14/2023, 12:35 PMaws.lambda.Function
, do I have to bundle the typescript code or can I just point it to a directory?
|- application
| | - index.ts
|- infrastructure
| | - pulumi.ts
I was following the samples doing this:
export const exampleFunction = new aws.lambda.Function('actionRunnerLambda', {
role: lambdaRole.arn,
runtime: 'nodejs18.x',
handler: 'index.handler',
code: new AssetArchive({
'.': new FileArchive('./application/')
})
})
Where index.ts
exports a “handler” function.
However, when trying to upload this I get that it can’t find the handler “index.handler”.
I need to use the Function
to defined the Lambda as I need to specify things like the runtime and environment variables. This I can not do if I use for instance createFunctionFromEventHandler
.
I was wondering if I have to compile the typescript first and then point the file archive there?great-sunset-355
02/14/2023, 3:06 PMdiff
what would be the best way to do so?
I was thinking about creating a dummy dynamic provider and let pulumi compare it's inputs. Is it there a better way of doing so?great-sunset-355
02/15/2023, 12:07 PMinterface ResourceArgs {
[key: pulumi.Input<string>]: pulumi.Input<string>
}
because this is a problem: [key: pulumi.Input<string>]
when the value is an Output
bright-wall-79582
02/17/2023, 9:16 AMaloof-gigabyte-74853
02/17/2023, 5:04 PMexport const generateSigningJob = (
signingProfile: aws.signer.GetSigningProfileResult,
bucket: aws.s3.Bucket
) => {
const signingJob = new aws.signer.SigningJob("signing-job", {
source: {
s3: {
bucket: bucket.bucket,
key: "cove_fw.bin",
version: "ynjaE4qqt_.w7V0F_0OzuARKk2586Fuy",
},
},
destination: {
s3: {
bucket: bucket.bucket,
prefix: "SignedImages/",
},
},
profileName: "evcsigningprofile",
ignoreSigningJobFailure: false,
});
return signingJob;
};
I get a SIGSEGV