@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
139 lines • 5.47 kB
JavaScript
;
// *** 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a VPC IP address group resource within HuaweiCloud.
*
* ## Example Usage
* ### IPv4 Address Group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const ipv4 = new huaweicloud.Vpc.AddressGroup("ipv4", {
* addresses: [
* "192.168.10.10",
* "192.168.1.1-192.168.1.50",
* ],
* });
* ```
* ### IPv6 Address Group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const ipv6 = new huaweicloud.Vpc.AddressGroup("ipv6", {
* addresses: ["2001:db8:a583:6e::/64"],
* ipVersion: 6,
* });
* ```
* ### Address Group with ipExtraSet
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const ipv6 = new huaweicloud.Vpc.AddressGroup("ipv6", {
* ipExtraSets: [
* {
* ip: "192.168.3.2",
* remarks: "terraform test 1",
* },
* {
* ip: "192.168.5.0/24",
* remarks: "terraform test 2",
* },
* {
* ip: "192.168.3.20-192.168.3.100",
* },
* ],
* ipVersion: 4,
* });
* ```
*
* ## Import
*
* IP address groups can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpc/addressGroup:AddressGroup test bc96f6b0-ca2c-42ee-b719-0f26bc9c8661
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`force_destroy`. It is generally recommended running `terraform plan` after importing the image. You can then decide if changes should be applied to the image, or the resource definition should be updated to align with the image. Also you can ignore changes as below. hcl resource "huaweicloud_vpc_address_group" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* force_destroy,
*
* ]
*
* } }
*/
class AddressGroup extends pulumi.CustomResource {
/**
* Get an existing AddressGroup 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.
*/
static get(name, id, state, opts) {
return new AddressGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AddressGroup. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AddressGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addresses"] = state ? state.addresses : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["ipExtraSets"] = state ? state.ipExtraSets : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["maxCapacity"] = state ? state.maxCapacity : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
}
else {
const args = argsOrState;
resourceInputs["addresses"] = args ? args.addresses : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["ipExtraSets"] = args ? args.ipExtraSets : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["maxCapacity"] = args ? args.maxCapacity : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AddressGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.AddressGroup = AddressGroup;
/** @internal */
AddressGroup.__pulumiType = 'huaweicloud:Vpc/addressGroup:AddressGroup';
//# sourceMappingURL=addressGroup.js.map