creamy-potato-29402
09/02/2018, 10:02 PMbig-piano-35669
boundless-monkey-50243
09/03/2018, 5:05 PMapply
?boundless-monkey-50243
09/03/2018, 5:06 PMapply
on aws.ec2.Instance
boundless-monkey-50243
09/03/2018, 5:06 PMboundless-monkey-50243
09/03/2018, 5:07 PMbig-piano-35669
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."boundless-monkey-50243
09/03/2018, 5:10 PMboundless-monkey-50243
09/03/2018, 5:11 PMboundless-monkey-50243
09/03/2018, 5:12 PMboundless-monkey-50243
09/03/2018, 5:12 PMboundless-monkey-50243
09/03/2018, 5:13 PMbig-piano-35669
cfn-init
and signals.boundless-monkey-50243
09/03/2018, 5:14 PMboundless-monkey-50243
09/03/2018, 5:14 PMrough-oil-1458
09/03/2018, 5:16 PMrough-oil-1458
09/03/2018, 5:16 PMboundless-monkey-50243
09/03/2018, 5:16 PMrough-oil-1458
09/03/2018, 5:17 PMboundless-monkey-50243
09/03/2018, 5:18 PMrough-oil-1458
09/03/2018, 5:19 PMboundless-monkey-50243
09/03/2018, 5:19 PMrough-oil-1458
09/03/2018, 5:19 PMboundless-monkey-50243
09/03/2018, 5:19 PMpcloudinit
though and now I owe Joe a beerbig-piano-35669
boundless-monkey-50243
09/03/2018, 5:19 PMboundless-monkey-50243
09/03/2018, 5:20 PMbig-piano-35669
big-piano-35669
boundless-monkey-50243
09/03/2018, 5:20 PM