https://pulumi.com logo
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

    boundless-monkey-50243

    09/02/2018, 10:00 PM
    That's perfect, thank you
  • c

    creamy-potato-29402

    09/02/2018, 10:02 PM
    Hope that was clear
  • b

    big-piano-35669

    09/02/2018, 10:35 PM
    For some things, apply will work. I hope this is sufficient for what you want to do, Ed. We also do plan to support event hooks for pre/post operations, like preUpdate, postDelete, etc. This is tracked by https://github.com/pulumi/pulumi/issues/1691 Eager to hear whether you're successful with just apply here or if you need something richer. We might be able to get something working with dynamic providers if you do (https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/dynamic/index.ts).
  • b

    boundless-monkey-50243

    09/03/2018, 5:05 PM
    I can't...find...
    apply
    ?
  • b

    boundless-monkey-50243

    09/03/2018, 5:06 PM
    Like, maybe I'm totally missing it, but I cannot find
    apply
    on
    aws.ec2.Instance
  • b

    boundless-monkey-50243

    09/03/2018, 5:06 PM
    And tbh even if I use that won't it then do its thing during a preview? That seems bad
  • b

    boundless-monkey-50243

    09/03/2018, 5:07 PM
    #1691 seems pretty important to actually using this in anger
  • b

    big-piano-35669

    09/03/2018, 5:09 PM
    I think Alex probably meant hanging this off its
    id
    field, e.g.
    let vm = new aws.ec2.Instance(...);
    vm.id.apply(_ => {
        // side-effectful code here
    });
    The apply body actually does not run during previews, because the value of the ID isn't yet known. This is definitely a bit of an abuse of
    apply
    , for sure, since it's meant to produce dataflow values that capture dependencies. And it will run on subsequent updates, not just the initial create, which for a lot of VM config scenarios won't work right. It can work for limited scenarios, though. Agree 100%, #1691 is going to be important for anything more sophisticated than "do this once during update."
  • b

    boundless-monkey-50243

    09/03/2018, 5:10 PM
    Ah, okay, I see. That's clever
  • b

    boundless-monkey-50243

    09/03/2018, 5:11 PM
    A lot of this right now is a bit "bootstrap the world" so I'm trying to figure out the best way to organize the steps involved; something like that would help quite a bit
  • b

    boundless-monkey-50243

    09/03/2018, 5:12 PM
    Might have to break this into multiple programs, which is a bummer but expected
  • b

    boundless-monkey-50243

    09/03/2018, 5:12 PM
    (even with pre/post events)
  • b

    boundless-monkey-50243

    09/03/2018, 5:13 PM
    The way my own local maximum, https://github.com/eropple/auster, works is that it runs a set of CloudFormation templates, in order, with the expectation that pre/post steps occur around those templates; I was hoping that, with something a little more programmatic, I could more reasonably wire it into a single program, but that might be unwise
  • b

    big-piano-35669

    09/03/2018, 5:13 PM
    You might be interested to check out the Ruby on Rails example, if you haven't seen it. This is just a sample so not everything works, but it demonstrates using a subset of the CloudInit-style VM initialization that CloudFormation supports: https://github.com/pulumi/examples/blob/master/aws-ts-ruby-on-rails/index.ts This still doesn't support the synchronization with completion, however, a la
    cfn-init
    and signals.
  • b

    boundless-monkey-50243

    09/03/2018, 5:14 PM
    Yeah, I have hacked something similar together with Terraform in the past
  • b

    boundless-monkey-50243

    09/03/2018, 5:14 PM
    Not having the CFN metadata service really makes life harder, but it's unavoidable
  • r

    rough-oil-1458

    09/03/2018, 5:16 PM
    Couldn't you just create a Component to most of this?
  • r

    rough-oil-1458

    09/03/2018, 5:16 PM
    to do *
  • b

    boundless-monkey-50243

    09/03/2018, 5:16 PM
    At the cost of significantly increased complexity, sure.
  • r

    rough-oil-1458

    09/03/2018, 5:17 PM
    okie dokie 🙂
  • b

    boundless-monkey-50243

    09/03/2018, 5:18 PM
    I need to keep things at least mostly comprehensible to my dev team once this rolls out. Minimal custom magic is good.
  • r

    rough-oil-1458

    09/03/2018, 5:19 PM
    I hear yea, Don't take my Okie Dokie in a bad way
  • b

    boundless-monkey-50243

    09/03/2018, 5:19 PM
    👍
  • r

    rough-oil-1458

    09/03/2018, 5:19 PM
    Not everyones situation is the same
  • b

    boundless-monkey-50243

    09/03/2018, 5:19 PM
    I did not know about
    pcloudinit
    though and now I owe Joe a beer
    🍻 1
  • b

    big-piano-35669

    09/03/2018, 5:19 PM
    It is woefully incomplete.
  • b

    boundless-monkey-50243

    09/03/2018, 5:19 PM
    Might be a little mislabeled though
  • b

    boundless-monkey-50243

    09/03/2018, 5:20 PM
    It's more cfninit than cloudinit, yeah?
  • b

    big-piano-35669

    09/03/2018, 5:20 PM
    Yeah, it sort of morphed in situ. I should probably rename it.
  • b

    big-piano-35669

    09/03/2018, 5:20 PM
    I always envisioned that we'd improve it as we encountered more examples and then eventually promote to an "official" Pulumi library.
Powered by Linen
Title
b

big-piano-35669

09/03/2018, 5:20 PM
I always envisioned that we'd improve it as we encountered more examples and then eventually promote to an "official" Pulumi library.
View count: 1