• r

    rough-window-15889

    5 months ago
    Does anyone know the best way to mock the resource to unit test?
    r
    l
    7 replies
    Copy to Clipboard
  • p

    purple-train-14007

    5 months ago
    Is there a way to have Pulumi use Yarn out the gate rather than have it boot strap an initial project with NPM? I dont like having to clean out the npm stuff when I switch to Yarn.
    p
    b
    +2
    20 replies
    Copy to Clipboard
  • r

    rough-window-15889

    4 months ago
    I wrote some unit tests for my Pulumi stack. The tests run correctly but I have promise leaks. I'm trying to debug the promise leaks but they aren't overly helpful. Any ideas of what it could be? Cloud provider is Azure. I am making some AD calls that I may suspect could be part of the issue.
    r
    l
    17 replies
    Copy to Clipboard
  • p

    proud-cricket-86351

    4 months ago
    Is it possible to publish a TS pulumi project to NPM? and if so is there any tutorial?
    p
    b
    20 replies
    Copy to Clipboard
  • r

    rough-window-15889

    4 months ago
    Does anyone else feel like their Typescript Pulumi project is slow? How have you addressed performance issues? Specifically slow to compile. Once it is compiled it seems to run at a reasonable speed.
    r
    e
    5 replies
    Copy to Clipboard
  • b

    broad-gold-44713

    4 months ago
    I have a Pulumi TS project that often runs into OOM issues on WSL. I'm not sure where the problem is (probably too large type definitions?). The only usable solution I have found is to use early-oom, which is not ideal. Anyone run into similar issues? Edit: I’m talking about IDE issues here. Pulumi runtime is fine.
    b
    b
    2 replies
    Copy to Clipboard
  • w

    wonderful-bird-78843

    4 months ago
    Is there an obvious way to use a pulumi.Output in a callback function that's going to be serialized? I've tried all sorts of manipulations with apply/etc.
    const requestsSns = new aws.sns.Topic("mcurl-sns-requests");
    
    const mcurlHandler = new aws.lambda.CallbackFunction("mcurl-handler", {
        callback: async (ev, ctx) => {
            const snsClient = new SNSClient({ region: region });
            var msg = {}
            var msgString = JSON.stringify(msg);
            var params = {
                Message: msgString, 
                TopicArn: requestsSns.arn,    <--------
            };
            try {
    w
    e
    6 replies
    Copy to Clipboard
  • w

    wonderful-bird-78843

    4 months ago
    One more fun function serialization problem!
    import { promisify } from "util";
    import { execFile as execFileReal } from 'child_process';
    
    const execFile = promisify(execFileReal);
    and then in a sns
    Topic.onEvent()
    I'm doing:
    try {
                const { stdout } = await execFile('curl', args);
                console.log("stdout:", stdout);
                msg.Response = stdout;
    }
    On
    up
    , I'm getting:
    Diagnostics:
      pulumi:pulumi:Stack (mcurl-typescript-mcurl):
        error: Error serializing '(ev, ctx) => __awaiter(this, void 0, ...': index.ts(137,57)
    
        '(ev, ctx) => __awaiter(this, void 0, ...': index.ts(137,57): captured
          'execFile', a function defined at
            '(...args) => { const { promise, reso ...': node:child_process(231,9): which captured
              'orig', a function defined at
                function 'execFile': node:child_process(278,17): which captured
                  'ArrayIsArray', a function defined at
                    function 'isArray': which could not be serialized because
                      it was a native code function.
    w
    6 replies
    Copy to Clipboard
  • p

    purple-shampoo-2675

    4 months ago
    Hello! I have a slightly niche problem. I'm using
    awsx
    to deploy EC2-backed ECS services (not Fargate_)_ and having trouble setting them up with proper capacity providers. They have an ASG (via
    cluster.createAutoScalingGroup(...)
    ) but by default the group doesn't scale for new deploys. I thought the answer might be to create an explicit
    aws.ecs.CapacityProvider
    which will respond to task placement failures by provisioning new instances, but there seems to be a circular dependency between the different elements like so:
    awsx.ecs.Cluster
    takes a
    capacityProviders
    array on creation, but •
    aws.ecs.CapacityProvider
    needs the ARN of an
    autoscalingGroup
    , but • the
    autoscalingGroup
    is created via
    cluster.createAutoScalingGroup(...)
    which is not available until after the cluster is created. I hope that's enough context! I can provide more code if that would be useful. Basically where I want to get to is an ASG with
    n
    instances in, where every time a
    pulumi up
    happens the group scales up to
    2n
    instances to place new tasks, then scales back down to
    n
    instances, getting rid of the old ones. Right now
    pulumi up
    completes successfully but new tasks don't happen unless I specify the ASG should be permanently twice as big as it needs to be.
  • p

    proud-cricket-86351

    4 months ago
    Im not sure if this belongs in #automation-api or here. So im just attempting. I’ve found a way to inject a github npm (Pulumi project) at runtime. In this way my custom made CLI (using automation api) can import remote Pulumi project from Github. Im doing this by passing the injected workdir to the createorselectstack function from localworkspace/workspace. Now im wondering with the current approach i dont have control over the pulumi project. Is there a way that i inject a component resource from github(npm package) instead of the pulumi project? (During runtime) So that in my CLI i can create a pulumi project by passing a projectname and such to the automation api and afterwards inject a remote module from git? Im using this library for injecting remote git modules btw https://www.npmjs.com/package/live-plugin-manager
    p
    w
    46 replies
    Copy to Clipboard