mirror of https://github.com/pulumi/pulumi.git
33 lines
825 B
TypeScript
33 lines
825 B
TypeScript
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
|
|
|
import * as pulumi from "@pulumi/pulumi";
|
|
|
|
let currentID = 0;
|
|
|
|
class Provider implements pulumi.dynamic.ResourceProvider {
|
|
public static instance = new Provider();
|
|
|
|
public create: (inputs: any) => Promise<pulumi.dynamic.CreateResult>;
|
|
|
|
constructor() {
|
|
this.create = async (inputs: any) => {
|
|
return {
|
|
id: (currentID++) + "",
|
|
outs: undefined,
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
class Resource extends pulumi.dynamic.Resource {
|
|
constructor(name: string, opts?: pulumi.ResourceOptions) {
|
|
super(Provider.instance, name, {}, opts);
|
|
}
|
|
}
|
|
|
|
// Create a resource using the default dynamic provider instance.
|
|
let a = new Resource("a");
|
|
let b = new Resource("b");
|
|
|
|
export const urn = a.urn;
|