@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
181 lines • 9.21 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MirroringEndpointGroupAssociation = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* An endpoint group association represents a link between a network and an
* endpoint group in the organization.
*
* Creating an association creates the networking infrastructure linking the
* network to the endpoint group, but does not enable mirroring by itself.
* To enable mirroring, the user must also create a network firewall policy
* containing mirroring rules and associate it with the network.
*
* To get more information about MirroringEndpointGroupAssociation, see:
*
* * [API documentation](https://cloud.google.com/network-security-integration/docs/reference/rest/v1/projects.locations.mirroringEndpointGroupAssociations)
* * How-to Guides
* * [Mirroring endpoint group association overview](https://cloud.google.com/network-security-integration/docs/out-of-band/endpoint-groups-overview#mirroring-endpoint-group-association)
*
* ## Example Usage
*
* ### Network Security Mirroring Endpoint Group Association Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const producerNetwork = new gcp.compute.Network("producer_network", {
* name: "example-prod-network",
* autoCreateSubnetworks: false,
* });
* const consumerNetwork = new gcp.compute.Network("consumer_network", {
* name: "example-cons-network",
* autoCreateSubnetworks: false,
* });
* const deploymentGroup = new gcp.networksecurity.MirroringDeploymentGroup("deployment_group", {
* mirroringDeploymentGroupId: "example-dg",
* location: "global",
* network: producerNetwork.id,
* });
* const endpointGroup = new gcp.networksecurity.MirroringEndpointGroup("endpoint_group", {
* mirroringEndpointGroupId: "example-eg",
* location: "global",
* mirroringDeploymentGroup: deploymentGroup.id,
* });
* const _default = new gcp.networksecurity.MirroringEndpointGroupAssociation("default", {
* mirroringEndpointGroupAssociationId: "example-ega",
* location: "global",
* network: consumerNetwork.id,
* mirroringEndpointGroup: endpointGroup.id,
* labels: {
* foo: "bar",
* },
* });
* ```
*
* ## Import
*
* MirroringEndpointGroupAssociation can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/mirroringEndpointGroupAssociations/{{mirroring_endpoint_group_association_id}}`
* * `{{project}}/{{location}}/{{mirroring_endpoint_group_association_id}}`
* * `{{location}}/{{mirroring_endpoint_group_association_id}}`
*
* When using the `pulumi import` command, MirroringEndpointGroupAssociation can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:networksecurity/mirroringEndpointGroupAssociation:MirroringEndpointGroupAssociation default projects/{{project}}/locations/{{location}}/mirroringEndpointGroupAssociations/{{mirroring_endpoint_group_association_id}}
* $ pulumi import gcp:networksecurity/mirroringEndpointGroupAssociation:MirroringEndpointGroupAssociation default {{project}}/{{location}}/{{mirroring_endpoint_group_association_id}}
* $ pulumi import gcp:networksecurity/mirroringEndpointGroupAssociation:MirroringEndpointGroupAssociation default {{location}}/{{mirroring_endpoint_group_association_id}}
* ```
*/
class MirroringEndpointGroupAssociation extends pulumi.CustomResource {
/**
* Get an existing MirroringEndpointGroupAssociation 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 MirroringEndpointGroupAssociation(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:networksecurity/mirroringEndpointGroupAssociation:MirroringEndpointGroupAssociation';
/**
* Returns true if the given object is an instance of MirroringEndpointGroupAssociation. 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'] === MirroringEndpointGroupAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["locations"] = state?.locations;
resourceInputs["locationsDetails"] = state?.locationsDetails;
resourceInputs["mirroringEndpointGroup"] = state?.mirroringEndpointGroup;
resourceInputs["mirroringEndpointGroupAssociationId"] = state?.mirroringEndpointGroupAssociationId;
resourceInputs["name"] = state?.name;
resourceInputs["network"] = state?.network;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["reconciling"] = state?.reconciling;
resourceInputs["state"] = state?.state;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.mirroringEndpointGroup === undefined && !opts.urn) {
throw new Error("Missing required property 'mirroringEndpointGroup'");
}
if (args?.network === undefined && !opts.urn) {
throw new Error("Missing required property 'network'");
}
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["mirroringEndpointGroup"] = args?.mirroringEndpointGroup;
resourceInputs["mirroringEndpointGroupAssociationId"] = args?.mirroringEndpointGroupAssociationId;
resourceInputs["network"] = args?.network;
resourceInputs["project"] = args?.project;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["locations"] = undefined /*out*/;
resourceInputs["locationsDetails"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(MirroringEndpointGroupAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.MirroringEndpointGroupAssociation = MirroringEndpointGroupAssociation;
//# sourceMappingURL=mirroringEndpointGroupAssociation.js.map