https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
typescript
  • t

    thankful-gpu-3329

    11/01/2022, 8:56 PM
    I’ve found issues like this in all of the examples I’ve been trying to work through/with–including the
    examples
    in the repository. It has made getting started with everything a little frustrating.
  • t

    thankful-gpu-3329

    11/01/2022, 9:05 PM
    Looks like there’s issues running
    pulumi up
    using TS from the docs as well: https://joeysharesthings.com/wHmxRM
    l
    • 2
    • 3
  • c

    careful-book-62830

    11/06/2022, 5:51 PM
    still an issue. please LMK if someone else faced that
    b
    • 2
    • 2
  • f

    fast-island-38778

    11/11/2022, 5:54 PM
    For the
    awsx.ecs.FargateTaskDefinitionArgs
    type, I can see the
    runtimePlatform
    option being included in the GitHub repo but not in the
    npm
    package. Is this a mistake?
  • f

    fast-island-38778

    11/11/2022, 5:55 PM
    p.s. I am using the latest
    @pulumi/awsx
    version
    0.40.1
  • f

    fast-island-38778

    11/11/2022, 5:56 PM
    You can see the
    runtimePlatform
    defined here, https://github.com/pulumi/pulumi-awsx/blob/c7a75bc774ac65aa613880fdcd7c817455d896ee/sdk/nodejs/ecs/fargateTaskDefinition.ts#L161
    b
    m
    h
    • 4
    • 17
  • p

    prehistoric-toddler-40668

    11/13/2022, 11:49 AM
    Hey everyone! I’m kinda new to typescript and deploying a pulumi program that creates a vpc and then needs to assign the subnet id’s to an EKS cluster. i built a class that creates a vpc, and returns a promise of the subnet id’s. i want to reference the subnet id in another class that creates an eks cluster. but i cant figure out how to resolve the promise, help would be very appreciated 🙂 this is the vpc configuration. inside a module called vpc:
    import { ec2 } from  "@pulumi/awsx";
     class Vpc{
         vpc = new ec2.Vpc("ververica-vpc", {
            cidrBlock: "172.17.0.0/16",
            numberOfAvailabilityZones: 2,
            subnets: [
                { type: "public" }, { type: "private" }
                 ],
             }
        );
    }
    
    export const ververica_vpc = new Vpc();
    eks:
    export class EKS{
            eks_role = new aws.iam.Role("eks-iam-role", {
                 assumeRolePolicy: JSON.stringify({
                     Version: "2012-10-17",
                     Statement: [{
                         Action: "sts:AssumeRole",
                         Effect: "Allow",
                         Sid: "",
                         Principal: {
                             Service: "<http://ec2.amazonaws.com|ec2.amazonaws.com>",
                         },
                     }],
                 }),
                 managedPolicyArns: [
                     'arn:aws:iam::aws:policy/AmazonEKSServicePolicy',
                     'arn:aws:iam::aws:policy/AmazonEKSClusterPolicy'
                 ]
               }
             );
            ververica_eks = new aws.eks.Cluster("ververica_cluster", {
                 roleArn: this.eks_role.arn,
                 vpcConfig: {
                     subnetIds: [
                        vpc.ververica_vpc.vpc.privateSubnetIds.then((id) => 
                        )
                                     ],
                 },
             }
            );
        }
    v
    • 2
    • 6
  • b

    billowy-horse-79629

    11/14/2022, 1:54 PM
    Hey all, I’m trying to figure out how this kind of attribute should look like - Here in PolicyAttachmentArgs -> groups - how should I pass this
    input<input<>>
    kind of attribute ?
    c
    • 2
    • 3
  • d

    damp-painting-47843

    11/14/2022, 5:54 PM
    Trying to replace an AWS TargetGroup. The problem is the TargetGroup is referenced by a ListenerAction. Shouldn’t Pulumi automatically update the ListenerAction’s action? Isn’t a new TargetGroup is created before the old TargetGroup is destroyed? If not, how do I force the update of the Listener Action to the new action when a TargetGroup is replaced?
    b
    • 2
    • 14
  • d

    damp-painting-47843

    11/14/2022, 8:41 PM
    Can I force a dependency on a replacement? I have an issue where a dependent item is being created before the item it is dependent on being replaced. I tried the dependsOn listenerOption but it doesn’t seem to work.
    l
    • 2
    • 24
  • d

    damp-painting-47843

    11/14/2022, 10:21 PM
    What is the difference between the aws provider and awsx?
    l
    s
    • 3
    • 21
  • d

    damp-painting-47843

    11/16/2022, 12:13 AM
    I have a situation where I’m specifying a resource A before resource B because resource B refers to resource A. But I also want to make resource B the parent of resource A. I can’t specify in A that B is the parent because B is not yet defined. But I have to define A first because it is referred to in B. How do I do this?
    l
    • 2
    • 3
  • d

    damp-painting-47843

    11/16/2022, 4:41 PM
    I have a resource that has a string value that I want to return. But I don’t know it immediately. How can I return it as a promise-like output that pulumi recognizes?
    b
    l
    • 3
    • 15
  • b

    bitter-salesclerk-37287

    11/16/2022, 8:43 PM
    Hey guys, anybody know how I can access configuration variables at build-time, say, for instantiating a singleton object? I think I’m able to access configuration variables now from my code, at RT, but it’s not obvious to me how to do so for build-time… Usually, it just works and I don’t ever have to think about this distinction, but with Pulumi, it seems more complicated, when it comes to what I normally just call environment variables in programming. I already got some help on the basics, but again I’m stuck on configurations.
    l
    • 2
    • 32
  • d

    damp-painting-47843

    11/16/2022, 10:25 PM
    I’m in a ComponentResource constructor (so no await/async). I’m creating a volume but I conditionally I want to provide an initial snapshot IF the snapshot exists. I’m using aws.ebs.getSnapshot. But that returns a promise. How would I supply a snapshotId to aws.ebs.Volume?
    b
    • 2
    • 12
  • d

    damp-painting-47843

    11/17/2022, 4:06 PM
    I’m getting an error and I’m trying to troubleshoot by printing out the outputs to analyze but I can’t seem to do it. I’ve tried
    apply
    and
    interpolate
    and either way it still prints out the
    OutputImpl
    . Any thoughts?
  • d

    damp-painting-47843

    11/17/2022, 4:06 PM
    This is during
    up
    not just the preview phase.
    b
    • 2
    • 3
  • a

    alert-gpu-18471

    11/21/2022, 2:38 PM
    Hello folks! I was wondering if anyone can help me solve following issue for me. I was trying to invoke Lambda function, however,
    pulumi.Output
    has been bugging me. The function works if I put raw string in the code, but, not with
    pulumi.interpolate
    .
    I will provide some code in comment for the context! Thank you in advance. 🙇‍♂️🏻
    l
    • 2
    • 5
  • v

    victorious-church-57397

    11/21/2022, 7:59 PM
    hey everyone, I've published a new version of a package in my organization and after publishing, getting the error
    TypeError: Cannot read properties of undefined (reading 'getPackage')
    and can't seem to track it down. I haven't added anything from another package/library and not bumped any versions. anyone got any ideas? i've inspected the versions of the providers i have installed, output in thread
    e
    • 2
    • 11
  • e

    elegant-crayon-4967

    11/21/2022, 8:14 PM
    How many folks place pulumi resources inside a
    .apply
    of another resource to ensure you get the proper
    string
    type you want, where if you didn’t, you’d most likely get an error of undefined. I do this all the time, but on a net new stack, pulumi won’t show the resources to be created inside that
    .apply
    which makes sense to me, but also very hard as some of these resources I want to import before my pulumi up and can’t verify they are imported
    v
    l
    c
    • 4
    • 58
  • h

    hallowed-printer-89159

    11/23/2022, 8:38 PM
    Hello folks, Can you help me, Anyone knows how to get the current user email with pulumi gcp
    n
    c
    • 3
    • 3
  • r

    rough-jordan-15935

    11/24/2022, 4:59 AM
    hey all quick question when im working with my team and we each do a pulumi deployment, why does the next user who deploys have to redeploy the entire stack and not only the diff?
    g
    • 2
    • 85
  • p

    prehistoric-laptop-47240

    11/24/2022, 4:12 PM
    Hi quick question : Any idea why when using typescript, Pulumi ignores my configuration in tsconfig.json ? To give more context, I added some typings using
    include
    . It's working fine with
    npx tsc -p tsconfig.json
    but with Pulumi it says "Cannot find name"... for all my types.
    l
    • 2
    • 7
  • d

    damp-painting-47843

    11/28/2022, 6:27 PM
    Trying to retrieve a secret using aws.secretsmanager.getSecretVersionOutput but keep getting:
    Secrets Manager Secret "my-secret-name" Version "AWSCURRENT" not found
    v
    • 2
    • 4
  • p

    prehistoric-laptop-47240

    11/29/2022, 10:26 AM
    Anyone is using the ingress (for kubernetes) package ? I'm wondering why I meet the current issue : When I need to build an image for a service, my ingress gets a "connexion refused" error, and fails to create. I need to do a second
    pulumi up
    when everything else is ready to have it working. I'm using it exactly like in the examples. Any idea ? :s. All I saw is that if i'm pulling an image, everythings seems to work fine...
  • d

    damp-painting-47843

    11/29/2022, 3:57 PM
    Is there a way to create an aws ec2 instance with an existing volume or from an existing snapshot for the root volume? I’m using a volume attachment but it creates two volumes for the instance.
    l
    • 2
    • 3
  • d

    damp-painting-47843

    11/29/2022, 9:39 PM
    Using “replaceOnChanges” doesn’t seem to make a difference. The updated item still registers as update in the plan.
    l
    • 2
    • 5
  • s

    straight-energy-17452

    11/30/2022, 9:25 AM
    hi everyone, Quick question about unit testing component resources, I’m looking at this old answer from Joe https://github.com/pulumi/pulumi/issues/5461#issuecomment-1003424526 It’s consistent with the docs in how all the importing is done, specifically
    let megabucket: typeof import("./megabucket");
    
        before(async () => {
            megabucket = await import("./megabucket");
        });
    Is it really necessary? It’s a lot of ceremony and for my a component resource a regular top-level import works for me. This incantation only seems to be needed if people define resources not wrapped by a function or by a component resource?
    l
    • 2
    • 4
  • b

    better-eve-93881

    11/30/2022, 10:20 AM
    Hi, i am trying to create a ComponentResource that also makes sure that certain Roles exists (on alicloud). The issue is that if one stack creates them they will already be available for the other stacks. Is there a way to only create them once within a ComponentResource? Or to check if they exists via the data resource and if they don't exist only then create them within a ComponentResource. The issue is that the constructor is not async. And there is nothing like dependsOn, which waits for an Output to then decide if this needs to be created or not.
    l
    • 2
    • 3
  • c

    calm-iron-40008

    12/01/2022, 4:31 PM
    I am using the k8s.yaml.ConfigFile (and ConfigGroup) to pass standard kubernetes YAML declarations/deployments… This is desirable for polycloud portability. At the same time, I’d like to declare variables… like the microservice image version number and have them pass with the Custom Resource so that I can centralize environment/version changes… Any guidance on being able to use something like this in a YAML:
    image:<http://ghcr.io/organization/microservice:${RELEASE_ID}|ghcr.io/organization/microservice:${RELEASE_ID}>
    called by a ConfigFile or ConfigGroup
    const
    via TypeScript?
    w
    • 2
    • 7
Powered by Linen
Title
c

calm-iron-40008

12/01/2022, 4:31 PM
I am using the k8s.yaml.ConfigFile (and ConfigGroup) to pass standard kubernetes YAML declarations/deployments… This is desirable for polycloud portability. At the same time, I’d like to declare variables… like the microservice image version number and have them pass with the Custom Resource so that I can centralize environment/version changes… Any guidance on being able to use something like this in a YAML:
image:<http://ghcr.io/organization/microservice:${RELEASE_ID}|ghcr.io/organization/microservice:${RELEASE_ID}>
called by a ConfigFile or ConfigGroup
const
via TypeScript?
w

worried-rain-74420

12/01/2022, 5:37 PM
Interpolate
is the function you probably want.
Something like this perhaps? https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#outputs-and-strings
c

calm-iron-40008

12/01/2022, 5:56 PM
My Pulumi project is an AWS:TypeScript project…. When I pass in a…
new k8s.yaml.ConfigFile(…
and its associated parameters. it seems Pulumi drops into an isolated virtual terminal session using my local
kubectl
executable and its current ‘kube’ context. The YAML that is executed, is executed as a raw YAML file. The Pulumi TypeScript environment, variables, and declarations (e.g. interpolation, dependsOn, etc) don’t seem to be valid in the
ConfigFile
and
ConfigGroup
custom resource… I can write an edit for each of the cluster deployments, but that means I still need to revisit the source YAML files to ensure that I maintain operational version integrity.. I’d like to do this in a single step, even if it is initially more difficult. Does that make any sense?
w

worried-rain-74420

12/01/2022, 6:14 PM
I'm not entirely sure I follow tbh. Though, I want to throw in some documentation into the mix:
By default, Pulumi will use a local kubeconfig if available, or one can be passed as a provider argument in the request.
With the
kubeconfig
available, Pulumi communicates with the API Server using the official Kubernetes client-go library, just like
kubectl
does.
From https://www.pulumi.com/registry/packages/kubernetes/installation-configuration/ So if you don't want to use kubectl, you can pass in a Kubernetes
provider
as a resource option and the HTTP API will be used instead. IIRC ConfigFile is for raw YAML, and you can create instances of
Deployment
,
Service
, etc. if you need dynamic values. If you really need to use ConfigFile with dynamic values, you can get a little crazy: in TypeScript, you can read in your YAML, parse it, template in your values, and write it out to disk again in a temporary file. Then, point your
ConfigFile
resource to the temp file.
Can you clarify what you mean by "operational version integrity" in this context?
c

calm-iron-40008

12/01/2022, 7:41 PM
I mean that my PRODUCTION ENVIRONMENT has an image with the correct version number, whether that image is in the TypeScript project or the YAML code that is brought in via ConfigFile and ConfigGroup… If I get a manual deployment edit script running or interpolation apply and then the YAML files in the repo have a different version, any subsequent
Pulumi up
will revert… Now, granted… One should never do an up on a PROD environment… BUT. elimination of potential is also a goal…
Thanks… I get the provider argument… What I’m literally saying is that I cannot pass any arguments from the code when using ConfigGroup as documented…
// services
const Services = new k8s.yaml.ConfigGroup("platform-service", {
        files: [ path.join("../common/yaml", "svc-*.yaml") ],
    },{dependsOn: my_SecretCreds}
);
It doesn’t even honor the
dependsOn
clause. I’m just a lowly DevOps guy, trying to get our group’s code running polycloud. I’m just hoping for an undocumented feature or a workaround. Should I just pull this out into its own project:stack and do it as YAML? The goal is to be portable across AWS, GCS, and DigitalOcean… where the client base is, essentially.
View count: 1