@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
87 lines • 4.84 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.ServicePerimeterEgressPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manage a single EgressPolicy in the status (enforced) configuration for a service perimeter.
* EgressPolicies match requests based on egressFrom and egressTo stanzas.
* For an EgressPolicy to match, both egressFrom and egressTo stanzas must be matched.
* If an EgressPolicy matches a request, the request is allowed to span the ServicePerimeter
* boundary. For example, an EgressPolicy can be used to allow VMs on networks
* within the ServicePerimeter to access a defined set of projects outside the
* perimeter in certain contexts (e.g. to read data from a Cloud Storage bucket
* or query against a BigQuery dataset).
*
* > **Note:** By default, updates to this resource will remove the EgressPolicy from the
* from the perimeter and add it back in a non-atomic manner. To ensure that the new EgressPolicy
* is added before the old one is removed, add a `lifecycle` block with `createBeforeDestroy = true` to this resource.
* **Note:** If this resource is used alongside a `gcp.accesscontextmanager.ServicePerimeter` resource,
* the service perimeter resource must have a `lifecycle` block with `ignoreChanges = [status[0].egress_policies]` so
* they don't fight over which egress rules should be in the policy.
*
* To get more information about ServicePerimeterEgressPolicy, see:
*
* * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters#egresspolicy)
* * How-to Guides
* * [Guide to Ingress and Egress Rules](https://cloud.google.com/vpc-service-controls/docs/ingress-egress-rules)
*
* ## Example Usage
*/
class ServicePerimeterEgressPolicy extends pulumi.CustomResource {
/**
* Get an existing ServicePerimeterEgressPolicy 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 ServicePerimeterEgressPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServicePerimeterEgressPolicy. 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'] === ServicePerimeterEgressPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessPolicyId"] = state ? state.accessPolicyId : undefined;
resourceInputs["egressFrom"] = state ? state.egressFrom : undefined;
resourceInputs["egressTo"] = state ? state.egressTo : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["perimeter"] = state ? state.perimeter : undefined;
resourceInputs["title"] = state ? state.title : undefined;
}
else {
const args = argsOrState;
if ((!args || args.perimeter === undefined) && !opts.urn) {
throw new Error("Missing required property 'perimeter'");
}
resourceInputs["egressFrom"] = args ? args.egressFrom : undefined;
resourceInputs["egressTo"] = args ? args.egressTo : undefined;
resourceInputs["perimeter"] = args ? args.perimeter : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["accessPolicyId"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServicePerimeterEgressPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServicePerimeterEgressPolicy = ServicePerimeterEgressPolicy;
/** @internal */
ServicePerimeterEgressPolicy.__pulumiType = 'gcp:accesscontextmanager/servicePerimeterEgressPolicy:ServicePerimeterEgressPolicy';
//# sourceMappingURL=servicePerimeterEgressPolicy.js.map