Files
pulumi-incus/sdk/nodejs/networkAddressSet.ts
2025-12-08 10:47:09 -05:00

209 lines
8.0 KiB
TypeScript
Generated

// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** 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.NetworkAddressSet
*
* Network address sets are a list of either IPv4, IPv6 addresses with or without CIDR suffix. They can be used in source or destination fields of [ACLs](https://linuxcontainers.org/incus/docs/main/howto/network_acls/#network-acls-rules-properties).
*
* ## Basic Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const _this = new incus.NetworkAddressSet("this", {
* name: "Network Address Set",
* description: "Network Address Set description",
* addresses: [
* "10.0.0.2",
* "10.0.0.3",
* ],
* });
* ```
*
* ## ACL Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const _this = new incus.NetworkAddressSet("this", {
* name: "network_address_set",
* description: "Network Address Set description",
* addresses: [
* "10.0.0.2",
* "10.0.0.3",
* ],
* });
* const thisNetworkAcl = new incus.NetworkAcl("this", {
* name: "network_acl",
* ingresses: [{
* action: "allow",
* source: "${incus_network_address_set.this.name}",
* destination_port: "22",
* protocol: "tcp",
* description: pulumi.interpolate`Incoming SSH connections from ${_this.name}`,
* state: "logged",
* }],
* });
* ```
*/
export class NetworkAddressSet extends pulumi.CustomResource {
/**
* Get an existing NetworkAddressSet 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?: NetworkAddressSetState, opts?: pulumi.CustomResourceOptions): NetworkAddressSet {
return new NetworkAddressSet(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/networkAddressSet:NetworkAddressSet';
/**
* Returns true if the given object is an instance of NetworkAddressSet. 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 NetworkAddressSet {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NetworkAddressSet.__pulumiType;
}
/**
* **Required** - IP addresses of the address set.
*/
declare public readonly addresses: pulumi.Output<string[]>;
/**
* *Optional* - Map of key/value pairs of [network address set config settings](https://linuxcontainers.org/incus/docs/main/howto/network_address_sets/#address-set-configuration-options)
*/
declare public readonly config: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the network address set.
*/
declare public readonly description: pulumi.Output<string>;
/**
* **Required** - Name of the network address set.
*/
declare public readonly name: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the network address set will be created.
*/
declare 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.
*/
declare public readonly remote: pulumi.Output<string | undefined>;
/**
* Create a NetworkAddressSet 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: NetworkAddressSetArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: NetworkAddressSetArgs | NetworkAddressSetState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as NetworkAddressSetState | undefined;
resourceInputs["addresses"] = state?.addresses;
resourceInputs["config"] = state?.config;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["remote"] = state?.remote;
} else {
const args = argsOrState as NetworkAddressSetArgs | undefined;
if (args?.addresses === undefined && !opts.urn) {
throw new Error("Missing required property 'addresses'");
}
if (args?.name === undefined && !opts.urn) {
throw new Error("Missing required property 'name'");
}
resourceInputs["addresses"] = args?.addresses;
resourceInputs["config"] = args?.config;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["remote"] = args?.remote;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkAddressSet.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering NetworkAddressSet resources.
*/
export interface NetworkAddressSetState {
/**
* **Required** - IP addresses of the address set.
*/
addresses?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Map of key/value pairs of [network address set config settings](https://linuxcontainers.org/incus/docs/main/howto/network_address_sets/#address-set-configuration-options)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network address set.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network address set.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network address set 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 NetworkAddressSet resource.
*/
export interface NetworkAddressSetArgs {
/**
* **Required** - IP addresses of the address set.
*/
addresses: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Map of key/value pairs of [network address set config settings](https://linuxcontainers.org/incus/docs/main/howto/network_address_sets/#address-set-configuration-options)
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the network address set.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the network address set.
*/
name: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the network address set 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>;
}