freezing-twilight-25806
03/15/2023, 7:54 AMimport * as aws from "@pulumi/aws";
const issued = aws.acm.getCertificate({
domain: "<http://subdomain.mysite.com|subdomain.mysite.com>",
tags: {
Name: "my-speficic-tag-name",
}
});
export const cert_arn = issued;
An error appears, because I have multiple certificates in AWS ACM for <http://subdomain.mysite.com|subdomain.mysite.com>
(for example: <http://dev1.subdomain.mysite.com|dev1.subdomain.mysite.com>
, <http://dev2.subdomain.mysite.com|dev2.subdomain.mysite.com>
, etc...).
Is it possible to make it works? Or filter by additional domain names? In my case I need to get a wildcard certificate *.<http://subdomain.mysite.com|subdomain.mysite.com>
Thanks!astonishing-dentist-11149
03/15/2023, 1:45 PMawsx.ecs.FargateService
under FargateTaskDefinitionArgs
then under Container
you will see an option called Secrets. This type definition can be found under: <node>@pulumi/aws/ecs/container.d.ts/Secret
. On my file it is around line 198. I will also add my deps here as well so you can get the exact versions.
NOTE: I moved pulumi back down( this does not change anything in the code, .40 awsx is the same as 1.0.0 awsx/classic that we talked about yesterday.)
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/aws": "^5.0.0",
"@pulumi/awsx": "^0.40.0"
},
Secret interface definition.
export interface Secret {
/**
* The name of the secret.
*/
name: pulumi.Input<string>;
/**
* The secret to expose to the container. The supported values are either the full ARN of the
* AWS Secrets Manager secret or the full ARN of the parameter in the AWS Systems Manager
* Parameter Store.
*
* Note: If the AWS Systems Manager Parameter Store parameter exists in the same Region as the
* task you are launching, then you can use either the full ARN or name of the parameter. If the
* parameter exists in a different Region, then the full ARN must be specified.
*/
valueFrom: pulumi.Input<string>;
}
Previously we used this same concept of secrets inside a .ecs_taskdefinition yaml file and passed in a name and an ARN to a secret value from ssm. I am currently trying to move our infra to pulumi. (I am coming from python to typescript, so assume I know nothing about proper typescript)
To make things simple, I will refer to my two projects as infra (all of our share none service specific code goes here) and ms (service level pulumi code that is only meant for that service)
on infra we have one stack called base. In this stack a create base common shared secrets, that do not change from environment to environment. I create an ssm entry and set it to the value that is in my pulumi config, then I populate an array of aws.ecs.Secret
(mentioned above) with the name that I want the variable to be in the container (name) and the arn of the param. I then export this aws.ecs.Secret[]
for later stack reference.
I then do the exact same thing for the envSecrets in infra on the dev stack. These values are things like DB connection strings that need the same variable name in the container, but have different values per env. These values use the env name (dev, stage, prod) so the values can be different per environment. Then I export a similar aws.ecs.Secret[]
.
I now have two different stacks (base and dev) each with different secret arrays on infra.
On ms I then import that with a stack reference AS pulumi.Output<aws.ecs.Secret[])
I do this because later I have to use apply to merge the two arrays together. This is really messy and frankly bad code. It assumes that I will always be handed the proper data, I genericly hate using as
like this. And then merging the two arrays the way you have to is not ideal. I do it this way though because FargateTaskDefinitionArgs
/ Container
/ secrets
is expecting only the type of `pulumi.Input<aws.ecs.Secret[]>
const baseSecretArns = baseStackRef.getOutput('baseSecrets') as pulumi.Output<aws.ecs.Secret[]>; //Please don't do this.
const envSecretArns = envStackRef.getOutput(`envSecrets`) as pulumi.Output<aws.ecs.Secret[]>;
const secrets: pulumi.Output<aws.ecs.Secret[]> = pulumi
.all([baseSecretArns, envSecretArns])
.apply(([base, env]) => {
return base.concat(env);
});
The end goal, I would like to have both of the arrays combined on the infra side and stored as an export per environment (dev, stage, prod), that way when I do an env stack reference on ms I will get one big pulumi.Output<aws.ecs.Secret[]>
that I can just pass into secrets. So every environment will grab the base secrets array that has already been made and add it to their own array. The nice thing here is, when I do the stack reference I will not need to do the as, because pulumi can infere the type when I pass it in. So the code is cleaner and I can avoid that as statement on ms.
The challenge that I face is, on infra, when I cam creating the env variables on the dev stack, I can not find a good way to "import" the config values of the base stack. I think I can do a stack reference into my env stack and just pull the base secrets array in. However, that is going to give me a pulumi.Output<T> I am not sure how to pull T out, unless .apply is the right way to do that, then I will just do that. What I mean is, I can not combine pulumi.Output<aws.ecs.Secret[]> with aws.ecs.Secret[]. The type are not compatible.
I just thought about this though as I have typed all this out, I am going to have trouble when I update anything in the base stack, EVERY stack in my infra will need to run an update to pull the latest values....
I think I might just need a different way to think about this problem ultimately. Maybe a better route is to keep environment specific variables in ms. This will be annoying because if one of those env specific variables needs updated, like a DB connection string, it is going to have to be updated on every project.bright-wall-79582
03/15/2023, 2:11 PMbillions-xylophone-85957
03/15/2023, 7:46 PMComponentResourceOptions
which extends ResourceOptions
doesn't have deleteBeforeReplace
? CustomResourceOptions
(which also extends ResourceOptions
) has it.billions-hydrogen-34268
03/15/2023, 9:04 PMconst nonSecret = config.require("non-secret")
const nonSecretString = nonSecret.apply(v => `${v}`);
// or
const nonSecretString = pulumi.interpolate`${nonSecret}`;
These do not work because apiKey is an Output<T> and errors out when converting to a string:
const apiKey = config.requireSecret("myApiKey")
const apiKeyString = apiKey.apply(v => `${v}`);
// or
const apiKeyString = pulumi.interpolate`${apiKey}`;
Example of how I need to put the secret into a string:
const newObject = new gcp.pubsub.Subscription("new-sub", {
topic: existingPubSubTopic.name,
pushConfig: {
pushEndpoint: `<https://example.com/api/v2/logs?api-key=${apiKey}&protocol=gcp>`
},
project: config.require("gcp-project-id")
});
gentle-state-12755
03/15/2023, 9:31 PM@pulumi/docker
v4.0.0:
The example below shows how to create and push a Docker Image with tag xyz
, but how can I tag the image with a secondary TAG latest
?
const demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "host/image:xyz"
});
The desired result is to being able to publish both:
β’ host/image:latest
β’ host/image:xyz
cuddly-flower-91328
03/16/2023, 8:31 PMingress-nginx
controller service but running into an issue. I'm getting the following:
Type 'string' is not assignable to type 'Input<{ [key: string]: Input<string>; }>'.
{
controller: {
service: {
type: 'LoadBalancer',
annotations: {
"<http://service.beta.kubernetes.io/aws-load-balancer-name|service.beta.kubernetes.io/aws-load-balancer-name>":
"apps-ingress",
...
famous-monkey-79706
03/19/2023, 3:38 PMgreat-sunset-355
03/19/2023, 6:30 PMaws.ecs.Secret
interface and it looks like it is manually maintained
https://github.com/pulumi/pulumi-aws/blob/1fc37e531140fd0dfb6b39cbfca9a99dadd19be2/sdk/nodejs/ecs/container.ts#L257
as opposed to automatic generation from the spec like aws-native
does it.
Until now I was not aware of that interface because nothing except awsx
seems to call it, hence I'd consider it undocumented
https://www.pulumi.com/registry/packages/aws/api-docs/ecs/taskdefinition/#containerdefinitions_nodejs
This issue supports my theory https://github.com/pulumi/pulumi-aws/issues/2322 about it.
@billowy-army-68599 As the author of the issue above, could you please confirm or correct my suspicion?rhythmic-rainbow-38499
03/20/2023, 1:22 AMenough-caravan-98871
03/21/2023, 1:06 AMexport const var = pulumi.concat("\\", storageAccount.name, ".<http://file.core.windows.net|file.core.windows.net>\", fileShare.name);
The backslash after .net is what I am wanting to keep and having trouble with. Anyone know how to accomplish this?stocky-sundown-45608
03/21/2023, 2:16 PMconst stack = pulumi.getStack();
const nodePoolStackRef = new pulumi.StackReference(`${org}/${orgName}/${stack}`);
let stackOutput = pulumi.interpolate`${nodePoolStackRef.getOutput("clusterNodePool")}`;
const primaryNodePool = stackOutput.apply(v => v.toString());
console.log(`nodepool: ${primaryNodePool}`);
fancy-artist-45287
03/21/2023, 3:58 PMinputs
? import * as inputs from '@pulumi/azure-native/types/input';
but unable to navigate to symbol for eg: inputs.keyvault.AccessPolicyEntryArgs
I can only navigate to inputs
but everything in there is interpreted as text and not symbols so cant navigate, and have to search for type definitions by name, so annoying π€·ββοΈflaky-notebook-65308
03/24/2023, 1:36 AMgetUserAssignedIdentityOutput
but it errors out and the error seems to be not catchable. Maybe relatable - https://github.com/pulumi/pulumi/issues/3364few-postman-20852
03/24/2023, 2:59 PMsteep-monitor-75482
03/26/2023, 12:54 PM.
|
βββ Pulumi.dev.yaml
βββ Pulumi.qa.yaml
βββ Pulumi.prod.yaml
βββ Pulumi.yaml
βββ dist. -- output directory after building typescript
β βββ index.d.ts
β βββ index.js
β βββ index.js.map
β βββ infra
β β βββ index.d.ts
β β βββ index.js
β β βββ index.js.map
β β βββ lambda
β β βββ index.d.ts
β β βββ index.js
β β βββ index.js.map
β β βββ variable.d.ts
β β βββ variable.js
β β βββ variable.js.map
β β βββ vpc
β β βββ index.d.ts
β β βββ index.js
β β βββ index.js.map
β β βββ variable.d.ts
β β βββ variable.js
β β βββ variable.js.map
β βββ tsconfig.tsbuildinfo
βββ index.ts -- entry point file
βββ infra
β βββ index.ts. -- import services lambda, vpc, etc...
β βββ lambda
β βββ index.ts. -- to create lambdas basics, use variable according to stack stack (dev, qa, prod)
β βββ variable.ts -- to store variables used in lambda, different values for each stack (dev, qa, prod)
β βββ vpc
β βββ index.ts
β βββ variable.ts
βββ package-lock.json
βββ package.json
βββ tsconfig.json
Any suggestion will be appreciated.quaint-hydrogen-7228
03/27/2023, 9:23 AMmammoth-father-63881
03/27/2023, 5:14 PM<http://localhost:3001/faileverythreetimes>
it will throw an exception every three invocations. For that invocation it will fail with the error thrown from the Pulumi program, but for all subsequent calls it will fail with the "One or more errors occurred" error message. When we reboot the process/pod the same subsequent calls will complete successfully.
https://github.com/knirkefritt/pulumiautomationbugspike
Is this a know issue, and do you know of way to fix it (preferably not requiring us to restart the pod on every failed run)?
Attached picture illustrates the problemthousands-area-40147
03/27/2023, 5:20 PMpulumi stack init
with the --copy-config-from
flag set? Tried using getAllConfig()
and setAllConfig()
but it doesn't seem to support nested values and gets really funky when secrets are involved. Help's greatly appreciated! βοΈnutritious-battery-42762
03/27/2023, 7:02 PMconst serviceAccount = pulumi.output(gcp.compute.getDefaultServiceAccount({}));
const email = serviceAccount.apply(account => account.email)
this.admin_policy = pulumi.output(gcp.organizations.getIAMPolicy({
bindings: [
{
role: "roles/secretmanager.secretAccessor",
members: [
`serviceAccount:${email.apply(e=>e)})}`,
],
},
],
}, { parent: this }));
this.dbUrlPolicy = new gcp.secretmanager.SecretIamPolicy("db-url-policy", {
project: gcp.config.project,
secretId: this.database_url_secret.secretId,
policyData: pulumi.interpolate`${this.admin_policy.apply(admin => admin.policyData)}`,
}, { parent: this });
this.jwtSecretPolicy = new gcp.secretmanager.SecretIamPolicy("jwt-secret-policy", {
project: gcp.config.project,
secretId: this.jwt_secrets_secret.secretId,
policyData: pulumi.interpolate`${this.admin_policy.apply(admin => admin.policyData)}`,
}, { parent: this });
this.cookie_secret_policy = new gcp.secretmanager.SecretIamPolicy("cookie-secret-policy", {
project: gcp.config.project,
secretId: this.cookie_secret.secretId,
policyData: pulumi.interpolate`${this.admin_policy.apply(admin => admin.policyData)}`,
}, { parent: this });
freezing-twilight-25806
03/30/2023, 11:30 AMboundless-farmer-38967
04/06/2023, 12:26 PMtaskRole
, but it keeps rejecting it:
const fargateTaskRole = new aws.iam.Role(`${appName}-fargate-task`, {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [
...
],
}),
});
const appService = new awsx.ecs.FargateService(`${appName}-app-svc`, {
cluster: cluster.arn,
desiredCount: 0,
taskDefinitionArgs: {
taskRole: fargateTaskRole,
container: {
name: `${appName}-sync-container`,
image: img.imageUri,
cpu: 102,
memory: 50,
},
},
...
});
It won't allow me to assign fargateTaskRole to taskRole. The error is:
Type 'Role' has no properties in common with type 'DefaultRoleWithPolicyArgs'.Thanks!
calm-vr-6039
04/07/2023, 2:26 AMlimited-river-80186
04/10/2023, 7:41 PMbland-pharmacist-96854
04/11/2023, 5:22 PM// Create public route association
new aws.ec2.RouteTableAssociation(data.pubrtasst_name, {
routeTableId: pubRouteTable.id,
subnetId: publicSubnet.id,
});
wet-noon-14291
04/13/2023, 8:50 PM@pulumi/azure-native
takes so long time? I get stuck sort of here for a couple of minutes every time I install it:numerous-carpenter-4252
04/17/2023, 2:18 PMcalm-jackal-58777
04/17/2023, 4:28 PMn
tenants.
So I want to create some ClientGrants which for one of their fields require a clientId
which I want to pull from Client objects also managed through Pulumi. After I have created all Clients I just have a simple array list of Clients, and when creating the grants I want to refer to the id of a specific Client in the list. Except when I just to something like
const clientId = clients.find(client => client.name === 'Foo')!.clientId
This wouldn't work because client.name
is of type Output<string>
because I wouldn't know the client name. So my other attempt was using output
to lift the type like this:
const clientId = output(clients).apply((clients) => clients.find((client) => client.name === "Foo")!.clientId);
But that still has the same problem π I'm a bit at a loss on the correct way to solve this and I wasn't able to find my problem in the Pulumi docs or on the interwebssparse-wall-43358
04/18/2023, 3:22 PMyarn/npm install
command?enough-caravan-98871
04/18/2023, 9:13 PMBlock-scoped variable 'variable' used before its declaration.
How can I accomplish this?