@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
170 lines • 7.16 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");
/**
* 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, 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["capacity"] = state ? state.capacity : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["items"] = state ? state.items : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parent"] = state ? state.parent : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["purposes"] = state ? state.purposes : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacity'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["capacity"] = args ? args.capacity : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["items"] = args ? args.items : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parent"] = args ? args.parent : undefined;
resourceInputs["purposes"] = args ? args.purposes : undefined;
resourceInputs["type"] = args ? args.type : undefined;
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