build nodejs

This commit is contained in:
2025-04-24 21:09:04 -04:00
parent b9ca51af01
commit b348133412
40 changed files with 6093 additions and 74 deletions

View File

@@ -1,6 +1,7 @@
import * as incus from "@kiterun/incus"; import * as incus from "@kiterun/incus";
const resource = new incus.Instance("instance1", { const resource = new incus.Instance("instance1", {
name: "instance1",
image: "images:ubuntu/22.04", image: "images:ubuntu/22.04",
project: "default", project: "default",
config: { config: {

View File

@@ -82,7 +82,14 @@
"majorVersion": 1 "majorVersion": 1
}, },
"incus_network_lb": { "incus_network_lb": {
"current": "incus:index/networkLb:NetworkLb", "current": "incus:index/networkLoadBalancer:NetworkLoadBalancer",
"past": [
{
"name": "incus:index/networkLb:NetworkLb",
"inCodegen": true,
"majorVersion": 1
}
],
"majorVersion": 1, "majorVersion": 1,
"fields": { "fields": {
"backend": { "backend": {
@@ -172,5 +179,13 @@
} }
} }
}, },
"auto-settings": {} "auto-settings": {
"resources": {
"incus_network_lb": {
"aliases": [
"incus:index/networkLb:NetworkLb"
]
}
}
}
} }

File diff suppressed because one or more lines are too long

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/lxc/terraform-provider-incus)
> 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-incus` repo](https://git.kalinow.ski/nimbus/pulumi-incus/issues); however, if that doesn't turn up anything,
> please consult the source [`terraform-provider-incus` repo](https://github.com/lxc/terraform-provider-incus/issues).

189
sdk/nodejs/certificate.ts generated Normal file
View File

@@ -0,0 +1,189 @@
// *** 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";
/**
* ## # incus.Certificate
*
* Manages an Incus certificate.
*/
export class Certificate extends pulumi.CustomResource {
/**
* Get an existing Certificate 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?: CertificateState, opts?: pulumi.CustomResourceOptions): Certificate {
return new Certificate(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/certificate:Certificate';
/**
* Returns true if the given object is an instance of Certificate. 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 Certificate {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Certificate.__pulumiType;
}
/**
* **Required** - The certificate.
*/
public readonly certificate!: pulumi.Output<string>;
/**
* *Optional* - Description of the certificate.
*/
public readonly description!: pulumi.Output<string>;
/**
* The fingerprint of the certificate.
*/
public /*out*/ readonly fingerprint!: pulumi.Output<string>;
/**
* **Required** - Name of the certificate.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
public readonly projects!: pulumi.Output<string[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
public readonly restricted!: pulumi.Output<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
public readonly type!: pulumi.Output<string>;
/**
* Create a Certificate 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: CertificateArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: CertificateArgs | CertificateState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as CertificateState | undefined;
resourceInputs["certificate"] = state ? state.certificate : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["fingerprint"] = state ? state.fingerprint : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projects"] = state ? state.projects : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["restricted"] = state ? state.restricted : undefined;
resourceInputs["type"] = state ? state.type : undefined;
} else {
const args = argsOrState as CertificateArgs | undefined;
if ((!args || args.certificate === undefined) && !opts.urn) {
throw new Error("Missing required property 'certificate'");
}
resourceInputs["certificate"] = args ? args.certificate : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projects"] = args ? args.projects : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["restricted"] = args ? args.restricted : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["fingerprint"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Certificate.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Certificate resources.
*/
export interface CertificateState {
/**
* **Required** - The certificate.
*/
certificate?: pulumi.Input<string>;
/**
* *Optional* - Description of the certificate.
*/
description?: pulumi.Input<string>;
/**
* The fingerprint of the certificate.
*/
fingerprint?: pulumi.Input<string>;
/**
* **Required** - Name of the certificate.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
projects?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
restricted?: pulumi.Input<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Certificate resource.
*/
export interface CertificateArgs {
/**
* **Required** - The certificate.
*/
certificate: pulumi.Input<string>;
/**
* *Optional* - Description of the certificate.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the certificate.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
projects?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
restricted?: pulumi.Input<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
type?: pulumi.Input<string>;
}

120
sdk/nodejs/clusterGroup.ts generated Normal file
View File

@@ -0,0 +1,120 @@
// *** 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 ClusterGroup extends pulumi.CustomResource {
/**
* Get an existing ClusterGroup 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?: ClusterGroupState, opts?: pulumi.CustomResourceOptions): ClusterGroup {
return new ClusterGroup(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/clusterGroup:ClusterGroup';
/**
* Returns true if the given object is an instance of ClusterGroup. 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 ClusterGroup {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ClusterGroup.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [cluster group config settings](https://linuxcontainers.org/incus/docs/main/howto/cluster_groups/#configuration-options).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Name of the cluster group.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a ClusterGroup 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?: ClusterGroupArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ClusterGroupArgs | ClusterGroupState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ClusterGroupState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as ClusterGroupArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterGroup.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering ClusterGroup resources.
*/
export interface ClusterGroupState {
/**
* *Optional* - Map of key/value pairs of
* [cluster group config settings](https://linuxcontainers.org/incus/docs/main/howto/cluster_groups/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
/**
* **Required** - Name of the cluster group.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ClusterGroup resource.
*/
export interface ClusterGroupArgs {
/**
* *Optional* - Map of key/value pairs of
* [cluster group config settings](https://linuxcontainers.org/incus/docs/main/howto/cluster_groups/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
/**
* **Required** - Name of the cluster group.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

118
sdk/nodejs/clusterGroupAssignment.ts generated Normal file
View File

@@ -0,0 +1,118 @@
// *** 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 ClusterGroupAssignment extends pulumi.CustomResource {
/**
* Get an existing ClusterGroupAssignment 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?: ClusterGroupAssignmentState, opts?: pulumi.CustomResourceOptions): ClusterGroupAssignment {
return new ClusterGroupAssignment(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/clusterGroupAssignment:ClusterGroupAssignment';
/**
* Returns true if the given object is an instance of ClusterGroupAssignment. 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 ClusterGroupAssignment {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ClusterGroupAssignment.__pulumiType;
}
/**
* **Required** - Name of the cluster group.
*/
public readonly clusterGroup!: pulumi.Output<string>;
/**
* **Required** - Name of the cluster group member.
*/
public readonly member!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a ClusterGroupAssignment 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: ClusterGroupAssignmentArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ClusterGroupAssignmentArgs | ClusterGroupAssignmentState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ClusterGroupAssignmentState | undefined;
resourceInputs["clusterGroup"] = state ? state.clusterGroup : undefined;
resourceInputs["member"] = state ? state.member : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as ClusterGroupAssignmentArgs | undefined;
if ((!args || args.clusterGroup === undefined) && !opts.urn) {
throw new Error("Missing required property 'clusterGroup'");
}
if ((!args || args.member === undefined) && !opts.urn) {
throw new Error("Missing required property 'member'");
}
resourceInputs["clusterGroup"] = args ? args.clusterGroup : undefined;
resourceInputs["member"] = args ? args.member : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterGroupAssignment.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering ClusterGroupAssignment resources.
*/
export interface ClusterGroupAssignmentState {
/**
* **Required** - Name of the cluster group.
*/
clusterGroup?: pulumi.Input<string>;
/**
* **Required** - Name of the cluster group member.
*/
member?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ClusterGroupAssignment resource.
*/
export interface ClusterGroupAssignmentArgs {
/**
* **Required** - Name of the cluster group.
*/
clusterGroup: pulumi.Input<string>;
/**
* **Required** - Name of the cluster group member.
*/
member: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

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";

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

@@ -0,0 +1,67 @@
// *** 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 utilities from "../utilities";
declare var exports: any;
const __config = new pulumi.Config("incus");
/**
* Accept the server certificate.
*/
export declare const acceptRemoteCertificate: boolean | undefined;
Object.defineProperty(exports, "acceptRemoteCertificate", {
get() {
return __config.getObject<boolean>("acceptRemoteCertificate");
},
enumerable: true,
});
/**
* The directory to look for existing Incus configuration. (default = $HOME/.config/incus)
*/
export declare const configDir: string | undefined;
Object.defineProperty(exports, "configDir", {
get() {
return __config.get("configDir");
},
enumerable: true,
});
/**
* Automatically generate the Incus client certificates if they don't exist.
*/
export declare const generateClientCertificates: boolean | undefined;
Object.defineProperty(exports, "generateClientCertificates", {
get() {
return __config.getObject<boolean>("generateClientCertificates");
},
enumerable: true,
});
/**
* The project where project-scoped resources will be created. Can be overridden in individual resources. (default =
* default)
*/
export declare const project: string | undefined;
Object.defineProperty(exports, "project", {
get() {
return __config.get("project");
},
enumerable: true,
});
/**
* Incus Remote
*/
export declare const remotes: outputs.config.Remotes[] | undefined;
Object.defineProperty(exports, "remotes", {
get() {
return __config.getObject<outputs.config.Remotes[]>("remotes");
},
enumerable: true,
});

158
sdk/nodejs/getImage.ts generated Normal file
View File

@@ -0,0 +1,158 @@
// *** 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";
/**
* ## # incus.Image
*
* Provides information about an Incus image.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const debianCustom = incus.getImage({
* name: "debian_custom",
* });
* const d1 = new incus.Instance("d1", {
* image: debianCustom.then(debianCustom => debianCustom.fingerprint),
* name: "d1",
* });
* ```
*/
export function getImage(args?: GetImageArgs, opts?: pulumi.InvokeOptions): Promise<GetImageResult> {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("incus:index/getImage:getImage", {
"architecture": args.architecture,
"fingerprint": args.fingerprint,
"name": args.name,
"project": args.project,
"remote": args.remote,
"type": args.type,
}, opts);
}
/**
* A collection of arguments for invoking getImage.
*/
export interface GetImageArgs {
/**
* *Optional* - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.
*/
architecture?: string;
/**
* *Optional* - Fingerprint of the image.
*/
fingerprint?: string;
/**
* *Optional* - Name of the image.
*/
name?: string;
/**
* *Optional* - Name of the project where the image is stored.
*/
project?: string;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: string;
/**
* *Optional* - Type of image. Must be one of `container` or `virtual-machine`.
*/
type?: string;
}
/**
* A collection of values returned by getImage.
*/
export interface GetImageResult {
/**
* The list of aliases for the image.
*/
readonly aliases: string[];
readonly architecture: string;
/**
* The datetime of image creation, in Unix time.
*/
readonly createdAt: number;
readonly fingerprint: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly name?: string;
readonly project?: string;
readonly remote?: string;
readonly type: string;
}
/**
* ## # incus.Image
*
* Provides information about an Incus image.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const debianCustom = incus.getImage({
* name: "debian_custom",
* });
* const d1 = new incus.Instance("d1", {
* image: debianCustom.then(debianCustom => debianCustom.fingerprint),
* name: "d1",
* });
* ```
*/
export function getImageOutput(args?: GetImageOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetImageResult> {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("incus:index/getImage:getImage", {
"architecture": args.architecture,
"fingerprint": args.fingerprint,
"name": args.name,
"project": args.project,
"remote": args.remote,
"type": args.type,
}, opts);
}
/**
* A collection of arguments for invoking getImage.
*/
export interface GetImageOutputArgs {
/**
* *Optional* - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.
*/
architecture?: pulumi.Input<string>;
/**
* *Optional* - Fingerprint of the image.
*/
fingerprint?: pulumi.Input<string>;
/**
* *Optional* - Name of the image.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the image is stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Type of image. Must be one of `container` or `virtual-machine`.
*/
type?: pulumi.Input<string>;
}

142
sdk/nodejs/getProfile.ts generated Normal file
View File

@@ -0,0 +1,142 @@
// *** 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 utilities from "./utilities";
/**
* ## # incus.Profile
*
* Provides information about an Incus profile.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const _default = incus.getProfile({
* name: "default",
* });
* const d1 = new incus.Instance("d1", {
* profiles: [_default.then(_default => _default.name)],
* image: "images:debian/12",
* name: "d1",
* });
* ```
*/
export function getProfile(args: GetProfileArgs, opts?: pulumi.InvokeOptions): Promise<GetProfileResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("incus:index/getProfile:getProfile", {
"devices": args.devices,
"name": args.name,
"project": args.project,
"remote": args.remote,
}, opts);
}
/**
* A collection of arguments for invoking getProfile.
*/
export interface GetProfileArgs {
/**
* Device definition. See reference below.
*/
devices?: inputs.GetProfileDevice[];
/**
* **Required** - Name of the profile.
*/
name: string;
/**
* *Optional* - Name of the project where the profile will be stored.
*/
project?: string;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: string;
}
/**
* A collection of values returned by getProfile.
*/
export interface GetProfileResult {
/**
* Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
readonly config: {[key: string]: string};
readonly description: string;
/**
* Device definition. See reference below.
*/
readonly devices?: outputs.GetProfileDevice[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* Name of the device.
*/
readonly name: string;
readonly project?: string;
readonly remote?: string;
}
/**
* ## # incus.Profile
*
* Provides information about an Incus profile.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const _default = incus.getProfile({
* name: "default",
* });
* const d1 = new incus.Instance("d1", {
* profiles: [_default.then(_default => _default.name)],
* image: "images:debian/12",
* name: "d1",
* });
* ```
*/
export function getProfileOutput(args: GetProfileOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetProfileResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("incus:index/getProfile:getProfile", {
"devices": args.devices,
"name": args.name,
"project": args.project,
"remote": args.remote,
}, opts);
}
/**
* A collection of arguments for invoking getProfile.
*/
export interface GetProfileOutputArgs {
/**
* Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.GetProfileDeviceArgs>[]>;
/**
* **Required** - Name of the profile.
*/
name: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the profile will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

137
sdk/nodejs/getProject.ts generated Normal file
View File

@@ -0,0 +1,137 @@
// *** 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";
/**
* ## # incus.Project
*
* Provides information about an Incus project.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const _default = incus.getProject({
* name: "default",
* });
* const d1 = new incus.Instance("d1", {
* project: _default.then(_default => _default.name),
* image: "images:debian/12",
* name: "d1",
* });
* ```
*/
export function getProject(args: GetProjectArgs, opts?: pulumi.InvokeOptions): Promise<GetProjectResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("incus:index/getProject:getProject", {
"config": args.config,
"description": args.description,
"name": args.name,
"remote": args.remote,
}, opts);
}
/**
* A collection of arguments for invoking getProject.
*/
export interface GetProjectArgs {
/**
* Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: {[key: string]: string};
/**
* Description of the project.
*/
description?: string;
/**
* **Required** - Name of the project.
*/
name: string;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: string;
}
/**
* A collection of values returned by getProject.
*/
export interface GetProjectResult {
/**
* Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
readonly config: {[key: string]: string};
/**
* Description of the project.
*/
readonly description: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly name: string;
readonly remote?: string;
}
/**
* ## # incus.Project
*
* Provides information about an Incus project.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
* import * as incus from "@pulumi/incus";
*
* const _default = incus.getProject({
* name: "default",
* });
* const d1 = new incus.Instance("d1", {
* project: _default.then(_default => _default.name),
* image: "images:debian/12",
* name: "d1",
* });
* ```
*/
export function getProjectOutput(args: GetProjectOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetProjectResult> {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("incus:index/getProject:getProject", {
"config": args.config,
"description": args.description,
"name": args.name,
"remote": args.remote,
}, opts);
}
/**
* A collection of arguments for invoking getProject.
*/
export interface GetProjectOutputArgs {
/**
* Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* Description of the project.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the project.
*/
name: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource was created. If
* not provided, the provider's default remote will be used.
*/
remote?: 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

221
sdk/nodejs/image.ts generated Normal file
View File

@@ -0,0 +1,221 @@
// *** 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 utilities from "./utilities";
/**
* ## # incus.Image
*
* Manages a locally-stored Incus image.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const alpine = new incus.Image("alpine", {sourceImage: {
* remote: "images",
* name: "alpine/edge",
* }});
* const test1 = new incus.Instance("test1", {
* name: "test1",
* image: alpine.fingerprint,
* ephemeral: false,
* });
* ```
*
* ## Notes
*
* * See the Incus [documentation](https://linuxcontainers.org/incus/docs/main/howto/images_remote) for more info on default image remotes.
*/
export class Image extends pulumi.CustomResource {
/**
* Get an existing Image 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?: ImageState, opts?: pulumi.CustomResourceOptions): Image {
return new Image(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/image:Image';
/**
* Returns true if the given object is an instance of Image. 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 Image {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Image.__pulumiType;
}
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
public readonly aliases!: pulumi.Output<string[] | undefined>;
/**
* The list of aliases that were copied from the
* `sourceImage`.
*/
public /*out*/ readonly copiedAliases!: pulumi.Output<string[]>;
/**
* The datetime of image creation, in Unix time.
*/
public /*out*/ readonly createdAt!: pulumi.Output<number>;
/**
* The unique hash fingperint of the image.
*/
public /*out*/ readonly fingerprint!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the image will be stored.
*/
public readonly project!: pulumi.Output<string | undefined>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
public /*out*/ readonly resourceId!: pulumi.Output<string>;
/**
* *Optional* - The image file from the local file system from which the image will be created. See reference below.
*/
public readonly sourceFile!: pulumi.Output<outputs.ImageSourceFile | undefined>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
public readonly sourceImage!: pulumi.Output<outputs.ImageSourceImage | undefined>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
public readonly sourceInstance!: pulumi.Output<outputs.ImageSourceInstance | undefined>;
/**
* Create a Image 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?: ImageArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ImageArgs | ImageState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ImageState | undefined;
resourceInputs["aliases"] = state ? state.aliases : undefined;
resourceInputs["copiedAliases"] = state ? state.copiedAliases : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["fingerprint"] = state ? state.fingerprint : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["resourceId"] = state ? state.resourceId : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["sourceImage"] = state ? state.sourceImage : undefined;
resourceInputs["sourceInstance"] = state ? state.sourceInstance : undefined;
} else {
const args = argsOrState as ImageArgs | undefined;
resourceInputs["aliases"] = args ? args.aliases : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["sourceImage"] = args ? args.sourceImage : undefined;
resourceInputs["sourceInstance"] = args ? args.sourceInstance : undefined;
resourceInputs["copiedAliases"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["resourceId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Image.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Image resources.
*/
export interface ImageState {
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
aliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The list of aliases that were copied from the
* `sourceImage`.
*/
copiedAliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The datetime of image creation, in Unix time.
*/
createdAt?: pulumi.Input<number>;
/**
* The unique hash fingperint of the image.
*/
fingerprint?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the image will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
resourceId?: pulumi.Input<string>;
/**
* *Optional* - The image file from the local file system from which the image will be created. See reference below.
*/
sourceFile?: pulumi.Input<inputs.ImageSourceFile>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
sourceImage?: pulumi.Input<inputs.ImageSourceImage>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.ImageSourceInstance>;
}
/**
* The set of arguments for constructing a Image resource.
*/
export interface ImageArgs {
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
aliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the image will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - The image file from the local file system from which the image will be created. See reference below.
*/
sourceFile?: pulumi.Input<inputs.ImageSourceFile>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
sourceImage?: pulumi.Input<inputs.ImageSourceImage>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.ImageSourceInstance>;
}

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

@@ -0,0 +1,223 @@
// *** 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 { CertificateArgs, CertificateState } from "./certificate";
export type Certificate = import("./certificate").Certificate;
export const Certificate: typeof import("./certificate").Certificate = null as any;
utilities.lazyLoad(exports, ["Certificate"], () => require("./certificate"));
export { ClusterGroupArgs, ClusterGroupState } from "./clusterGroup";
export type ClusterGroup = import("./clusterGroup").ClusterGroup;
export const ClusterGroup: typeof import("./clusterGroup").ClusterGroup = null as any;
utilities.lazyLoad(exports, ["ClusterGroup"], () => require("./clusterGroup"));
export { ClusterGroupAssignmentArgs, ClusterGroupAssignmentState } from "./clusterGroupAssignment";
export type ClusterGroupAssignment = import("./clusterGroupAssignment").ClusterGroupAssignment;
export const ClusterGroupAssignment: typeof import("./clusterGroupAssignment").ClusterGroupAssignment = null as any;
utilities.lazyLoad(exports, ["ClusterGroupAssignment"], () => require("./clusterGroupAssignment"));
export { GetImageArgs, GetImageResult, GetImageOutputArgs } from "./getImage";
export const getImage: typeof import("./getImage").getImage = null as any;
export const getImageOutput: typeof import("./getImage").getImageOutput = null as any;
utilities.lazyLoad(exports, ["getImage","getImageOutput"], () => require("./getImage"));
export { GetProfileArgs, GetProfileResult, GetProfileOutputArgs } from "./getProfile";
export const getProfile: typeof import("./getProfile").getProfile = null as any;
export const getProfileOutput: typeof import("./getProfile").getProfileOutput = null as any;
utilities.lazyLoad(exports, ["getProfile","getProfileOutput"], () => require("./getProfile"));
export { GetProjectArgs, GetProjectResult, GetProjectOutputArgs } from "./getProject";
export const getProject: typeof import("./getProject").getProject = null as any;
export const getProjectOutput: typeof import("./getProject").getProjectOutput = null as any;
utilities.lazyLoad(exports, ["getProject","getProjectOutput"], () => require("./getProject"));
export { ImageArgs, ImageState } from "./image";
export type Image = import("./image").Image;
export const Image: typeof import("./image").Image = null as any;
utilities.lazyLoad(exports, ["Image"], () => require("./image"));
export { InstanceArgs, InstanceState } from "./instance";
export type Instance = import("./instance").Instance;
export const Instance: typeof import("./instance").Instance = null as any;
utilities.lazyLoad(exports, ["Instance"], () => require("./instance"));
export { InstanceSnapshotArgs, InstanceSnapshotState } from "./instanceSnapshot";
export type InstanceSnapshot = import("./instanceSnapshot").InstanceSnapshot;
export const InstanceSnapshot: typeof import("./instanceSnapshot").InstanceSnapshot = null as any;
utilities.lazyLoad(exports, ["InstanceSnapshot"], () => require("./instanceSnapshot"));
export { NetworkArgs, NetworkState } from "./network";
export type Network = import("./network").Network;
export const Network: typeof import("./network").Network = null as any;
utilities.lazyLoad(exports, ["Network"], () => require("./network"));
export { NetworkAclArgs, NetworkAclState } from "./networkAcl";
export type NetworkAcl = import("./networkAcl").NetworkAcl;
export const NetworkAcl: typeof import("./networkAcl").NetworkAcl = null as any;
utilities.lazyLoad(exports, ["NetworkAcl"], () => require("./networkAcl"));
export { NetworkForwardArgs, NetworkForwardState } from "./networkForward";
export type NetworkForward = import("./networkForward").NetworkForward;
export const NetworkForward: typeof import("./networkForward").NetworkForward = null as any;
utilities.lazyLoad(exports, ["NetworkForward"], () => require("./networkForward"));
export { NetworkIntegrationArgs, NetworkIntegrationState } from "./networkIntegration";
export type NetworkIntegration = import("./networkIntegration").NetworkIntegration;
export const NetworkIntegration: typeof import("./networkIntegration").NetworkIntegration = null as any;
utilities.lazyLoad(exports, ["NetworkIntegration"], () => require("./networkIntegration"));
export { NetworkLbArgs, NetworkLbState } from "./networkLb";
export type NetworkLb = import("./networkLb").NetworkLb;
export const NetworkLb: typeof import("./networkLb").NetworkLb = null as any;
utilities.lazyLoad(exports, ["NetworkLb"], () => require("./networkLb"));
export { NetworkLoadBalancerArgs, NetworkLoadBalancerState } from "./networkLoadBalancer";
export type NetworkLoadBalancer = import("./networkLoadBalancer").NetworkLoadBalancer;
export const NetworkLoadBalancer: typeof import("./networkLoadBalancer").NetworkLoadBalancer = null as any;
utilities.lazyLoad(exports, ["NetworkLoadBalancer"], () => require("./networkLoadBalancer"));
export { NetworkPeerArgs, NetworkPeerState } from "./networkPeer";
export type NetworkPeer = import("./networkPeer").NetworkPeer;
export const NetworkPeer: typeof import("./networkPeer").NetworkPeer = null as any;
utilities.lazyLoad(exports, ["NetworkPeer"], () => require("./networkPeer"));
export { NetworkZoneArgs, NetworkZoneState } from "./networkZone";
export type NetworkZone = import("./networkZone").NetworkZone;
export const NetworkZone: typeof import("./networkZone").NetworkZone = null as any;
utilities.lazyLoad(exports, ["NetworkZone"], () => require("./networkZone"));
export { NetworkZoneRecordArgs, NetworkZoneRecordState } from "./networkZoneRecord";
export type NetworkZoneRecord = import("./networkZoneRecord").NetworkZoneRecord;
export const NetworkZoneRecord: typeof import("./networkZoneRecord").NetworkZoneRecord = null as any;
utilities.lazyLoad(exports, ["NetworkZoneRecord"], () => require("./networkZoneRecord"));
export { ProfileArgs, ProfileState } from "./profile";
export type Profile = import("./profile").Profile;
export const Profile: typeof import("./profile").Profile = null as any;
utilities.lazyLoad(exports, ["Profile"], () => require("./profile"));
export { ProjectArgs, ProjectState } from "./project";
export type Project = import("./project").Project;
export const Project: typeof import("./project").Project = null as any;
utilities.lazyLoad(exports, ["Project"], () => require("./project"));
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 { StorageBucketArgs, StorageBucketState } from "./storageBucket";
export type StorageBucket = import("./storageBucket").StorageBucket;
export const StorageBucket: typeof import("./storageBucket").StorageBucket = null as any;
utilities.lazyLoad(exports, ["StorageBucket"], () => require("./storageBucket"));
export { StorageBucketKeyArgs, StorageBucketKeyState } from "./storageBucketKey";
export type StorageBucketKey = import("./storageBucketKey").StorageBucketKey;
export const StorageBucketKey: typeof import("./storageBucketKey").StorageBucketKey = null as any;
utilities.lazyLoad(exports, ["StorageBucketKey"], () => require("./storageBucketKey"));
export { StoragePoolArgs, StoragePoolState } from "./storagePool";
export type StoragePool = import("./storagePool").StoragePool;
export const StoragePool: typeof import("./storagePool").StoragePool = null as any;
utilities.lazyLoad(exports, ["StoragePool"], () => require("./storagePool"));
export { StorageVolumeArgs, StorageVolumeState } from "./storageVolume";
export type StorageVolume = import("./storageVolume").StorageVolume;
export const StorageVolume: typeof import("./storageVolume").StorageVolume = null as any;
utilities.lazyLoad(exports, ["StorageVolume"], () => require("./storageVolume"));
// Export sub-modules:
import * as config from "./config";
import * as types from "./types";
export {
config,
types,
};
const _module = {
version: utilities.getVersion(),
construct: (name: string, type: string, urn: string): pulumi.Resource => {
switch (type) {
case "incus:index/certificate:Certificate":
return new Certificate(name, <any>undefined, { urn })
case "incus:index/clusterGroup:ClusterGroup":
return new ClusterGroup(name, <any>undefined, { urn })
case "incus:index/clusterGroupAssignment:ClusterGroupAssignment":
return new ClusterGroupAssignment(name, <any>undefined, { urn })
case "incus:index/image:Image":
return new Image(name, <any>undefined, { urn })
case "incus:index/instance:Instance":
return new Instance(name, <any>undefined, { urn })
case "incus:index/instanceSnapshot:InstanceSnapshot":
return new InstanceSnapshot(name, <any>undefined, { urn })
case "incus:index/network:Network":
return new Network(name, <any>undefined, { urn })
case "incus:index/networkAcl:NetworkAcl":
return new NetworkAcl(name, <any>undefined, { urn })
case "incus:index/networkForward:NetworkForward":
return new NetworkForward(name, <any>undefined, { urn })
case "incus:index/networkIntegration:NetworkIntegration":
return new NetworkIntegration(name, <any>undefined, { urn })
case "incus:index/networkLb:NetworkLb":
return new NetworkLb(name, <any>undefined, { urn })
case "incus:index/networkLoadBalancer:NetworkLoadBalancer":
return new NetworkLoadBalancer(name, <any>undefined, { urn })
case "incus:index/networkPeer:NetworkPeer":
return new NetworkPeer(name, <any>undefined, { urn })
case "incus:index/networkZone:NetworkZone":
return new NetworkZone(name, <any>undefined, { urn })
case "incus:index/networkZoneRecord:NetworkZoneRecord":
return new NetworkZoneRecord(name, <any>undefined, { urn })
case "incus:index/profile:Profile":
return new Profile(name, <any>undefined, { urn })
case "incus:index/project:Project":
return new Project(name, <any>undefined, { urn })
case "incus:index/storageBucket:StorageBucket":
return new StorageBucket(name, <any>undefined, { urn })
case "incus:index/storageBucketKey:StorageBucketKey":
return new StorageBucketKey(name, <any>undefined, { urn })
case "incus:index/storagePool:StoragePool":
return new StoragePool(name, <any>undefined, { urn })
case "incus:index/storageVolume:StorageVolume":
return new StorageVolume(name, <any>undefined, { urn })
default:
throw new Error(`unknown resource type ${type}`);
}
},
};
pulumi.runtime.registerResourceModule("incus", "index/certificate", _module)
pulumi.runtime.registerResourceModule("incus", "index/clusterGroup", _module)
pulumi.runtime.registerResourceModule("incus", "index/clusterGroupAssignment", _module)
pulumi.runtime.registerResourceModule("incus", "index/image", _module)
pulumi.runtime.registerResourceModule("incus", "index/instance", _module)
pulumi.runtime.registerResourceModule("incus", "index/instanceSnapshot", _module)
pulumi.runtime.registerResourceModule("incus", "index/network", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkAcl", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkForward", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkIntegration", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkLb", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkLoadBalancer", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkPeer", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkZone", _module)
pulumi.runtime.registerResourceModule("incus", "index/networkZoneRecord", _module)
pulumi.runtime.registerResourceModule("incus", "index/profile", _module)
pulumi.runtime.registerResourceModule("incus", "index/project", _module)
pulumi.runtime.registerResourceModule("incus", "index/storageBucket", _module)
pulumi.runtime.registerResourceModule("incus", "index/storageBucketKey", _module)
pulumi.runtime.registerResourceModule("incus", "index/storagePool", _module)
pulumi.runtime.registerResourceModule("incus", "index/storageVolume", _module)
pulumi.runtime.registerResourcePackage("incus", {
version: utilities.getVersion(),
constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => {
if (type !== "pulumi:providers:incus") {
throw new Error(`unknown provider type ${type}`);
}
return new Provider(name, <any>undefined, { urn });
},
});

357
sdk/nodejs/instance.ts generated Normal file
View File

@@ -0,0 +1,357 @@
// *** 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 utilities from "./utilities";
export class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance 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?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance {
return new Instance(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/instance:Instance';
/**
* Returns true if the given object is an instance of Instance. 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 Instance {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Instance.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the instance.
*/
public readonly description!: pulumi.Output<string>;
/**
* *Optional* - Device definition. See reference below.
*/
public readonly devices!: pulumi.Output<outputs.InstanceDevice[] | undefined>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
public readonly ephemeral!: pulumi.Output<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
public readonly files!: pulumi.Output<outputs.InstanceFile[] | undefined>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
public readonly image!: pulumi.Output<string | undefined>;
/**
* The IPv4 Address of the instance. See Instance Network
* Access for more details.
*/
public /*out*/ readonly ipv4Address!: pulumi.Output<string>;
/**
* The IPv6 Address of the instance. See Instance Network
* Access for more details.
*/
public /*out*/ readonly ipv6Address!: pulumi.Output<string>;
/**
* The MAC address of the detected NIC. See Instance Network
* Access for more details.
*/
public /*out*/ readonly macAddress!: pulumi.Output<string>;
/**
* **Required** - Name of the instance.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
public readonly profiles!: pulumi.Output<string[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
public readonly running!: pulumi.Output<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
public readonly sourceFile!: pulumi.Output<string | undefined>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
public readonly sourceInstance!: pulumi.Output<outputs.InstanceSourceInstance | undefined>;
/**
* The status of the instance.
*/
public /*out*/ readonly status!: pulumi.Output<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
public readonly type!: pulumi.Output<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
public readonly waitFors!: pulumi.Output<outputs.InstanceWaitFor[] | undefined>;
/**
* Create a Instance 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?: InstanceArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: InstanceArgs | InstanceState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as InstanceState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["devices"] = state ? state.devices : undefined;
resourceInputs["ephemeral"] = state ? state.ephemeral : undefined;
resourceInputs["files"] = state ? state.files : undefined;
resourceInputs["image"] = state ? state.image : undefined;
resourceInputs["ipv4Address"] = state ? state.ipv4Address : undefined;
resourceInputs["ipv6Address"] = state ? state.ipv6Address : undefined;
resourceInputs["macAddress"] = state ? state.macAddress : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["profiles"] = state ? state.profiles : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["running"] = state ? state.running : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["sourceInstance"] = state ? state.sourceInstance : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["target"] = state ? state.target : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["waitFors"] = state ? state.waitFors : undefined;
} else {
const args = argsOrState as InstanceArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["devices"] = args ? args.devices : undefined;
resourceInputs["ephemeral"] = args ? args.ephemeral : undefined;
resourceInputs["files"] = args ? args.files : undefined;
resourceInputs["image"] = args ? args.image : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["profiles"] = args ? args.profiles : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["running"] = args ? args.running : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["sourceInstance"] = args ? args.sourceInstance : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["waitFors"] = args ? args.waitFors : undefined;
resourceInputs["ipv4Address"] = undefined /*out*/;
resourceInputs["ipv6Address"] = undefined /*out*/;
resourceInputs["macAddress"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Instance resources.
*/
export interface InstanceState {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the instance.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.InstanceDevice>[]>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
ephemeral?: pulumi.Input<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
files?: pulumi.Input<pulumi.Input<inputs.InstanceFile>[]>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
image?: pulumi.Input<string>;
/**
* The IPv4 Address of the instance. See Instance Network
* Access for more details.
*/
ipv4Address?: pulumi.Input<string>;
/**
* The IPv6 Address of the instance. See Instance Network
* Access for more details.
*/
ipv6Address?: pulumi.Input<string>;
/**
* The MAC address of the detected NIC. See Instance Network
* Access for more details.
*/
macAddress?: pulumi.Input<string>;
/**
* **Required** - Name of the instance.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
profiles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
running?: pulumi.Input<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.InstanceSourceInstance>;
/**
* The status of the instance.
*/
status?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
type?: pulumi.Input<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
waitFors?: pulumi.Input<pulumi.Input<inputs.InstanceWaitFor>[]>;
}
/**
* The set of arguments for constructing a Instance resource.
*/
export interface InstanceArgs {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the instance.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.InstanceDevice>[]>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
ephemeral?: pulumi.Input<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
files?: pulumi.Input<pulumi.Input<inputs.InstanceFile>[]>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
image?: pulumi.Input<string>;
/**
* **Required** - Name of the instance.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
profiles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
running?: pulumi.Input<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.InstanceSourceInstance>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
type?: pulumi.Input<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
waitFors?: pulumi.Input<pulumi.Input<inputs.InstanceWaitFor>[]>;
}

183
sdk/nodejs/instanceSnapshot.ts generated Normal file
View File

@@ -0,0 +1,183 @@
// *** 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";
/**
* ## # incus.InstanceSnapshot
*
* Manages a snapshot of an Incus instance.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const instance = new incus.Instance("instance", {
* name: "my-instance",
* image: "ubuntu",
* ephemeral: false,
* });
* const snap1 = new incus.InstanceSnapshot("snap1", {
* name: "my-snapshot-1",
* instance: instance.name,
* });
* ```
*/
export class InstanceSnapshot extends pulumi.CustomResource {
/**
* Get an existing InstanceSnapshot 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?: InstanceSnapshotState, opts?: pulumi.CustomResourceOptions): InstanceSnapshot {
return new InstanceSnapshot(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/instanceSnapshot:InstanceSnapshot';
/**
* Returns true if the given object is an instance of InstanceSnapshot. 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 InstanceSnapshot {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === InstanceSnapshot.__pulumiType;
}
/**
* The time Incus reported the snapshot was successfully created,
* in UTC.
*/
public /*out*/ readonly createdAt!: pulumi.Output<number>;
/**
* **Required** - The name of the instance to snapshot.
*/
public readonly instance!: pulumi.Output<string>;
/**
* **Required** - Name of the snapshot.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
public readonly stateful!: pulumi.Output<boolean>;
/**
* Create a InstanceSnapshot 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: InstanceSnapshotArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: InstanceSnapshotArgs | InstanceSnapshotState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as InstanceSnapshotState | undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["instance"] = state ? state.instance : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["stateful"] = state ? state.stateful : undefined;
} else {
const args = argsOrState as InstanceSnapshotArgs | undefined;
if ((!args || args.instance === undefined) && !opts.urn) {
throw new Error("Missing required property 'instance'");
}
resourceInputs["instance"] = args ? args.instance : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["stateful"] = args ? args.stateful : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceSnapshot.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering InstanceSnapshot resources.
*/
export interface InstanceSnapshotState {
/**
* The time Incus reported the snapshot was successfully created,
* in UTC.
*/
createdAt?: pulumi.Input<number>;
/**
* **Required** - The name of the instance to snapshot.
*/
instance?: pulumi.Input<string>;
/**
* **Required** - Name of the snapshot.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
stateful?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a InstanceSnapshot resource.
*/
export interface InstanceSnapshotArgs {
/**
* **Required** - The name of the instance to snapshot.
*/
instance: pulumi.Input<string>;
/**
* **Required** - Name of the snapshot.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
stateful?: pulumi.Input<boolean>;
}

190
sdk/nodejs/network.ts generated Normal file
View File

@@ -0,0 +1,190 @@
// *** 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 Network extends pulumi.CustomResource {
/**
* Get an existing Network 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?: NetworkState, opts?: pulumi.CustomResourceOptions): Network {
return new Network(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/network:Network';
/**
* Returns true if the given object is an instance of Network. 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 Network {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Network.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network.
*/
public readonly description!: pulumi.Output<string>;
/**
* Whether or not the network is managed.
*/
public /*out*/ readonly managed!: pulumi.Output<boolean>;
/**
* **Required** - Name of the network. This is usually the device the
* network will appear as to instances.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string | undefined>;
/**
* *Optional* - The type of network to create. Can be one of: bridge,
* macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
* is created.
*/
public readonly type!: pulumi.Output<string>;
/**
* Create a Network 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?: NetworkArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkArgs | NetworkState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["managed"] = state ? state.managed : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["target"] = state ? state.target : undefined;
resourceInputs["type"] = state ? state.type : undefined;
} else {
const args = argsOrState as NetworkArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["managed"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Network.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Network resources.
*/
export interface NetworkState {
/**
* *Optional* - Map of key/value pairs of
* [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network.
*/
description?: pulumi.Input<string>;
/**
* Whether or not the network is managed.
*/
managed?: pulumi.Input<boolean>;
/**
* **Required** - Name of the network. This is usually the device the
* network will appear as to instances.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - The type of network to create. Can be one of: bridge,
* macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
* is created.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Network resource.
*/
export interface NetworkArgs {
/**
* *Optional* - Map of key/value pairs of
* [network config settings](https://linuxcontainers.org/incus/docs/main/networks/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network. This is usually the device the
* network will appear as to instances.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - The type of network to create. Can be one of: bridge,
* macvlan, sriov, ovn, or physical. If no type is specified, a bridge network
* is created.
*/
type?: pulumi.Input<string>;
}

179
sdk/nodejs/networkAcl.ts generated Normal file
View File

@@ -0,0 +1,179 @@
// *** 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 utilities from "./utilities";
export class NetworkAcl extends pulumi.CustomResource {
/**
* Get an existing NetworkAcl 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?: NetworkAclState, opts?: pulumi.CustomResourceOptions): NetworkAcl {
return new NetworkAcl(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkAcl:NetworkAcl';
/**
* Returns true if the given object is an instance of NetworkAcl. 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 NetworkAcl {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkAcl.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* network ACL config settings.
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network ACL rule.
*/
public readonly description!: pulumi.Output<string>;
/**
* *Optional* - List of network ACL rules for egress traffic. See reference below.
*/
public readonly egresses!: pulumi.Output<outputs.NetworkAclEgress[]>;
/**
* *Optional* - List of network ACL rules for ingress traffic. See reference below.
*
* The network ACL rule supports:
*/
public readonly ingresses!: pulumi.Output<outputs.NetworkAclIngress[]>;
/**
* **Required** - Name of the network ACL.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network ACL will be created.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a NetworkAcl 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?: NetworkAclArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkAclArgs | NetworkAclState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkAclState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["egresses"] = state ? state.egresses : undefined;
resourceInputs["ingresses"] = state ? state.ingresses : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as NetworkAclArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["egresses"] = args ? args.egresses : undefined;
resourceInputs["ingresses"] = args ? args.ingresses : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkAcl.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkAcl resources.
*/
export interface NetworkAclState {
/**
* *Optional* - Map of key/value pairs of
* network ACL config settings.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network ACL rule.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - List of network ACL rules for egress traffic. See reference below.
*/
egresses?: pulumi.Input<pulumi.Input<inputs.NetworkAclEgress>[]>;
/**
* *Optional* - List of network ACL rules for ingress traffic. See reference below.
*
* The network ACL rule supports:
*/
ingresses?: pulumi.Input<pulumi.Input<inputs.NetworkAclIngress>[]>;
/**
* **Required** - Name of the network ACL.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network ACL will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkAcl resource.
*/
export interface NetworkAclArgs {
/**
* *Optional* - Map of key/value pairs of
* network ACL config settings.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network ACL rule.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - List of network ACL rules for egress traffic. See reference below.
*/
egresses?: pulumi.Input<pulumi.Input<inputs.NetworkAclEgress>[]>;
/**
* *Optional* - List of network ACL rules for ingress traffic. See reference below.
*
* The network ACL rule supports:
*/
ingresses?: pulumi.Input<pulumi.Input<inputs.NetworkAclIngress>[]>;
/**
* **Required** - Name of the network ACL.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network ACL will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

185
sdk/nodejs/networkForward.ts generated Normal file
View File

@@ -0,0 +1,185 @@
// *** 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 utilities from "./utilities";
export class NetworkForward extends pulumi.CustomResource {
/**
* Get an existing NetworkForward 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?: NetworkForwardState, opts?: pulumi.CustomResourceOptions): NetworkForward {
return new NetworkForward(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkForward:NetworkForward';
/**
* Returns true if the given object is an instance of NetworkForward. 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 NetworkForward {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkForward.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* network forward config settings.
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of port(s)
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - IP address to listen on.
*/
public readonly listenAddress!: pulumi.Output<string>;
/**
* **Required** - Name of the network.
*/
public readonly network!: pulumi.Output<string>;
/**
* *Optional* - List of port specifications. See reference below.
*
* The network forward port supports:
*/
public readonly ports!: pulumi.Output<outputs.NetworkForwardPort[]>;
/**
* *Optional* - Name of the project where the network forward will be created.
*/
public readonly project!: pulumi.Output<string | undefined>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a NetworkForward 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: NetworkForwardArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkForwardArgs | NetworkForwardState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkForwardState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["listenAddress"] = state ? state.listenAddress : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["ports"] = state ? state.ports : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as NetworkForwardArgs | undefined;
if ((!args || args.listenAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'listenAddress'");
}
if ((!args || args.network === undefined) && !opts.urn) {
throw new Error("Missing required property 'network'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["listenAddress"] = args ? args.listenAddress : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["ports"] = args ? args.ports : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkForward.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkForward resources.
*/
export interface NetworkForwardState {
/**
* *Optional* - Map of key/value pairs of
* network forward config settings.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of port(s)
*/
description?: pulumi.Input<string>;
/**
* **Required** - IP address to listen on.
*/
listenAddress?: pulumi.Input<string>;
/**
* **Required** - Name of the network.
*/
network?: pulumi.Input<string>;
/**
* *Optional* - List of port specifications. See reference below.
*
* The network forward port supports:
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkForwardPort>[]>;
/**
* *Optional* - Name of the project where the network forward will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkForward resource.
*/
export interface NetworkForwardArgs {
/**
* *Optional* - Map of key/value pairs of
* network forward config settings.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of port(s)
*/
description?: pulumi.Input<string>;
/**
* **Required** - IP address to listen on.
*/
listenAddress: pulumi.Input<string>;
/**
* **Required** - Name of the network.
*/
network: pulumi.Input<string>;
/**
* *Optional* - List of port specifications. See reference below.
*
* The network forward port supports:
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkForwardPort>[]>;
/**
* *Optional* - Name of the project where the network forward will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

208
sdk/nodejs/networkIntegration.ts generated Normal file
View File

@@ -0,0 +1,208 @@
// *** 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";
/**
* ## # incus.NetworkIntegration
*
* Manage integrations between the local Incus deployment and remote networks hosted on Incus or other platforms. Currently available only for [OVN networks](https://linuxcontainers.org/incus/docs/main/reference/network_ovn/#network-ovn).
*
* ## Basic Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const _this = new incus.NetworkIntegration("this", {
* name: "ovn-region",
* type: "ovn",
* config: {
* "ovn.northbound_connection": "tcp:[192.0.2.12]:6645,tcp:[192.0.3.13]:6645,tcp:[192.0.3.14]:6645",
* "ovn.southbound_connection": "tcp:[192.0.2.12]:6646,tcp:[192.0.3.13]:6646,tcp:[192.0.3.14]:6646",
* },
* });
* ```
*
* ## Peer Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const _default = new incus.Network("default", {
* name: "default",
* type: "ovn",
* config: {
* "ipv4.address": "192.168.2.0/24",
* "ipv4.nat": "true",
* },
* });
* const _this = new incus.NetworkIntegration("this", {
* name: "ovn-region",
* type: "ovn",
* config: {
* "ovn.northbound_connection": "tcp:[192.0.2.12]:6645,tcp:[192.0.3.13]:6645,tcp:[192.0.3.14]:6645",
* "ovn.southbound_connection": "tcp:[192.0.2.12]:6646,tcp:[192.0.3.13]:6646,tcp:[192.0.3.14]:6646",
* },
* });
* const thisNetworkPeer = new incus.NetworkPeer("this", {
* name: "ovn-peer",
* network: _default.name,
* targetIntegration: _this.name,
* type: "remote",
* });
* ```
*/
export class NetworkIntegration extends pulumi.CustomResource {
/**
* Get an existing NetworkIntegration 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?: NetworkIntegrationState, opts?: pulumi.CustomResourceOptions): NetworkIntegration {
return new NetworkIntegration(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkIntegration:NetworkIntegration';
/**
* Returns true if the given object is an instance of NetworkIntegration. 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 NetworkIntegration {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkIntegration.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of [network integration config settings](https://linuxcontainers.org/incus/docs/main/howto/network_integrations/)
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network integration.
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Name of the network integration.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* **Required** - The type of the network integration. Currently, only supports `ovn` type.
*/
public readonly type!: pulumi.Output<string>;
/**
* Create a NetworkIntegration 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: NetworkIntegrationArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkIntegrationArgs | NetworkIntegrationState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkIntegrationState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["type"] = state ? state.type : undefined;
} else {
const args = argsOrState as NetworkIntegrationArgs | undefined;
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkIntegration.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkIntegration resources.
*/
export interface NetworkIntegrationState {
/**
* *Optional* - Map of key/value pairs of [network integration config settings](https://linuxcontainers.org/incus/docs/main/howto/network_integrations/)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network integration.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network integration.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* **Required** - The type of the network integration. Currently, only supports `ovn` type.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkIntegration resource.
*/
export interface NetworkIntegrationArgs {
/**
* *Optional* - Map of key/value pairs of [network integration config settings](https://linuxcontainers.org/incus/docs/main/howto/network_integrations/)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network integration.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network integration.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* **Required** - The type of the network integration. Currently, only supports `ovn` type.
*/
type: pulumi.Input<string>;
}

140
sdk/nodejs/networkLb.ts generated Normal file
View File

@@ -0,0 +1,140 @@
// *** 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 utilities from "./utilities";
/**
* @deprecated incus.index/networklb.NetworkLb has been deprecated in favor of incus.index/networkloadbalancer.NetworkLoadBalancer
*/
export class NetworkLb extends pulumi.CustomResource {
/**
* Get an existing NetworkLb 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?: NetworkLbState, opts?: pulumi.CustomResourceOptions): NetworkLb {
pulumi.log.warn("NetworkLb is deprecated: incus.index/networklb.NetworkLb has been deprecated in favor of incus.index/networkloadbalancer.NetworkLoadBalancer")
return new NetworkLb(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkLb:NetworkLb';
/**
* Returns true if the given object is an instance of NetworkLb. 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 NetworkLb {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkLb.__pulumiType;
}
/**
* Network load balancer backend
*/
public readonly backends!: pulumi.Output<outputs.NetworkLbBackend[] | undefined>;
public readonly config!: pulumi.Output<{[key: string]: string}>;
public readonly description!: pulumi.Output<string>;
public readonly listenAddress!: pulumi.Output<string>;
public readonly network!: pulumi.Output<string>;
/**
* Network load balancer port
*/
public readonly ports!: pulumi.Output<outputs.NetworkLbPort[] | undefined>;
public readonly project!: pulumi.Output<string | undefined>;
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a NetworkLb 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.
*/
/** @deprecated incus.index/networklb.NetworkLb has been deprecated in favor of incus.index/networkloadbalancer.NetworkLoadBalancer */
constructor(name: string, args: NetworkLbArgs, opts?: pulumi.CustomResourceOptions)
/** @deprecated incus.index/networklb.NetworkLb has been deprecated in favor of incus.index/networkloadbalancer.NetworkLoadBalancer */
constructor(name: string, argsOrState?: NetworkLbArgs | NetworkLbState, opts?: pulumi.CustomResourceOptions) {
pulumi.log.warn("NetworkLb is deprecated: incus.index/networklb.NetworkLb has been deprecated in favor of incus.index/networkloadbalancer.NetworkLoadBalancer")
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkLbState | undefined;
resourceInputs["backends"] = state ? state.backends : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["listenAddress"] = state ? state.listenAddress : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["ports"] = state ? state.ports : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as NetworkLbArgs | undefined;
if ((!args || args.listenAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'listenAddress'");
}
if ((!args || args.network === undefined) && !opts.urn) {
throw new Error("Missing required property 'network'");
}
resourceInputs["backends"] = args ? args.backends : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["listenAddress"] = args ? args.listenAddress : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["ports"] = args ? args.ports : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkLb.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkLb resources.
*/
export interface NetworkLbState {
/**
* Network load balancer backend
*/
backends?: pulumi.Input<pulumi.Input<inputs.NetworkLbBackend>[]>;
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
listenAddress?: pulumi.Input<string>;
network?: pulumi.Input<string>;
/**
* Network load balancer port
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkLbPort>[]>;
project?: pulumi.Input<string>;
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkLb resource.
*/
export interface NetworkLbArgs {
/**
* Network load balancer backend
*/
backends?: pulumi.Input<pulumi.Input<inputs.NetworkLbBackend>[]>;
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
listenAddress: pulumi.Input<string>;
network: pulumi.Input<string>;
/**
* Network load balancer port
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkLbPort>[]>;
project?: pulumi.Input<string>;
remote?: pulumi.Input<string>;
}

135
sdk/nodejs/networkLoadBalancer.ts generated Normal file
View File

@@ -0,0 +1,135 @@
// *** 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 utilities from "./utilities";
export class NetworkLoadBalancer extends pulumi.CustomResource {
/**
* Get an existing NetworkLoadBalancer 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?: NetworkLoadBalancerState, opts?: pulumi.CustomResourceOptions): NetworkLoadBalancer {
return new NetworkLoadBalancer(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkLoadBalancer:NetworkLoadBalancer';
/**
* Returns true if the given object is an instance of NetworkLoadBalancer. 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 NetworkLoadBalancer {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkLoadBalancer.__pulumiType;
}
/**
* Network load balancer backend
*/
public readonly backends!: pulumi.Output<outputs.NetworkLoadBalancerBackend[] | undefined>;
public readonly config!: pulumi.Output<{[key: string]: string}>;
public readonly description!: pulumi.Output<string>;
public readonly listenAddress!: pulumi.Output<string>;
public readonly network!: pulumi.Output<string>;
/**
* Network load balancer port
*/
public readonly ports!: pulumi.Output<outputs.NetworkLoadBalancerPort[] | undefined>;
public readonly project!: pulumi.Output<string | undefined>;
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a NetworkLoadBalancer 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: NetworkLoadBalancerArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkLoadBalancerArgs | NetworkLoadBalancerState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkLoadBalancerState | undefined;
resourceInputs["backends"] = state ? state.backends : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["listenAddress"] = state ? state.listenAddress : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["ports"] = state ? state.ports : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as NetworkLoadBalancerArgs | undefined;
if ((!args || args.listenAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'listenAddress'");
}
if ((!args || args.network === undefined) && !opts.urn) {
throw new Error("Missing required property 'network'");
}
resourceInputs["backends"] = args ? args.backends : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["listenAddress"] = args ? args.listenAddress : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["ports"] = args ? args.ports : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "incus:index/networkLb:NetworkLb" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(NetworkLoadBalancer.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkLoadBalancer resources.
*/
export interface NetworkLoadBalancerState {
/**
* Network load balancer backend
*/
backends?: pulumi.Input<pulumi.Input<inputs.NetworkLoadBalancerBackend>[]>;
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
listenAddress?: pulumi.Input<string>;
network?: pulumi.Input<string>;
/**
* Network load balancer port
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkLoadBalancerPort>[]>;
project?: pulumi.Input<string>;
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkLoadBalancer resource.
*/
export interface NetworkLoadBalancerArgs {
/**
* Network load balancer backend
*/
backends?: pulumi.Input<pulumi.Input<inputs.NetworkLoadBalancerBackend>[]>;
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
description?: pulumi.Input<string>;
listenAddress: pulumi.Input<string>;
network: pulumi.Input<string>;
/**
* Network load balancer port
*/
ports?: pulumi.Input<pulumi.Input<inputs.NetworkLoadBalancerPort>[]>;
project?: pulumi.Input<string>;
remote?: pulumi.Input<string>;
}

251
sdk/nodejs/networkPeer.ts generated Normal file
View File

@@ -0,0 +1,251 @@
// *** 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";
/**
* ## # incus.NetworkPeer
*
* Incus allows creating peer routing relationships between two OVN networks. Using this method, traffic between the two
* networks can go directly from one OVN network to the other and thus stays within the OVN subsystem, rather than transiting
* through the uplink network.
*
* > The peer resource is exclusively compatible with OVN (Open Virtual Network).
*
* For more information, please refer to [How to create peer routing relationships](https://linuxcontainers.org/incus/docs/main/howto/network_ovn_peers/)
* in the official Incus documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const lan0 = new incus.Network("lan0", {
* name: "lan0",
* type: "ovn",
* config: {},
* });
* const lan1 = new incus.Network("lan1", {
* name: "lan1",
* type: "ovn",
* config: {},
* });
* const lan0Lan1 = new incus.NetworkPeer("lan0_lan1", {
* name: "lab0-lan1",
* description: "A meaningful description",
* network: lan0.name,
* project: "default",
* targetNetwork: lan1.name,
* targetProject: "default",
* });
* const lan1Lan0 = new incus.NetworkPeer("lan1_lan0", {
* name: "lab1-lan0",
* description: "A meaningful description",
* network: lan1.name,
* project: "default",
* targetNetwork: lan0.name,
* targetProject: "default",
* });
* ```
*/
export class NetworkPeer extends pulumi.CustomResource {
/**
* Get an existing NetworkPeer 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?: NetworkPeerState, opts?: pulumi.CustomResourceOptions): NetworkPeer {
return new NetworkPeer(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkPeer:NetworkPeer';
/**
* Returns true if the given object is an instance of NetworkPeer. 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 NetworkPeer {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkPeer.__pulumiType;
}
/**
* *Optional* - Configuration options as key/value pairs (only user.* custom keys supported)
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network peering
*/
public readonly description!: pulumi.Output<string>;
/**
* **required** - Name of the network peering on the local network
*/
public readonly name!: pulumi.Output<string>;
/**
* **Required** - Name of the local network.
*/
public readonly network!: pulumi.Output<string | undefined>;
/**
* *Optional* - Name of the project where the network is located.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
public /*out*/ readonly status!: pulumi.Output<string>;
public readonly targetIntegration!: pulumi.Output<string>;
/**
* **required** - Which network to create a peering with (required at create time for local peers)
*/
public readonly targetNetwork!: pulumi.Output<string>;
/**
* *Optional* - Which project the target network exists in (required at create time for local peers)
*/
public readonly targetProject!: pulumi.Output<string>;
/**
* *Optional* - Type of network peering
*/
public readonly type!: pulumi.Output<string>;
/**
* Create a NetworkPeer 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?: NetworkPeerArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkPeerArgs | NetworkPeerState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkPeerState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["targetIntegration"] = state ? state.targetIntegration : undefined;
resourceInputs["targetNetwork"] = state ? state.targetNetwork : undefined;
resourceInputs["targetProject"] = state ? state.targetProject : undefined;
resourceInputs["type"] = state ? state.type : undefined;
} else {
const args = argsOrState as NetworkPeerArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["targetIntegration"] = args ? args.targetIntegration : undefined;
resourceInputs["targetNetwork"] = args ? args.targetNetwork : undefined;
resourceInputs["targetProject"] = args ? args.targetProject : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkPeer.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkPeer resources.
*/
export interface NetworkPeerState {
/**
* *Optional* - Configuration options as key/value pairs (only user.* custom keys supported)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network peering
*/
description?: pulumi.Input<string>;
/**
* **required** - Name of the network peering on the local network
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of the local network.
*/
network?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network is located.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
status?: pulumi.Input<string>;
targetIntegration?: pulumi.Input<string>;
/**
* **required** - Which network to create a peering with (required at create time for local peers)
*/
targetNetwork?: pulumi.Input<string>;
/**
* *Optional* - Which project the target network exists in (required at create time for local peers)
*/
targetProject?: pulumi.Input<string>;
/**
* *Optional* - Type of network peering
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkPeer resource.
*/
export interface NetworkPeerArgs {
/**
* *Optional* - Configuration options as key/value pairs (only user.* custom keys supported)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network peering
*/
description?: pulumi.Input<string>;
/**
* **required** - Name of the network peering on the local network
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of the local network.
*/
network?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network is located.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
targetIntegration?: pulumi.Input<string>;
/**
* **required** - Which network to create a peering with (required at create time for local peers)
*/
targetNetwork?: pulumi.Input<string>;
/**
* *Optional* - Which project the target network exists in (required at create time for local peers)
*/
targetProject?: pulumi.Input<string>;
/**
* *Optional* - Type of network peering
*/
type?: pulumi.Input<string>;
}

143
sdk/nodejs/networkZone.ts generated Normal file
View File

@@ -0,0 +1,143 @@
// *** 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 NetworkZone extends pulumi.CustomResource {
/**
* Get an existing NetworkZone 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?: NetworkZoneState, opts?: pulumi.CustomResourceOptions): NetworkZone {
return new NetworkZone(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkZone:NetworkZone';
/**
* Returns true if the given object is an instance of NetworkZone. 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 NetworkZone {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkZone.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network zone.
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Name of the network zone.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network zone will be created.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a NetworkZone 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?: NetworkZoneArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkZoneArgs | NetworkZoneState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkZoneState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as NetworkZoneArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkZone.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkZone resources.
*/
export interface NetworkZoneState {
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network zone.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network zone.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network zone will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkZone resource.
*/
export interface NetworkZoneArgs {
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network zone.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network zone.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network zone will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

176
sdk/nodejs/networkZoneRecord.ts generated Normal file
View File

@@ -0,0 +1,176 @@
// *** 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 utilities from "./utilities";
export class NetworkZoneRecord extends pulumi.CustomResource {
/**
* Get an existing NetworkZoneRecord 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?: NetworkZoneRecordState, opts?: pulumi.CustomResourceOptions): NetworkZoneRecord {
return new NetworkZoneRecord(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkZoneRecord:NetworkZoneRecord';
/**
* Returns true if the given object is an instance of NetworkZoneRecord. 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 NetworkZoneRecord {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkZoneRecord.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network zone.
*/
public readonly description!: pulumi.Output<string>;
/**
* *Optional* - Entry in network zone record - see below.
*/
public readonly entries!: pulumi.Output<outputs.NetworkZoneRecordEntry[] | undefined>;
/**
* **Required** - Name of the network zone record.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network zone record will be created.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* **Required** - Name of the zone to add the entries of this record.
*/
public readonly zone!: pulumi.Output<string>;
/**
* Create a NetworkZoneRecord 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: NetworkZoneRecordArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkZoneRecordArgs | NetworkZoneRecordState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkZoneRecordState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["entries"] = state ? state.entries : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
} else {
const args = argsOrState as NetworkZoneRecordArgs | undefined;
if ((!args || args.zone === undefined) && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["entries"] = args ? args.entries : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkZoneRecord.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkZoneRecord resources.
*/
export interface NetworkZoneRecordState {
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network zone.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Entry in network zone record - see below.
*/
entries?: pulumi.Input<pulumi.Input<inputs.NetworkZoneRecordEntry>[]>;
/**
* **Required** - Name of the network zone record.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network zone record will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* **Required** - Name of the zone to add the entries of this record.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a NetworkZoneRecord resource.
*/
export interface NetworkZoneRecordArgs {
/**
* *Optional* - Map of key/value pairs of
* [network zoneConfig settings](https://linuxcontainers.org/incus/docs/main/howto/network_zones/#configuration-options).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network zone.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Entry in network zone record - see below.
*/
entries?: pulumi.Input<pulumi.Input<inputs.NetworkZoneRecordEntry>[]>;
/**
* **Required** - Name of the network zone record.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network zone record will be created.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* **Required** - Name of the zone to add the entries of this record.
*/
zone: pulumi.Input<string>;
}

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

@@ -0,0 +1,29 @@
{
"name": "@kiterun/incus",
"version": "1.0.0-alpha.0+dev",
"description": "A Pulumi package for creating and managing incus cloud resources.",
"keywords": [
"incus",
"category/cloud",
"containers",
"nimbus"
],
"homepage": "https://linuxcontainers.org",
"repository": "https://git.kalinow.ski/nimbus/pulumi-incus",
"license": "Apache-2.0",
"scripts": {
"build": "tsc"
},
"dependencies": {
"@pulumi/pulumi": "^3.142.0"
},
"devDependencies": {
"@types/node": "^18",
"typescript": "^5.8.3"
},
"pulumi": {
"resource": true,
"name": "incus",
"version": "1.0.0-alpha.0+dev"
}
}

159
sdk/nodejs/profile.ts generated Normal file
View File

@@ -0,0 +1,159 @@
// *** 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 utilities from "./utilities";
export class Profile extends pulumi.CustomResource {
/**
* Get an existing Profile 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?: ProfileState, opts?: pulumi.CustomResourceOptions): Profile {
return new Profile(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/profile:Profile';
/**
* Returns true if the given object is an instance of Profile. 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 Profile {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Profile.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the profile.
*/
public readonly description!: pulumi.Output<string>;
/**
* *Optional* - Device definition. See reference below.
*/
public readonly devices!: pulumi.Output<outputs.ProfileDevice[] | undefined>;
/**
* **Required** - Name of the profile.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the profile will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a Profile 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?: ProfileArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ProfileArgs | ProfileState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ProfileState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["devices"] = state ? state.devices : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as ProfileArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["devices"] = args ? args.devices : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Profile.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Profile resources.
*/
export interface ProfileState {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the profile.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.ProfileDevice>[]>;
/**
* **Required** - Name of the profile.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the profile will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Profile resource.
*/
export interface ProfileArgs {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the profile.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.ProfileDevice>[]>;
/**
* **Required** - Name of the profile.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the profile will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

126
sdk/nodejs/project.ts generated Normal file
View File

@@ -0,0 +1,126 @@
// *** 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 Project extends pulumi.CustomResource {
/**
* Get an existing Project 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?: ProjectState, opts?: pulumi.CustomResourceOptions): Project {
return new Project(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/project:Project';
/**
* Returns true if the given object is an instance of Project. 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 Project {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Project.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of [project config settings](https://linuxcontainers.org/incus/docs/main/reference/projects/).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the project.
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Name of the project.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* Create a Project 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?: ProjectArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ProjectArgs | ProjectState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ProjectState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
} else {
const args = argsOrState as ProjectArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Project.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Project resources.
*/
export interface ProjectState {
/**
* *Optional* - Map of key/value pairs of [project config settings](https://linuxcontainers.org/incus/docs/main/reference/projects/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the project.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the project.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Project resource.
*/
export interface ProjectArgs {
/**
* *Optional* - Map of key/value pairs of [project config settings](https://linuxcontainers.org/incus/docs/main/reference/projects/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the project.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the project.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}

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

@@ -0,0 +1,87 @@
// *** 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 utilities from "./utilities";
/**
* The provider type for the incus 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 = 'incus';
/**
* 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;
}
/**
* The directory to look for existing Incus configuration. (default = $HOME/.config/incus)
*/
public readonly configDir!: pulumi.Output<string | undefined>;
/**
* The project where project-scoped resources will be created. Can be overridden in individual resources. (default =
* default)
*/
public readonly project!: pulumi.Output<string | undefined>;
/**
* 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["acceptRemoteCertificate"] = pulumi.output(args ? args.acceptRemoteCertificate : undefined).apply(JSON.stringify);
resourceInputs["configDir"] = args ? args.configDir : undefined;
resourceInputs["generateClientCertificates"] = pulumi.output(args ? args.generateClientCertificates : undefined).apply(JSON.stringify);
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remotes"] = pulumi.output(args ? args.remotes : undefined).apply(JSON.stringify);
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Provider.__pulumiType, name, resourceInputs, opts);
}
}
/**
* The set of arguments for constructing a Provider resource.
*/
export interface ProviderArgs {
/**
* Accept the server certificate.
*/
acceptRemoteCertificate?: pulumi.Input<boolean>;
/**
* The directory to look for existing Incus configuration. (default = $HOME/.config/incus)
*/
configDir?: pulumi.Input<string>;
/**
* Automatically generate the Incus client certificates if they don't exist.
*/
generateClientCertificates?: pulumi.Input<boolean>;
/**
* The project where project-scoped resources will be created. Can be overridden in individual resources. (default =
* default)
*/
project?: pulumi.Input<string>;
/**
* Incus Remote
*/
remotes?: pulumi.Input<pulumi.Input<inputs.ProviderRemote>[]>;
}

201
sdk/nodejs/storageBucket.ts generated Normal file
View File

@@ -0,0 +1,201 @@
// *** 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 StorageBucket extends pulumi.CustomResource {
/**
* Get an existing StorageBucket 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?: StorageBucketState, opts?: pulumi.CustomResourceOptions): StorageBucket {
return new StorageBucket(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/storageBucket:StorageBucket';
/**
* Returns true if the given object is an instance of StorageBucket. 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 StorageBucket {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === StorageBucket.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [storage bucket config settings](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#configure-storage-bucket-settings).
* Config settings vary depending on the Storage Pool used.
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the storage bucket.
*/
public readonly description!: pulumi.Output<string>;
/**
* Name of the node where storage bucket was created. It could be useful with Incus in cluster mode.
*/
public /*out*/ readonly location!: pulumi.Output<string>;
/**
* **Required** - Name of the storage bucket.
*/
public readonly name!: pulumi.Output<string>;
/**
* **Required** - Name of storage pool to host the storage bucket.
*/
public readonly pool!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the storage bucket will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Path to a backup file from which the bucket will be created.
*/
public readonly sourceFile!: pulumi.Output<string | undefined>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string>;
/**
* Create a StorageBucket 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: StorageBucketArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: StorageBucketArgs | StorageBucketState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as StorageBucketState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pool"] = state ? state.pool : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["target"] = state ? state.target : undefined;
} else {
const args = argsOrState as StorageBucketArgs | undefined;
if ((!args || args.pool === undefined) && !opts.urn) {
throw new Error("Missing required property 'pool'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pool"] = args ? args.pool : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["location"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StorageBucket.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering StorageBucket resources.
*/
export interface StorageBucketState {
/**
* *Optional* - Map of key/value pairs of
* [storage bucket config settings](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#configure-storage-bucket-settings).
* Config settings vary depending on the Storage Pool used.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the storage bucket.
*/
description?: pulumi.Input<string>;
/**
* Name of the node where storage bucket was created. It could be useful with Incus in cluster mode.
*/
location?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the storage bucket.
*/
pool?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage bucket will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Path to a backup file from which the bucket will be created.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a StorageBucket resource.
*/
export interface StorageBucketArgs {
/**
* *Optional* - Map of key/value pairs of
* [storage bucket config settings](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#configure-storage-bucket-settings).
* Config settings vary depending on the Storage Pool used.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the storage bucket.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the storage bucket.
*/
pool: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage bucket will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Path to a backup file from which the bucket will be created.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
}

199
sdk/nodejs/storageBucketKey.ts generated Normal file
View File

@@ -0,0 +1,199 @@
// *** 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 StorageBucketKey extends pulumi.CustomResource {
/**
* Get an existing StorageBucketKey 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?: StorageBucketKeyState, opts?: pulumi.CustomResourceOptions): StorageBucketKey {
return new StorageBucketKey(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/storageBucketKey:StorageBucketKey';
/**
* Returns true if the given object is an instance of StorageBucketKey. 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 StorageBucketKey {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === StorageBucketKey.__pulumiType;
}
/**
* Access key of the storage bucket key.
*/
public /*out*/ readonly accessKey!: pulumi.Output<string>;
/**
* *Optional* - Description of the storage bucket key.
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Name of the storage bucket key.
*/
public readonly name!: pulumi.Output<string>;
/**
* **Required** - Name of storage pool to host the storage bucket key.
*/
public readonly pool!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the storage bucket key will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Name of the role that controls the access rights for the
* key. If not specified, the default role is used, as described in the [official documentation](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#manage-storage-bucket-keys).
*/
public readonly role!: pulumi.Output<string>;
/**
* Secret key of the storage bucket key.
*/
public /*out*/ readonly secretKey!: pulumi.Output<string>;
/**
* **Required** - Name of the storage bucket.
*/
public readonly storageBucket!: pulumi.Output<string>;
/**
* Create a StorageBucketKey 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: StorageBucketKeyArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: StorageBucketKeyArgs | StorageBucketKeyState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as StorageBucketKeyState | undefined;
resourceInputs["accessKey"] = state ? state.accessKey : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pool"] = state ? state.pool : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["secretKey"] = state ? state.secretKey : undefined;
resourceInputs["storageBucket"] = state ? state.storageBucket : undefined;
} else {
const args = argsOrState as StorageBucketKeyArgs | undefined;
if ((!args || args.pool === undefined) && !opts.urn) {
throw new Error("Missing required property 'pool'");
}
if ((!args || args.storageBucket === undefined) && !opts.urn) {
throw new Error("Missing required property 'storageBucket'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pool"] = args ? args.pool : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["storageBucket"] = args ? args.storageBucket : undefined;
resourceInputs["accessKey"] = undefined /*out*/;
resourceInputs["secretKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["accessKey", "secretKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(StorageBucketKey.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering StorageBucketKey resources.
*/
export interface StorageBucketKeyState {
/**
* Access key of the storage bucket key.
*/
accessKey?: pulumi.Input<string>;
/**
* *Optional* - Description of the storage bucket key.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket key.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the storage bucket key.
*/
pool?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage bucket key will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Name of the role that controls the access rights for the
* key. If not specified, the default role is used, as described in the [official documentation](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#manage-storage-bucket-keys).
*/
role?: pulumi.Input<string>;
/**
* Secret key of the storage bucket key.
*/
secretKey?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket.
*/
storageBucket?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a StorageBucketKey resource.
*/
export interface StorageBucketKeyArgs {
/**
* *Optional* - Description of the storage bucket key.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket key.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the storage bucket key.
*/
pool: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage bucket key will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Name of the role that controls the access rights for the
* key. If not specified, the default role is used, as described in the [official documentation](https://linuxcontainers.org/incus/docs/main/howto/storage_buckets/#manage-storage-bucket-keys).
*/
role?: pulumi.Input<string>;
/**
* **Required** - Name of the storage bucket.
*/
storageBucket: pulumi.Input<string>;
}

177
sdk/nodejs/storagePool.ts generated Normal file
View File

@@ -0,0 +1,177 @@
// *** 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 StoragePool extends pulumi.CustomResource {
/**
* Get an existing StoragePool 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?: StoragePoolState, opts?: pulumi.CustomResourceOptions): StoragePool {
return new StoragePool(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/storagePool:StoragePool';
/**
* Returns true if the given object is an instance of StoragePool. 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 StoragePool {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === StoragePool.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [storage pool config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary from driver to driver.
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the storage pool.
*/
public readonly description!: pulumi.Output<string>;
/**
* **Required** - Storage Pool driver. Must be one of `dir`, `zfs`, `lvm`, `btrfs`, `ceph`, `cephfs`, or `cephobject`.
*/
public readonly driver!: pulumi.Output<string>;
/**
* **Required** - Name of the storage pool.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the storage pool will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string | undefined>;
/**
* Create a StoragePool 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: StoragePoolArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: StoragePoolArgs | StoragePoolState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as StoragePoolState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["driver"] = state ? state.driver : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["target"] = state ? state.target : undefined;
} else {
const args = argsOrState as StoragePoolArgs | undefined;
if ((!args || args.driver === undefined) && !opts.urn) {
throw new Error("Missing required property 'driver'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["driver"] = args ? args.driver : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["target"] = args ? args.target : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StoragePool.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering StoragePool resources.
*/
export interface StoragePoolState {
/**
* *Optional* - Map of key/value pairs of
* [storage pool config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary from driver to driver.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the storage pool.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Storage Pool driver. Must be one of `dir`, `zfs`, `lvm`, `btrfs`, `ceph`, `cephfs`, or `cephobject`.
*/
driver?: pulumi.Input<string>;
/**
* **Required** - Name of the storage pool.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage pool will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a StoragePool resource.
*/
export interface StoragePoolArgs {
/**
* *Optional* - Map of key/value pairs of
* [storage pool config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary from driver to driver.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the storage pool.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Storage Pool driver. Must be one of `dir`, `zfs`, `lvm`, `btrfs`, `ceph`, `cephfs`, or `cephobject`.
*/
driver: pulumi.Input<string>;
/**
* **Required** - Name of the storage pool.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the storage pool will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
}

248
sdk/nodejs/storageVolume.ts generated Normal file
View File

@@ -0,0 +1,248 @@
// *** 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 utilities from "./utilities";
export class StorageVolume extends pulumi.CustomResource {
/**
* Get an existing StorageVolume 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?: StorageVolumeState, opts?: pulumi.CustomResourceOptions): StorageVolume {
return new StorageVolume(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/storageVolume:StorageVolume';
/**
* Returns true if the given object is an instance of StorageVolume. 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 StorageVolume {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === StorageVolume.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary depending on the Storage Pool used.
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Volume content type (`filesystem` or `block`)
*/
public readonly contentType!: pulumi.Output<string>;
/**
* *Optional* - Description of the volume.
*/
public readonly description!: pulumi.Output<string>;
/**
* Name of the node where volume was created. It could be useful with Incus in cluster mode.
*/
public /*out*/ readonly location!: pulumi.Output<string>;
/**
* **Required** - Name of the storage volume.
*/
public readonly name!: pulumi.Output<string>;
/**
* **Required** - Name of storage pool to host the volume.
*/
public readonly pool!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the volume will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Path to a backup file from which the volume will be created.
*/
public readonly sourceFile!: pulumi.Output<string | undefined>;
/**
* *Optional* - The source volume from which the volume will be created. See reference below.
*/
public readonly sourceVolume!: pulumi.Output<outputs.StorageVolumeSourceVolume | undefined>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string>;
/**
* *Optional* - The "type" of volume. The default value is `custom`,
* which is the type to use for storage volumes attached to instances.
*/
public readonly type!: pulumi.Output<string>;
/**
* Create a StorageVolume 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: StorageVolumeArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: StorageVolumeArgs | StorageVolumeState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as StorageVolumeState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["contentType"] = state ? state.contentType : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pool"] = state ? state.pool : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["sourceVolume"] = state ? state.sourceVolume : undefined;
resourceInputs["target"] = state ? state.target : undefined;
resourceInputs["type"] = state ? state.type : undefined;
} else {
const args = argsOrState as StorageVolumeArgs | undefined;
if ((!args || args.pool === undefined) && !opts.urn) {
throw new Error("Missing required property 'pool'");
}
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["contentType"] = args ? args.contentType : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pool"] = args ? args.pool : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["sourceVolume"] = args ? args.sourceVolume : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["location"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StorageVolume.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering StorageVolume resources.
*/
export interface StorageVolumeState {
/**
* *Optional* - Map of key/value pairs of
* [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary depending on the Storage Pool used.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Volume content type (`filesystem` or `block`)
*/
contentType?: pulumi.Input<string>;
/**
* *Optional* - Description of the volume.
*/
description?: pulumi.Input<string>;
/**
* Name of the node where volume was created. It could be useful with Incus in cluster mode.
*/
location?: pulumi.Input<string>;
/**
* **Required** - Name of the storage volume.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the volume.
*/
pool?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the volume will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Path to a backup file from which the volume will be created.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source volume from which the volume will be created. See reference below.
*/
sourceVolume?: pulumi.Input<inputs.StorageVolumeSourceVolume>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - The "type" of volume. The default value is `custom`,
* which is the type to use for storage volumes attached to instances.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a StorageVolume resource.
*/
export interface StorageVolumeArgs {
/**
* *Optional* - Map of key/value pairs of
* [volume config settings](https://linuxcontainers.org/incus/docs/main/reference/storage_drivers/).
* Config settings vary depending on the Storage Pool used.
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Volume content type (`filesystem` or `block`)
*/
contentType?: pulumi.Input<string>;
/**
* *Optional* - Description of the volume.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the storage volume.
*/
name?: pulumi.Input<string>;
/**
* **Required** - Name of storage pool to host the volume.
*/
pool: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the volume will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Path to a backup file from which the volume will be created.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source volume from which the volume will be created. See reference below.
*/
sourceVolume?: pulumi.Input<inputs.StorageVolumeSourceVolume>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - The "type" of volume. The default value is `custom`,
* which is the type to use for storage volumes attached to instances.
*/
type?: pulumi.Input<string>;
}

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

@@ -0,0 +1,49 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"stripInternal": true,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"files": [
"certificate.ts",
"clusterGroup.ts",
"clusterGroupAssignment.ts",
"config/index.ts",
"config/vars.ts",
"getImage.ts",
"getProfile.ts",
"getProject.ts",
"image.ts",
"index.ts",
"instance.ts",
"instanceSnapshot.ts",
"network.ts",
"networkAcl.ts",
"networkForward.ts",
"networkIntegration.ts",
"networkLb.ts",
"networkLoadBalancer.ts",
"networkPeer.ts",
"networkZone.ts",
"networkZoneRecord.ts",
"profile.ts",
"project.ts",
"provider.ts",
"storageBucket.ts",
"storageBucketKey.ts",
"storagePool.ts",
"storageVolume.ts",
"types/index.ts",
"types/input.ts",
"types/output.ts",
"utilities.ts"
]
}

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! ***
import * as utilities from "../utilities";
// Export sub-modules:
import * as input from "./input";
import * as output from "./output";
export {
input,
output,
};

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

@@ -0,0 +1,426 @@
// *** 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";
export interface GetProfileDevice {
/**
* **Required** - Name of the profile.
*/
name?: string;
/**
* Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties?: {[key: string]: string};
/**
* Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type?: string;
}
export interface GetProfileDeviceArgs {
/**
* **Required** - Name of the profile.
*/
name?: pulumi.Input<string>;
/**
* Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type?: pulumi.Input<string>;
}
export interface ImageSourceFile {
/**
* **Required** - Either the path of an [unified image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-unified)
* or the rootfs tarball of a [split image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-split), depending on
* `metadataPath` being provided or not.
*/
dataPath: pulumi.Input<string>;
/**
* *Optional* - Path to the metadata tarball of a [split image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-split).
*/
metadataPath?: pulumi.Input<string>;
}
export interface ImageSourceImage {
/**
* *Optional* - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.
*/
architecture?: pulumi.Input<string>;
/**
* *Optional* - Whether to copy the aliases of the image from
* the remote. Valid values are `true` and `false`.
*/
copyAliases?: pulumi.Input<boolean>;
/**
* **Required** - Name of the image.
*/
name: pulumi.Input<string>;
/**
* **Required** - The remote where the image will be pulled from.
*/
remote: pulumi.Input<string>;
/**
* *Optional* - Type of image to cache. Must be one of `container` or
* `virtual-machine`. Defaults to `container`.
*/
type?: pulumi.Input<string>;
}
export interface ImageSourceInstance {
/**
* **Required** - Name of the source instance.
*/
name: pulumi.Input<string>;
/**
* *Optional* - Name of the snapshot of the source instance
*/
snapshot?: pulumi.Input<string>;
}
export interface InstanceDevice {
/**
* **Required** - Name of the device.
*/
name: pulumi.Input<string>;
/**
* **Required** - Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* **Required** - Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type: pulumi.Input<string>;
}
export interface InstanceFile {
append?: pulumi.Input<boolean>;
/**
* **Required** unless sourcePath is used* - The *contents* of the file.
* Use the `file()` function to read in the content of a file from disk.
*/
content?: pulumi.Input<string>;
/**
* *Optional* - Whether to create the directories leading
* to the target if they do not exist.
*/
createDirectories?: pulumi.Input<boolean>;
/**
* *Optional* - The GID of the file. Must be an unquoted integer.
*/
gid?: pulumi.Input<number>;
/**
* *Optional* - The octal permissions of the file, must be quoted. Defaults to `0755`.
*/
mode?: pulumi.Input<string>;
/**
* **Required** unless content is used* - The source path to a file to
* copy to the instance.
*/
sourcePath?: pulumi.Input<string>;
/**
* **Required** - The absolute path of the file on the instance,
* including the filename.
*/
targetPath: pulumi.Input<string>;
/**
* *Optional* - The UID of the file. Must be an unquoted integer.
*/
uid?: pulumi.Input<number>;
}
export interface InstanceSourceInstance {
/**
* **Required** - Name of the source instance.
*/
name: pulumi.Input<string>;
/**
* **Required** - Name of the project in which the source instance exists.
*/
project: pulumi.Input<string>;
/**
* *Optional* - Name of the snapshot of the source instance
*/
snapshot?: pulumi.Input<string>;
}
export interface InstanceWaitFor {
/**
* *Optional* - Delay time that should be waited for when type is `delay`, e.g. `30s`.
*/
delay?: pulumi.Input<string>;
/**
* *Optional* - Network interface that should be waited for when type is `ipv4` or `ipv6`.
*/
nic?: pulumi.Input<string>;
/**
* **Required** - Type for what should be waited for. Can be `agent`, `delay`, `ipv4`, `ipv6` or `ready`.
*/
type: pulumi.Input<string>;
}
export interface NetworkAclEgress {
/**
* **Required** - Action to take for matching traffic , must be one of allow, allow-stateless, drop, reject
*/
action: pulumi.Input<string>;
/**
* *Optional* - Description of the network ACL rule.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, destination subject name selectors (for egress rules), or empty for any
*/
destination?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `udp` or tcp, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
destinationPort?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP code number, or empty for any
*/
icmpCode?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP type number, or empty for any
*/
icmpType?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `udp` or `tcp`, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
protocol?: pulumi.Input<string>;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, source subject name selectors (for ingress rules), or empty for any
*/
source?: pulumi.Input<string>;
/**
* *Optional* - State of the rule (enabled, disabled or logged), defaulting to enabled if not specified
*/
state: pulumi.Input<string>;
}
export interface NetworkAclIngress {
/**
* **Required** - Action to take for matching traffic , must be one of allow, allow-stateless, drop, reject
*/
action: pulumi.Input<string>;
/**
* *Optional* - Description of the network ACL rule.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, destination subject name selectors (for egress rules), or empty for any
*/
destination?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `udp` or tcp, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
destinationPort?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP code number, or empty for any
*/
icmpCode?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP type number, or empty for any
*/
icmpType?: pulumi.Input<string>;
/**
* *Optional* - If protocol is `udp` or `tcp`, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
protocol?: pulumi.Input<string>;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, source subject name selectors (for ingress rules), or empty for any
*/
source?: pulumi.Input<string>;
/**
* *Optional* - State of the rule (enabled, disabled or logged), defaulting to enabled if not specified
*/
state: pulumi.Input<string>;
}
export interface NetworkForwardPort {
/**
* *Optional* - Description of port(s)
*/
description?: pulumi.Input<string>;
/**
* **Required** - Listen port(s) (e.g. `80,90-100`)
*/
listenPort: pulumi.Input<string>;
/**
* **Required** - Protocol for the port(s) (`tcp` or `udp`). If not set then `tcp` will be used.
*/
protocol?: pulumi.Input<string>;
/**
* **Required** - IP address to forward to
*/
targetAddress: pulumi.Input<string>;
/**
* *Optional* - T arget port(s) (e.g. `70,80-90` or `90`), same as listenPort if empty
*/
targetPort: pulumi.Input<string>;
}
export interface NetworkLbBackend {
/**
* LB backend description
*/
description?: pulumi.Input<string>;
/**
* LB backend name
*/
name: pulumi.Input<string>;
/**
* LB backend target address
*/
targetAddress: pulumi.Input<string>;
/**
* LB backend target port
*/
targetPort?: pulumi.Input<string>;
}
export interface NetworkLbPort {
/**
* Port description
*/
description?: pulumi.Input<string>;
/**
* Port to listen to
*/
listenPort: pulumi.Input<string>;
/**
* Port protocol
*/
protocol?: pulumi.Input<string>;
/**
* List of target LB backends
*/
targetBackends: pulumi.Input<pulumi.Input<string>[]>;
}
export interface NetworkLoadBalancerBackend {
/**
* LB backend description
*/
description?: pulumi.Input<string>;
/**
* LB backend name
*/
name: pulumi.Input<string>;
/**
* LB backend target address
*/
targetAddress: pulumi.Input<string>;
/**
* LB backend target port
*/
targetPort?: pulumi.Input<string>;
}
export interface NetworkLoadBalancerPort {
/**
* Port description
*/
description?: pulumi.Input<string>;
/**
* Port to listen to
*/
listenPort: pulumi.Input<string>;
/**
* Port protocol
*/
protocol?: pulumi.Input<string>;
/**
* List of target LB backends
*/
targetBackends: pulumi.Input<pulumi.Input<string>[]>;
}
export interface NetworkZoneRecordEntry {
/**
* *Optional* - Entry time to live (TTL).
*/
ttl?: pulumi.Input<number>;
/**
* **Required** - Entry type. Valid values are DNS record type, e.g. `A`, `AAAA`, `CNAME`, `TXT`, etc.
*/
type: pulumi.Input<string>;
/**
* **Required** - Entry value.
*/
value: pulumi.Input<string>;
}
export interface ProfileDevice {
/**
* **Required** - Name of the device.
*/
name: pulumi.Input<string>;
/**
* **Required** - Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* **Required** - Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type: pulumi.Input<string>;
}
export interface ProviderRemote {
/**
* The FQDN or IP where the Incus daemon can be contacted. (default = "" (read from lxc config))
*/
address?: pulumi.Input<string>;
/**
* Set this remote as default.
*/
default?: pulumi.Input<boolean>;
/**
* Name of the Incus remote. Required when incusScheme set to https, to enable locating server certificate.
*/
name: pulumi.Input<string>;
/**
* Port Incus Daemon API is listening on. (default = 8443)
*/
port?: pulumi.Input<string>;
/**
* Unix (unix) or HTTPs (https). (default = unix)
*/
scheme?: pulumi.Input<string>;
/**
* The trust token for the remote.
*/
token?: pulumi.Input<string>;
}
export interface StorageVolumeSourceVolume {
/**
* **Required** - Name of the storage volume.
*/
name: pulumi.Input<string>;
/**
* **Required** - The storage pool that will receive the copy of the volume copy.
*/
pool: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
}
export namespace config {
}

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

@@ -0,0 +1,410 @@
// *** 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";
export interface GetProfileDevice {
/**
* **Required** - Name of the profile.
*/
name: string;
/**
* Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties: {[key: string]: string};
/**
* Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type: string;
}
export interface ImageSourceFile {
/**
* **Required** - Either the path of an [unified image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-unified)
* or the rootfs tarball of a [split image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-split), depending on
* `metadataPath` being provided or not.
*/
dataPath: string;
/**
* *Optional* - Path to the metadata tarball of a [split image](https://linuxcontainers.org/incus/docs/main/reference/image_format/#image-format-split).
*/
metadataPath?: string;
}
export interface ImageSourceImage {
/**
* *Optional* - The image architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values.
*/
architecture: string;
/**
* *Optional* - Whether to copy the aliases of the image from
* the remote. Valid values are `true` and `false`.
*/
copyAliases?: boolean;
/**
* **Required** - Name of the image.
*/
name: string;
/**
* **Required** - The remote where the image will be pulled from.
*/
remote: string;
/**
* *Optional* - Type of image to cache. Must be one of `container` or
* `virtual-machine`. Defaults to `container`.
*/
type: string;
}
export interface ImageSourceInstance {
/**
* **Required** - Name of the source instance.
*/
name: string;
/**
* *Optional* - Name of the snapshot of the source instance
*/
snapshot?: string;
}
export interface InstanceDevice {
/**
* **Required** - Name of the device.
*/
name: string;
/**
* **Required** - Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties: {[key: string]: string};
/**
* **Required** - Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type: string;
}
export interface InstanceFile {
append: boolean;
/**
* **Required** unless sourcePath is used* - The *contents* of the file.
* Use the `file()` function to read in the content of a file from disk.
*/
content?: string;
/**
* *Optional* - Whether to create the directories leading
* to the target if they do not exist.
*/
createDirectories?: boolean;
/**
* *Optional* - The GID of the file. Must be an unquoted integer.
*/
gid?: number;
/**
* *Optional* - The octal permissions of the file, must be quoted. Defaults to `0755`.
*/
mode: string;
/**
* **Required** unless content is used* - The source path to a file to
* copy to the instance.
*/
sourcePath?: string;
/**
* **Required** - The absolute path of the file on the instance,
* including the filename.
*/
targetPath: string;
/**
* *Optional* - The UID of the file. Must be an unquoted integer.
*/
uid?: number;
}
export interface InstanceSourceInstance {
/**
* **Required** - Name of the source instance.
*/
name: string;
/**
* **Required** - Name of the project in which the source instance exists.
*/
project: string;
/**
* *Optional* - Name of the snapshot of the source instance
*/
snapshot?: string;
}
export interface InstanceWaitFor {
/**
* *Optional* - Delay time that should be waited for when type is `delay`, e.g. `30s`.
*/
delay?: string;
/**
* *Optional* - Network interface that should be waited for when type is `ipv4` or `ipv6`.
*/
nic?: string;
/**
* **Required** - Type for what should be waited for. Can be `agent`, `delay`, `ipv4`, `ipv6` or `ready`.
*/
type: string;
}
export interface NetworkAclEgress {
/**
* **Required** - Action to take for matching traffic , must be one of allow, allow-stateless, drop, reject
*/
action: string;
/**
* *Optional* - Description of the network ACL rule.
*/
description: string;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, destination subject name selectors (for egress rules), or empty for any
*/
destination: string;
/**
* *Optional* - If protocol is `udp` or tcp, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
destinationPort: string;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP code number, or empty for any
*/
icmpCode: string;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP type number, or empty for any
*/
icmpType: string;
/**
* *Optional* - If protocol is `udp` or `tcp`, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
protocol: string;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, source subject name selectors (for ingress rules), or empty for any
*/
source: string;
/**
* *Optional* - State of the rule (enabled, disabled or logged), defaulting to enabled if not specified
*/
state: string;
}
export interface NetworkAclIngress {
/**
* **Required** - Action to take for matching traffic , must be one of allow, allow-stateless, drop, reject
*/
action: string;
/**
* *Optional* - Description of the network ACL rule.
*/
description: string;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, destination subject name selectors (for egress rules), or empty for any
*/
destination: string;
/**
* *Optional* - If protocol is `udp` or tcp, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
destinationPort: string;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP code number, or empty for any
*/
icmpCode: string;
/**
* *Optional* - If protocol is `icmp4` or `icmp6`, then ICMP type number, or empty for any
*/
icmpType: string;
/**
* *Optional* - If protocol is `udp` or `tcp`, then a comma-separated list of ports or port ranges (start-end inclusive), or empty for any
*/
protocol: string;
/**
* *Optional* - Comma-separated list of CIDR or IP ranges, source subject name selectors (for ingress rules), or empty for any
*/
source: string;
/**
* *Optional* - State of the rule (enabled, disabled or logged), defaulting to enabled if not specified
*/
state: string;
}
export interface NetworkForwardPort {
/**
* *Optional* - Description of port(s)
*/
description?: string;
/**
* **Required** - Listen port(s) (e.g. `80,90-100`)
*/
listenPort: string;
/**
* **Required** - Protocol for the port(s) (`tcp` or `udp`). If not set then `tcp` will be used.
*/
protocol: string;
/**
* **Required** - IP address to forward to
*/
targetAddress: string;
/**
* *Optional* - T arget port(s) (e.g. `70,80-90` or `90`), same as listenPort if empty
*/
targetPort: string;
}
export interface NetworkLbBackend {
/**
* LB backend description
*/
description: string;
/**
* LB backend name
*/
name: string;
/**
* LB backend target address
*/
targetAddress: string;
/**
* LB backend target port
*/
targetPort: string;
}
export interface NetworkLbPort {
/**
* Port description
*/
description: string;
/**
* Port to listen to
*/
listenPort: string;
/**
* Port protocol
*/
protocol: string;
/**
* List of target LB backends
*/
targetBackends: string[];
}
export interface NetworkLoadBalancerBackend {
/**
* LB backend description
*/
description: string;
/**
* LB backend name
*/
name: string;
/**
* LB backend target address
*/
targetAddress: string;
/**
* LB backend target port
*/
targetPort: string;
}
export interface NetworkLoadBalancerPort {
/**
* Port description
*/
description: string;
/**
* Port to listen to
*/
listenPort: string;
/**
* Port protocol
*/
protocol: string;
/**
* List of target LB backends
*/
targetBackends: string[];
}
export interface NetworkZoneRecordEntry {
/**
* *Optional* - Entry time to live (TTL).
*/
ttl: number;
/**
* **Required** - Entry type. Valid values are DNS record type, e.g. `A`, `AAAA`, `CNAME`, `TXT`, etc.
*/
type: string;
/**
* **Required** - Entry value.
*/
value: string;
}
export interface ProfileDevice {
/**
* **Required** - Name of the device.
*/
name: string;
/**
* **Required** - Map of key/value pairs of
* [device properties](https://linuxcontainers.org/incus/docs/main/reference/devices/).
*/
properties: {[key: string]: string};
/**
* **Required** - Type of the device Must be one of none, disk, nic,
* unix-char, unix-block, usb, gpu, infiniband, proxy, unix-hotplug, tpm, pci.
*/
type: string;
}
export interface StorageVolumeSourceVolume {
/**
* **Required** - Name of the storage volume.
*/
name: string;
/**
* **Required** - The storage pool that will receive the copy of the volume copy.
*/
pool: string;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: string;
}
export namespace config {
export interface Remotes {
/**
* The FQDN or IP where the Incus daemon can be contacted. (default = "" (read from lxc config))
*/
address?: string;
/**
* Set this remote as default.
*/
default?: boolean;
/**
* Name of the Incus remote. Required when incusScheme set to https, to enable locating server certificate.
*/
name: string;
/**
* Port Incus Daemon API is listening on. (default = 8443)
*/
port?: string;
/**
* Unix (unix) or HTTPs (https). (default = unix)
*/
scheme?: string;
/**
* The trust token for the remote.
*/
token?: string;
}
}

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;
}