@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
117 lines • 5.03 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.FirewallPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Hierarchical firewall policy rules let you create and enforce a consistent firewall policy across your organization. Rules can explicitly allow or deny connections or delegate evaluation to lower level policies. Policies can be created within organizations or folders.
*
* This resource should be generally be used with `gcp.compute.FirewallPolicyAssociation` and `gcp.compute.FirewallPolicyRule`
*
* For more information see the [official documentation](https://cloud.google.com/vpc/docs/firewall-policies)
*
* To get more information about FirewallPolicy, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/firewallPolicies)
*
* ## Example Usage
*
* ### Firewall Policy
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.FirewallPolicy("default", {
* parent: "organizations/123456789",
* shortName: "my-policy",
* description: "Example Resource",
* });
* ```
*
* ## Import
*
* FirewallPolicy can be imported using any of these accepted formats:
*
* * `locations/global/firewallPolicies/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, FirewallPolicy can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/firewallPolicy:FirewallPolicy default locations/global/firewallPolicies/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/firewallPolicy:FirewallPolicy default {{name}}
* ```
*/
class FirewallPolicy extends pulumi.CustomResource {
/**
* Get an existing FirewallPolicy 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 FirewallPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of FirewallPolicy. 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'] === FirewallPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["description"] = state?.description;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["firewallPolicyId"] = state?.firewallPolicyId;
resourceInputs["name"] = state?.name;
resourceInputs["parent"] = state?.parent;
resourceInputs["ruleTupleCount"] = state?.ruleTupleCount;
resourceInputs["selfLink"] = state?.selfLink;
resourceInputs["selfLinkWithId"] = state?.selfLinkWithId;
resourceInputs["shortName"] = state?.shortName;
}
else {
const args = argsOrState;
if (args?.parent === undefined && !opts.urn) {
throw new Error("Missing required property 'parent'");
}
if (args?.shortName === undefined && !opts.urn) {
throw new Error("Missing required property 'shortName'");
}
resourceInputs["description"] = args?.description;
resourceInputs["parent"] = args?.parent;
resourceInputs["shortName"] = args?.shortName;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["firewallPolicyId"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["ruleTupleCount"] = undefined /*out*/;
resourceInputs["selfLink"] = undefined /*out*/;
resourceInputs["selfLinkWithId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FirewallPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.FirewallPolicy = FirewallPolicy;
/** @internal */
FirewallPolicy.__pulumiType = 'gcp:compute/firewallPolicy:FirewallPolicy';
//# sourceMappingURL=firewallPolicy.js.map
;