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
  • b

    broad-airline-38127

    06/21/2018, 8:36 AM
    I must say that I’m very excited with Pulumi and impressed as well. I’ve been using Terraform quite extensively, and I really love Terraform and all that it has given me. However, what I’ve always wanted is to be able to write Terraform code in a real programming language. ❤️
  • b

    broad-airline-38127

    06/21/2018, 8:37 AM
    is there a plan for supporting Docker Swarm? I saw it being mentioned here https://github.com/pulumi/pulumi/issues/2 but it’s not mentioned at all here https://github.com/pulumi/pulumi/wiki/Provider-Implementation-Status
  • b

    big-piano-35669

    06/21/2018, 2:57 PM
    Great to hear it, @broad-airline-38127! Can you tell us a little more about what Docker Swarm support you are looking for? Are you thinking you'd like to run the
    cloud.Service
    in a Swarm cluster, or you actually want to use Pulumi, like you might Terraform, to provision a Swarm cluster?
    b
    b
    • 3
    • 7
  • s

    stocky-spoon-28903

    06/21/2018, 5:36 PM
    Is there a way to get the output of
    pulumi stack output
    as JSON?
  • s

    stocky-spoon-28903

    06/21/2018, 5:36 PM
    (e.g. to pipe into JQ or something)
  • w

    white-balloon-205

    06/21/2018, 5:40 PM
    I believe each invidual output will be returned as JSON (i.e.
    pulumi stack output myobject
    ), but we don't currently have a way to return the full set of stack outputs as JSON. This is related to https://github.com/pulumi/pulumi/issues/496, but adding JSON support for just
    pulumi stack output
    is probably high enough value that we could do it before biting off the full feature of JSON support for all CLI verbs. Feel free to open a new issue on this.
  • a

    average-lifeguard-69220

    06/21/2018, 6:10 PM
    does anyone have an example of setting up an AWS VPC and assigning to an EC2 instance?
  • w

    white-balloon-205

    06/21/2018, 6:14 PM
    We have a library that sets up an AWS VPC with just
    new awsinfra.Network
    . If you want to do it yourself, you can look at the implementation of that which creates each of the necessary resources (VPC, Subnet, RouteTable, etc) . An example using this library: https://github.com/pulumi/pulumi-aws-infra/blob/master/nodejs/aws-infra/examples/cluster/index.ts#L23 The implementation if you want to roll it yourself: https://github.com/pulumi/pulumi-aws-infra/blob/master/nodejs/aws-infra/network.ts#L163
  • w

    white-balloon-205

    06/21/2018, 6:15 PM
    And for the EC2 instance itself - check out: https://github.com/pulumi/examples/blob/master/aws-js-webserver/index.js
  • s

    stocky-spoon-28903

    06/21/2018, 6:16 PM
    I’m (as we speak) implementing a Go version of this
  • s

    stocky-spoon-28903

    06/21/2018, 6:17 PM
    I’ll likely PR it over to examples (assuming that is welcome) to get feedback, there are fewer examples of idiomatic Go usage than JS/TS
    w
    • 2
    • 3
  • m

    microscopic-florist-22719

    06/21/2018, 6:27 PM
    @average-lifeguard-69220 here's a brief example that creates an EC2 instance in a network's single private subnet:
    "use strict";
    const pulumi = require("@pulumi/pulumi");
    const aws = require("@pulumi/aws");
    const awsinfra = require("@pulumi/aws-infra");
    
    const network = new awsinfra.Network("my-vpc", {
        numberOfAvailabilityZones: 1,
        usePrivateSubnets: true,
    });
    
    const instance = new aws.ec2.Instance("my-ec2-instance", {
        ami: "ami-7172b611",
        instanceType: "t2.micro",
        vpcSecurityGroupIds: network.securityGroups,
        subnetId: network.subnetIds[0],
    });
    c
    • 2
    • 1
  • m

    microscopic-florist-22719

    06/21/2018, 6:28 PM
    Docs for the
    awsinfra.Network
    class are here: https://pulumi.io/reference/pkg/nodejs/@pulumi/aws-infra/
  • a

    average-lifeguard-69220

    06/21/2018, 6:32 PM
    thank you so much!
  • s

    stocky-spoon-28903

    06/21/2018, 8:49 PM
    Huh, slightly unexpected to find that there is a name uniqueness requirement for stacks, outside of the scope of an individual project
  • f

    future-art-687

    06/21/2018, 8:54 PM
    I wanted to echo some of what other folks have commented on with respect to using Pulumi without the requirement of the service (despite assurances around encryption). I was excited to use it in place of CloudFormation for my day job but veered off once I realized this was the case. Being able to use it without the service would be a welcome officially supported feature.
    a
    b
    • 3
    • 5
  • a

    able-eye-75940

    06/21/2018, 9:35 PM
    Huh, slightly unexpected to find that there is a name uniqueness requirement for stacks, outside of the scope of an individual project
    @stocky-spoon-28903 We went back and forth on this. The part that gets in the way is that the project name is defined in your code, in the YAML file. If it were a part of the stack identity, that would mean that project renaming would be difficult. So, the recommended practice is to prefix the stack name with the project name.
  • s

    stocky-spoon-28903

    06/21/2018, 10:34 PM
    That’s fair enough. Is the intended usage that stacks represent environments (the default example seems to be some kind of
    dev
    -
    staging
    -
    prod
    like promotion), or for logical components of infrastructure which may be managed by different teams in a larger org?
  • c

    colossal-beach-47527

    06/21/2018, 10:39 PM
    @stocky-spoon-28903 in our experience so far, we’ve see both cases. Most common is to have a separate stack for each environment (-dev, -prod, etc.) but some users have slit their larger infrastructure into separate stacks. E.g. “networking” and “compute”. We don’t want to impose too much structure here, beyond what is needed to provide a natural way to navigate the stacks history and resources.
  • s

    stocky-spoon-28903

    06/21/2018, 10:42 PM
    That makes sense. Unfortunately Terraform took the stance of accomodating this only at the state file level with workspaces, which doesn’t work very well in my experience.
  • s

    stocky-spoon-28903

    06/21/2018, 10:42 PM
    If stacks are flexible enough to use for either case that is definitely a win
  • s

    stocky-spoon-28903

    06/21/2018, 10:48 PM
    Also, am I missing something here or is the source for the CLI currently not `go get`able because of (what looks like) a vendoring error?
  • s

    stocky-spoon-28903

    06/21/2018, 10:49 PM
    ~
    ❯ go get <http://github.com/pulumi/pulumi|github.com/pulumi/pulumi>
    package <http://github.com/moby/moby/api/types/time|github.com/moby/moby/api/types/time>: code in directory /Users/James/Code/go/src/github.com/moby/moby/api/types/time expects import "<http://github.com/docker/docker/api/types/time|github.com/docker/docker/api/types/time>"
  • s

    stocky-spoon-28903

    06/21/2018, 10:49 PM
    (It’s always Docker….. 😐 )
  • p

    powerful-whale-8767

    06/21/2018, 10:55 PM
    Ew. The Moby codebase's canonical import paths are set to
    docker/docker
    , e.g.: https://github.com/moby/moby/blob/master/api/types/time/duration_convert.go#L1
  • s

    stocky-spoon-28903

    06/21/2018, 10:57 PM
    Heh, of course they are.
  • s

    stocky-spoon-28903

    06/21/2018, 10:58 PM
    Ah, I just realised that
    vendor/
    isn’t committed at all
  • s

    stocky-spoon-28903

    06/21/2018, 11:00 PM
    So my guess is whatever is on the HEAD of docker right now is broken, and
    go get
    was just pulling that down rather than the versions specified in
    Gopkg.toml
    (it’s been a long time since I’ve seen a repo without vendor/ committed though so my memory may not be correct on this)
  • s

    stocky-spoon-28903

    06/21/2018, 11:00 PM
    s/HEAD/master/
  • p

    powerful-whale-8767

    06/21/2018, 11:00 PM
    I think the problem is unfortunately on our side -- we import that library as
    moby/moby
    because, well, that's where it is...
Powered by Linen
Title
p

powerful-whale-8767

06/21/2018, 11:00 PM
I think the problem is unfortunately on our side -- we import that library as
moby/moby
because, well, that's where it is...
View count: 1