2018-03-21 20:43:21 +01:00
|
|
|
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
2018-02-06 01:29:20 +01:00
|
|
|
|
2018-02-12 22:13:13 +01:00
|
|
|
import * as pulumi from "@pulumi/pulumi";
|
|
|
|
import * as dynamic from "@pulumi/pulumi/dynamic";
|
2018-02-06 01:29:20 +01:00
|
|
|
|
|
|
|
const sleep = require("sleep-promise");
|
|
|
|
const assert = require("assert");
|
|
|
|
|
|
|
|
class NullProvider implements dynamic.ResourceProvider {
|
|
|
|
check = (olds: any, news: any) => Promise.resolve({ inputs: news });
|
|
|
|
diff = (id: pulumi.ID, olds: any, news: any) => Promise.resolve({});
|
|
|
|
create = (inputs: any) => Promise.resolve({ id: "0" });
|
|
|
|
update = (id: string, olds: any, news: any) => Promise.resolve({});
|
|
|
|
delete = (id: pulumi.ID, props: any) => Promise.resolve();
|
|
|
|
}
|
|
|
|
|
|
|
|
class NullResource extends dynamic.Resource {
|
|
|
|
constructor(name: string, input: any) {
|
|
|
|
super(new NullProvider(), name, {input: input}, undefined);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function getInput(): Promise<pulumi.Output<string>> {
|
|
|
|
await sleep(1000);
|
|
|
|
|
|
|
|
return (new NullResource("a", "")).urn;
|
|
|
|
}
|
|
|
|
|
|
|
|
const b = new NullResource("b", getInput());
|