@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
119 lines • 5.07 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.NetworkFirewallPolicyAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The Compute NetworkFirewallPolicyAssociation resource
*
* To get more information about NetworkFirewallPolicyAssociation, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networkFirewallPolicies/addAssociation)
*
* ## Example Usage
*
* ### Network Firewall Policy Association
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const policy = new gcp.compute.NetworkFirewallPolicy("policy", {
* name: "my-policy",
* project: "my-project-name",
* description: "Sample global network firewall policy",
* });
* const network = new gcp.compute.Network("network", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const _default = new gcp.compute.NetworkFirewallPolicyAssociation("default", {
* name: "my-association",
* project: "my-project-name",
* attachmentTarget: network.id,
* firewallPolicy: policy.id,
* });
* ```
*
* ## Import
*
* NetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
*
* * `projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
*
* * `{{project}}/{{firewall_policy}}/{{name}}`
*
* * `{{firewall_policy}}/{{name}}`
*
* When using the `pulumi import` command, NetworkFirewallPolicyAssociation can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default {{project}}/{{firewall_policy}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation default {{firewall_policy}}/{{name}}
* ```
*/
class NetworkFirewallPolicyAssociation extends pulumi.CustomResource {
/**
* Get an existing NetworkFirewallPolicyAssociation 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 NetworkFirewallPolicyAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NetworkFirewallPolicyAssociation. 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'] === NetworkFirewallPolicyAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["attachmentTarget"] = state?.attachmentTarget;
resourceInputs["firewallPolicy"] = state?.firewallPolicy;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["shortName"] = state?.shortName;
}
else {
const args = argsOrState;
if (args?.attachmentTarget === undefined && !opts.urn) {
throw new Error("Missing required property 'attachmentTarget'");
}
if (args?.firewallPolicy === undefined && !opts.urn) {
throw new Error("Missing required property 'firewallPolicy'");
}
resourceInputs["attachmentTarget"] = args?.attachmentTarget;
resourceInputs["firewallPolicy"] = args?.firewallPolicy;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["shortName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkFirewallPolicyAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.NetworkFirewallPolicyAssociation = NetworkFirewallPolicyAssociation;
/** @internal */
NetworkFirewallPolicyAssociation.__pulumiType = 'gcp:compute/networkFirewallPolicyAssociation:NetworkFirewallPolicyAssociation';
//# sourceMappingURL=networkFirewallPolicyAssociation.js.map
;