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
general
  • m

    microscopic-florist-22719

    06/20/2018, 6:26 PM
    let azs = aws.getAvailabilityZones()
    should work, though
  • s

    stocky-spoon-28903

    06/20/2018, 6:26 PM
    Right, that part does
  • m

    microscopic-florist-22719

    06/20/2018, 6:26 PM
    Or you can wrap the entire bit in an async lambda (though this is frowned upon for reasons @white-balloon-205 can elaborate)
  • b

    big-soccer-75859

    06/20/2018, 6:26 PM
    Follow up question, I noticed that the function signature for
    endpoint.get
    takes multiple functions, how does that work, do they all run in parallel or something? https://github.com/pulumi/pulumi-cloud/blob/082b33b1a40c62e87df87dffd345ffe9c3874105/aws/api.ts#L101
    b
    • 2
    • 2
  • m

    microscopic-florist-22719

    06/20/2018, 6:27 PM
    (async () => {
        let azs = await aws.getAvailabilityZones();
    })();
  • s

    stocky-spoon-28903

    06/20/2018, 6:28 PM
    👍
  • s

    stocky-spoon-28903

    06/20/2018, 6:28 PM
    This also does what I would expect:
  • s

    stocky-spoon-28903

    06/20/2018, 6:28 PM
    const privateSubnets = cidrs.map(async (cidrBlock, index) => {
        return new aws.ec2.Subnet(`${baseName}-subnet-${index + 1}`, {
            vpcId: vpc.id,
            cidrBlock: cidrBlock,
            availabilityZone: (await azs).names[index],
            tags: tags,
        });
    });
  • s

    stocky-spoon-28903

    06/20/2018, 6:28 PM
    assuming
    azs = aws.getAvailabilityZones()
  • l

    lemon-spoon-91807

    06/20/2018, 6:31 PM
    @big-soccer-75859> do they all run in parallel or something?
  • l

    lemon-spoon-91807

    06/20/2018, 6:32 PM
    They're intended to run serially. Each handler gets a chance, in turn to work with the request/response
  • m

    microscopic-pilot-97530

    06/20/2018, 6:33 PM
    They're like middleware
  • m

    microscopic-pilot-97530

    06/20/2018, 6:33 PM
    See https://github.com/pulumi/pulumi-cloud/blob/master/api/api.ts#L111-L118
  • l

    lemon-spoon-91807

    06/20/2018, 6:33 PM
    they can choose to, if htey want, call the "next" parameter to pass control to the next handler in the chain.
  • b

    big-soccer-75859

    06/20/2018, 6:33 PM
    oh nice. Any documentation on how that works?
  • l

    lemon-spoon-91807

    06/20/2018, 6:34 PM
    Good question 🙂
  • l

    lemon-spoon-91807

    06/20/2018, 6:34 PM
    Actually, @microscopic-pilot-97530 just linked to what i was going to link to
  • b

    big-soccer-75859

    06/20/2018, 6:34 PM
    Oh I didn't even see that (going blind)
  • l

    lemon-spoon-91807

    06/20/2018, 6:35 PM
    As with most projects, our docs could always use some TLC 🙂
  • b

    big-soccer-75859

    06/20/2018, 6:35 PM
    that's ok, still 100 times better than serverless framework when they started
    👍 1
  • l

    lemon-spoon-91807

    06/20/2018, 6:35 PM
    i'll take that!
  • b

    big-soccer-75859

    06/20/2018, 6:35 PM
    It took them a good couple of years to get their docs up to scratch
  • b

    big-soccer-75859

    06/20/2018, 6:35 PM
    haha
  • b

    big-soccer-75859

    06/20/2018, 6:36 PM
    not to mention most of the actual useful functionality was in third party plugins
  • b

    big-soccer-75859

    06/20/2018, 6:36 PM
    which had like not a lot of docs
  • h

    helpful-forest-30196

    06/20/2018, 6:38 PM
    How are different languages supported? Do you have a Protocol Buffer API implemented in Go and consumed in the different languages?
  • b

    bitter-oil-46081

    06/20/2018, 6:40 PM
    @helpful-forest-30196 Yes. The languages run out of process and communicate over gRPC with the engine and resource providers. See https://github.com/pulumi/pulumi/tree/master/sdk/proto for our protocol definitions, as well as the language providers themselves (I believe the go one is the most approachable if you're just trying to grok the system at a high level)
  • b

    blue-answer-29496

    06/20/2018, 6:42 PM
    It seems like the ability to create NPM packages that make things sharable and re-usable is extremely powerful, but the fact that you are supporting many programming languages seems like it will fragment the community. Say for instance if I were to make some code that made it really easy to deploy an Elasticsearch cluster in JS and deploy it as an NPM package. Anyone that wanted to use something other than JS like maybe Python wouldn’t be able to use that package. Any thoughts on this topic?
  • s

    stocky-spoon-28903

    06/20/2018, 6:42 PM
    Is there perhaps some kind of “stack reference” resource that would allow you to mix and match these?
  • h

    helpful-forest-30196

    06/20/2018, 6:43 PM
    Thanks @bitter-oil-46081
    👍 1
Powered by Linen
Title
h

helpful-forest-30196

06/20/2018, 6:43 PM
Thanks @bitter-oil-46081
👍 1
View count: 2