Files
pulumi-incus/sdk/nodejs/networkPeer.ts
2025-04-24 21:09:04 -04:00

252 lines
9.8 KiB
TypeScript
Generated

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