initial commit

This commit is contained in:
2025-04-18 13:26:52 -07:00
commit b78296ab5b
134 changed files with 11623 additions and 0 deletions

0
sdk/nodejs/Pulumi.yaml generated Normal file
View File

4
sdk/nodejs/README.md generated Normal file
View File

@@ -0,0 +1,4 @@
> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)
> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,
> first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,
> please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).

5
sdk/nodejs/config/index.ts generated Normal file
View File

@@ -0,0 +1,5 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// Export members:
export * from "./vars";

23
sdk/nodejs/config/vars.ts generated Normal file
View File

@@ -0,0 +1,23 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";
import * as utilities from "../utilities";
declare var exports: any;
const __config = new pulumi.Config("xyz");
/**
* A region which should be used.
*/
export declare const region: enums.region.Region | undefined;
Object.defineProperty(exports, "region", {
get() {
return __config.getObject<enums.region.Region>("region");
},
enumerable: true,
});

43
sdk/nodejs/getDataSource.ts generated Normal file
View File

@@ -0,0 +1,43 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
export function getDataSource(args: GetDataSourceArgs, opts?: pulumi.InvokeOptions): Promise<GetDataSourceResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("xyz:index/getDataSource:getDataSource", {
"sampleAttribute": args.sampleAttribute,
}, opts);
}
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceArgs {
sampleAttribute: string;
}
/**
* A collection of values returned by getDataSource.
*/
export interface GetDataSourceResult {
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly sampleAttribute: string;
}
export function getDataSourceOutput(args: GetDataSourceOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetDataSourceResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("xyz:index/getDataSource:getDataSource", {
"sampleAttribute": args.sampleAttribute,
}, opts);
}
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceOutputArgs {
sampleAttribute: pulumi.Input<string>;
}

3
sdk/nodejs/go.mod generated Normal file
View File

@@ -0,0 +1,3 @@
module fake_nodejs_module // Exclude this directory from Go tools
go 1.17

55
sdk/nodejs/index.ts generated Normal file
View File

@@ -0,0 +1,55 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
// Export members:
export { GetDataSourceArgs, GetDataSourceResult, GetDataSourceOutputArgs } from "./getDataSource";
export const getDataSource: typeof import("./getDataSource").getDataSource = null as any;
export const getDataSourceOutput: typeof import("./getDataSource").getDataSourceOutput = null as any;
utilities.lazyLoad(exports, ["getDataSource","getDataSourceOutput"], () => require("./getDataSource"));
export { ProviderArgs } from "./provider";
export type Provider = import("./provider").Provider;
export const Provider: typeof import("./provider").Provider = null as any;
utilities.lazyLoad(exports, ["Provider"], () => require("./provider"));
export { ResourceArgs, ResourceState } from "./resource";
export type Resource = import("./resource").Resource;
export const Resource: typeof import("./resource").Resource = null as any;
utilities.lazyLoad(exports, ["Resource"], () => require("./resource"));
// Export sub-modules:
import * as config from "./config";
import * as region from "./region";
import * as types from "./types";
export {
config,
region,
types,
};
const _module = {
version: utilities.getVersion(),
construct: (name: string, type: string, urn: string): pulumi.Resource => {
switch (type) {
case "xyz:index/resource:Resource":
return new Resource(name, <any>undefined, { urn })
default:
throw new Error(`unknown resource type ${type}`);
}
},
};
pulumi.runtime.registerResourceModule("xyz", "index/resource", _module)
pulumi.runtime.registerResourcePackage("xyz", {
version: utilities.getVersion(),
constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => {
if (type !== "pulumi:providers:xyz") {
throw new Error(`unknown provider type ${type}`);
}
return new Provider(name, <any>undefined, { urn });
},
});

27
sdk/nodejs/package.json generated Normal file
View File

@@ -0,0 +1,27 @@
{
"name": "@pulumi/xyz",
"version": "1.0.0-alpha.0+dev",
"description": "A Pulumi package for creating and managing xyz cloud resources.",
"keywords": [
"xyz",
"category/cloud"
],
"homepage": "https://www.pulumi.com",
"repository": "https://github.com/pulumi/pulumi-xyz",
"license": "Apache-2.0",
"scripts": {
"build": "tsc"
},
"dependencies": {
"@pulumi/pulumi": "^3.142.0"
},
"devDependencies": {
"@types/node": "^18",
"typescript": "^4.3.5"
},
"pulumi": {
"resource": true,
"name": "xyz",
"version": "1.0.0-alpha.0+dev"
}
}

58
sdk/nodejs/provider.ts generated Normal file
View File

@@ -0,0 +1,58 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as enums from "./types/enums";
import * as utilities from "./utilities";
/**
* The provider type for the xyz package. By default, resources use package-wide configuration
* settings, however an explicit `Provider` instance may be created and passed during resource
* construction to achieve fine-grained programmatic control over provider settings. See the
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
*/
export class Provider extends pulumi.ProviderResource {
/** @internal */
public static readonly __pulumiType = 'xyz';
/**
* Returns true if the given object is an instance of Provider. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Provider {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}
/**
* Create a Provider resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
{
resourceInputs["region"] = args ? args.region : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Provider.__pulumiType, name, resourceInputs, opts);
}
}
/**
* The set of arguments for constructing a Provider resource.
*/
export interface ProviderArgs {
/**
* A region which should be used.
*/
region?: pulumi.Input<enums.region.Region>;
}

6
sdk/nodejs/region/index.ts generated Normal file
View File

@@ -0,0 +1,6 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// Export enums:
export * from "../types/enums/region";

81
sdk/nodejs/resource.ts generated Normal file
View File

@@ -0,0 +1,81 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
export class Resource extends pulumi.CustomResource {
/**
* Get an existing Resource resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ResourceState, opts?: pulumi.CustomResourceOptions): Resource {
return new Resource(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'xyz:index/resource:Resource';
/**
* Returns true if the given object is an instance of Resource. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Resource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Resource.__pulumiType;
}
/**
* Sample attribute.
*/
public readonly sampleAttribute!: pulumi.Output<string | undefined>;
/**
* Create a Resource resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ResourceArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ResourceArgs | ResourceState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ResourceState | undefined;
resourceInputs["sampleAttribute"] = state ? state.sampleAttribute : undefined;
} else {
const args = argsOrState as ResourceArgs | undefined;
resourceInputs["sampleAttribute"] = args ? args.sampleAttribute : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Resource.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Resource resources.
*/
export interface ResourceState {
/**
* Sample attribute.
*/
sampleAttribute?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Resource resource.
*/
export interface ResourceArgs {
/**
* Sample attribute.
*/
sampleAttribute?: pulumi.Input<string>;
}

30
sdk/nodejs/tsconfig.json generated Normal file
View File

@@ -0,0 +1,30 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"stripInternal": true,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"files": [
"config/index.ts",
"config/vars.ts",
"getDataSource.ts",
"index.ts",
"provider.ts",
"region/index.ts",
"resource.ts",
"types/enums/index.ts",
"types/enums/region/index.ts",
"types/index.ts",
"types/input.ts",
"types/output.ts",
"utilities.ts"
]
}

9
sdk/nodejs/types/enums/index.ts generated Normal file
View File

@@ -0,0 +1,9 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// Export sub-modules:
import * as region from "./region";
export {
region,
};

10
sdk/nodejs/types/enums/region/index.ts generated Normal file
View File

@@ -0,0 +1,10 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
export const Region = {
Here: "HERE",
OverThere: "OVER_THERE",
} as const;
export type Region = (typeof Region)[keyof typeof Region];

13
sdk/nodejs/types/index.ts generated Normal file
View File

@@ -0,0 +1,13 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// Export sub-modules:
import * as enums from "./enums";
import * as input from "./input";
import * as output from "./output";
export {
enums,
input,
output,
};

8
sdk/nodejs/types/input.ts generated Normal file
View File

@@ -0,0 +1,8 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";

8
sdk/nodejs/types/output.ts generated Normal file
View File

@@ -0,0 +1,8 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";

95
sdk/nodejs/utilities.ts generated Normal file
View File

@@ -0,0 +1,95 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as runtime from "@pulumi/pulumi/runtime";
import * as pulumi from "@pulumi/pulumi";
export function getEnv(...vars: string[]): string | undefined {
for (const v of vars) {
const value = process.env[v];
if (value) {
return value;
}
}
return undefined;
}
export function getEnvBoolean(...vars: string[]): boolean | undefined {
const s = getEnv(...vars);
if (s !== undefined) {
// NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
// Terraform uses internally when parsing boolean values.
if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
return true;
}
if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
return false;
}
}
return undefined;
}
export function getEnvNumber(...vars: string[]): number | undefined {
const s = getEnv(...vars);
if (s !== undefined) {
const f = parseFloat(s);
if (!isNaN(f)) {
return f;
}
}
return undefined;
}
export function getVersion(): string {
let version = require('./package.json').version;
// Node allows for the version to be prefixed by a "v", while semver doesn't.
// If there is a v, strip it off.
if (version.indexOf('v') === 0) {
version = version.slice(1);
}
return version;
}
/** @internal */
export function resourceOptsDefaults(): any {
return { version: getVersion() };
}
/** @internal */
export function lazyLoad(exports: any, props: string[], loadModule: any) {
for (let property of props) {
Object.defineProperty(exports, property, {
enumerable: true,
get: function() {
return loadModule()[property];
},
});
}
}
export async function callAsync<T>(
tok: string,
props: pulumi.Inputs,
res?: pulumi.Resource,
opts?: {property?: string},
): Promise<T> {
const o: any = runtime.call<T>(tok, props, res);
const value = await o.promise(true /*withUnknowns*/);
const isKnown = await o.isKnown;
const isSecret = await o.isSecret;
const problem: string|undefined =
!isKnown ? "an unknown value"
: isSecret ? "a secret value"
: undefined;
// Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
if (problem) {
throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
"This is an error in the provider, please report this to the provider developer.");
}
// Extract a single property if requested.
if (opts && opts.property) {
return value[opts.property];
}
return value;
}