• p

    proud-nail-99860

    4 months ago
    Hey all, I’m thinking about migrating my personal side projects setup to Pulumi. As it stands today, I configure everything in one giant Ansible playbook (https://github.com/banool/server-setup). This playbook communicates with my personal home server to open ports, install packages, start DBs, copy across config files, run containers, setup timers, you name it. I want to split up each of these distinct apps. I’ve got a couple of questions: 1. Should I write a separate Pulumi program per app I’m working with? 2. Pulumi seems to encourage you to write programs that target one particular provider. Is there a more agnostic way to approach this? Perhaps Kubernetes? Ideally I’d learn Kubernetes but I’m not sure if it’s necessary here / I feel like using it might throw out some of the power of Pulumi? 3. When moving from one server to cloud, I imagine I’d switch to hosting my containers with something like ECS, spin up a DB using a native provider DB service, etc. Is it possible to write a program that will work for both this new setup as well as my existing “everything on one box setup”, or am I dreaming? Any tips on how to get started would be much appreciated!
    p
    l
    20 replies
    Copy to Clipboard
  • a

    ancient-nightfall-54764

    4 months ago
    Hi Everyone, I want to ask something regarding pulumi stack reference. I have different stack (infra and dev), I just want to get output from infra stack and using that into my ec2 resource. So I have code like this
    stack infra
    index.ts
    ....
    export const ruleSgId = secgroup.id;
    export const subnetA = subneta.id;
    
    
    stack dev
    index.ts
    ...
    const stackRef = new pulumi.StackReference("blabla/blabla/infra");
    const secg = stackRef.getOutput("ruleSgId");
    const subnet = stackRef.getOutput("subnetA");
    
    subnetId: subnet,
    vpcSecurityGroupIds: [ secg, ],
    ...
    But when I run the code, the result was error like this
    error: Running program '/Users/mhw/WS/repos/pulumi' failed with an unhandled exception:
        TypeError: Cannot read properties of undefined (reading 'id')
    https://www.pulumi.com/learn/building-with-pulumi/stack-references/ Thank you.
    a
    v
    +1
    12 replies
    Copy to Clipboard
  • a

    ancient-nightfall-54764

    4 months ago
    Hi Everyone, I just want to know, how to increase root device volume size of a server (ec2) with pulumi, because I didn’t find in the documentation about how to increase/resize root volume size?https://www.pulumi.com/registry/packages/aws/api-docs/ec2/instance/ this my example code, the result is 8GB for root device volume. I want to increase the size. Thank you.
    let server = [];
    server.push(new aws.ec2.Instance(`proxy-website-${ stack }`, {
        ami: config.require("id-ami-ubuntu"),
        instanceType: "t3.small",
        keyName: config.require("key-name"),
        subnetId: publicSubnet,
        vpcSecurityGroupIds: [ secgroup ],
        tags: {
            Name: `proxy-website-${ stack }`,
            Environment: `${ stack }`,
            Pulumi: "true",
        },
    }));
    a
    l
    2 replies
    Copy to Clipboard
  • h

    hundreds-toothbrush-20089

    4 months ago
    Hi guys I am new here and I poked around some examples. I am working on GCP and I am trying to find the best way to trigger a database migration. How do you guys do it? I saw I can use init container that will wait for a job to do it or with by using some helm.sh/hook. What is the best way with Pulumi? Also is there a way to do it a specific way from Pulumi? Thanks!
  • g

    gorgeous-twilight-11045

    4 months ago
    Working through creating a proof of concept multilang component and I'm having some trouble understanding some sections in the
    schema.json
    resources block:1. When would
    isComponent
    be false? 2. What does it mean for something in the
    properties
    section to be
    required
    ? I think properties = output properties but then a "required output property" doesn't really make sense to me. Thanks!
    g
    1 replies
    Copy to Clipboard
  • p

    plain-doctor-68403

    4 months ago
    Hello, I just tried running the
    install pulumi
    script for Linux I found at https://www.pulumi.com/docs/get-started/aws/begin/
    curl -fsSL <https://get.pulumi.com> | sh
    but got the following error while extracting the file:
    === Installing Pulumi v3.33.1 ===
    + Downloading <https://get.pulumi.com/releases/sdk/pulumi-v3.33.1-linux-x64.tar>
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Curren
                                     Dload  Upload   Total   Spent    Left  Speed
    100 78.7M  100 78.7M    0     0  9856k      0  0:00:08  0:00:08 --:--:-- 10.2M
    + Extracting to /home/max/.pulumi/bin
    
    gzip: stdin: unexpected end of file
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now
    
    We're sorry, but it looks like something might have gone wrong during installa
    If you need help, please join us on <https://slack.pulumi.com/>
    Any advice on how to proceed? Thanks!
    p
    p
    +2
    12 replies
    Copy to Clipboard
  • m

    most-jordan-25674

    4 months ago
    I’m having trouble creating a Fargate Cluster on AWS, getting a VPC not found when trying to get an existing non-default one. Not sure what to try next as google is failing me 😞
    m
    2 replies
    Copy to Clipboard
  • p

    proud-nail-99860

    4 months ago
    Do yall know how to copy a folder into a bucket with Pulumi? I somewhat assumed if I had code like this:
    // Create an archive resource for the latest web build.
    let remoteArchive = new pulumi.asset.RemoteArchive("<https://example.com/mywebstuff.zip>");
    
    const bucketObject = new gcp.storage.BucketObject("web", {
        bucket: bucket.name,
        contentType: "text/html",
        source: remoteArchive,
    })
    There would be an
    unzip
    option where it then unzips the archive and creates a folder called
    web
    p
    o
    2 replies
    Copy to Clipboard
  • c

    creamy-fall-88031

    4 months ago
    Hi all. General TypeScript related question. I need to reference user managed identity as seen in the following code snippet taken from the docs:
    identity: {
            type: azure_native.network.ResourceIdentityType.UserAssigned,
            userAssignedIdentities: {
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
            },
        },
    Now, I'm trying to change resource path in the example above with something more dynamic, so did the following:
    let userIdentity = pulumi.all([subscriptionId, resourceGroup.name, userAssignedIdentity.id])
                       .apply(([subscriptionId, resourceGroup, usrAssignedIdentity]) => `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${usrAssignedIdentity}`)
    And then used it as follows:
    identity: {
        type: azure_native.network.ResourceIdentityType.UserAssigned,
        userAssignedIdentities: {
            ${userIdentity} : {},
        },
    },
    But this doesn't seem to be working when the variable
    {$userIdentity}
    is on the left of the colon sign. I'm getting the following error:
    error: Code="LinkedInvalidPropertyId" Message="Property id 'userIdentity' at path '' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
    Can someone please help me with the proper way to do this ?
    c
    o
    6 replies
    Copy to Clipboard
  • p

    proud-nail-99860

    4 months ago
    Do yall know a good tutorial for using Pulumi + GCP to run a container? I can’t really use Cloud Run, [it doesn’t fit my model very well](https://stackoverflow.com/questions/72354350/how-to-run-container-every-5-seconds-with-gcp). I know on the UI you can configure a container right there when making your instance, I just can’t see how to do that via Pulumi.
    p
    o
    5 replies
    Copy to Clipboard