UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

170 lines 6.67 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** 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"); /** * AddressGroup is a resource that specifies how a collection of IP/DNS used in Firewall Policy. * * To get more information about AddressGroup, see: * * * [API documentation](https://cloud.google.com/traffic-director/docs/reference/network-security/rest/v1beta1/organizations.locations.addressGroups) * * How-to Guides * * [Use AddressGroups](https://cloud.google.com/vpc/docs/use-address-groups-firewall-policies) * * ## Example Usage * * ### Network Security Address Groups Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.AddressGroup("default", { * name: "my-address-groups", * parent: "projects/my-project-name", * location: "us-central1", * type: "IPV4", * capacity: 100, * items: ["208.80.154.224/32"], * }); * ``` * ### Network Security Address Groups Organization Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.AddressGroup("default", { * name: "my-address-groups", * parent: "organizations/123456789", * location: "us-central1", * type: "IPV4", * capacity: 100, * items: ["208.80.154.224/32"], * }); * ``` * ### Network Security Address Groups Advanced * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.AddressGroup("default", { * name: "my-address-groups", * parent: "projects/my-project-name", * location: "us-central1", * description: "my description", * type: "IPV4", * capacity: 100, * items: ["208.80.154.224/32"], * }); * ``` * ### Network Security Address Groups Cloud Armor * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.AddressGroup("default", { * name: "my-address-groups", * parent: "projects/my-project-name", * location: "global", * type: "IPV4", * capacity: 100, * purposes: ["CLOUD_ARMOR"], * items: ["208.80.154.224/32"], * }); * ``` * * ## Import * * AddressGroup can be imported using any of these accepted formats: * * * `{{parent}}/locations/{{location}}/addressGroups/{{name}}` * * When using the `pulumi import` command, AddressGroup can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networksecurity/addressGroup:AddressGroup default {{parent}}/locations/{{location}}/addressGroups/{{name}} * ``` */ 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, { ...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["capacity"] = state?.capacity; resourceInputs["createTime"] = state?.createTime; resourceInputs["description"] = state?.description; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["items"] = state?.items; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["purposes"] = state?.purposes; resourceInputs["type"] = state?.type; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.capacity === undefined && !opts.urn) { throw new Error("Missing required property 'capacity'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["capacity"] = args?.capacity; resourceInputs["description"] = args?.description; resourceInputs["items"] = args?.items; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["parent"] = args?.parent; resourceInputs["purposes"] = args?.purposes; resourceInputs["type"] = args?.type; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AddressGroup.__pulumiType, name, resourceInputs, opts); } } exports.AddressGroup = AddressGroup; /** @internal */ AddressGroup.__pulumiType = 'gcp:networksecurity/addressGroup:AddressGroup'; //# sourceMappingURL=addressGroup.js.map