UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

195 lines • 9.54 kB
"use strict"; // *** 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.NetworkFirewallPolicyPacketMirroringRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Compute Network Firewall Policy Packet Mirroring Rule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const _default = new gcp.compute.Network("default", { * name: "fw-network", * autoCreateSubnetworks: false, * }); * const basicNetworkFirewallPolicy = new gcp.compute.NetworkFirewallPolicy("basic_network_firewall_policy", { * name: "fw-policy", * description: "Sample global network firewall policy", * project: "my-project-name", * }); * const defaultMirroringDeploymentGroup = new gcp.networksecurity.MirroringDeploymentGroup("default", { * mirroringDeploymentGroupId: "deployment-group", * location: "global", * network: _default.id, * }); * const defaultMirroringEndpointGroup = new gcp.networksecurity.MirroringEndpointGroup("default", { * mirroringEndpointGroupId: "endpoint-group", * location: "global", * mirroringDeploymentGroup: defaultMirroringDeploymentGroup.id, * }); * const defaultSecurityProfile = new gcp.networksecurity.SecurityProfile("default", { * name: "sec-profile", * parent: "organizations/123456789", * description: "my description", * type: "CUSTOM_MIRRORING", * customMirroringProfile: { * mirroringEndpointGroup: defaultMirroringEndpointGroup.id, * }, * }); * const securityProfileGroup1 = new gcp.networksecurity.SecurityProfileGroup("security_profile_group_1", { * name: "sec-profile-group", * parent: "organizations/123456789", * description: "my description", * customMirroringProfile: defaultSecurityProfile.id, * }); * const secureTagKey1 = new gcp.tags.TagKey("secure_tag_key_1", { * description: "Test tag key description", * parent: "organizations/123456789", * purpose: "GCE_FIREWALL", * shortName: "tag-key", * purposeData: { * network: pulumi.interpolate`my-project-name/${_default.name}`, * }, * }); * const secureTagValue1 = new gcp.tags.TagValue("secure_tag_value_1", { * description: "Test tag value description.", * parent: secureTagKey1.id, * shortName: "tag-value", * }); * const primary = new gcp.compute.NetworkFirewallPolicyPacketMirroringRule("primary", { * action: "mirror", * description: "This is a simple packet mirroring rule description", * direction: "INGRESS", * disabled: false, * firewallPolicy: basicNetworkFirewallPolicy.name, * priority: 1000, * ruleName: "test-rule", * match: { * srcIpRanges: ["10.100.0.1/32"], * layer4Configs: [{ * ipProtocol: "all", * }], * }, * securityProfileGroup: pulumi.interpolate`//networksecurity.googleapis.com/${securityProfileGroup1.id}`, * targetSecureTags: [{ * name: pulumi.interpolate`tagValues/${secureTagValue1.name}`, * }], * }); * ``` * * ## Import * * NetworkFirewallPolicyPacketMirroringRule can be imported using any of these accepted formats: * * * `projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/packetMirroringRules/{{priority}}` * * * `{{project}}/{{firewall_policy}}/{{priority}}` * * * `{{firewall_policy}}/{{priority}}` * * When using the `pulumi import` command, NetworkFirewallPolicyPacketMirroringRule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/packetMirroringRules/{{priority}} * ``` * * ```sh * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default {{project}}/{{firewall_policy}}/{{priority}} * ``` * * ```sh * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default {{firewall_policy}}/{{priority}} * ``` */ class NetworkFirewallPolicyPacketMirroringRule extends pulumi.CustomResource { /** * Get an existing NetworkFirewallPolicyPacketMirroringRule 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 NetworkFirewallPolicyPacketMirroringRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NetworkFirewallPolicyPacketMirroringRule. 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'] === NetworkFirewallPolicyPacketMirroringRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["direction"] = state ? state.direction : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["firewallPolicy"] = state ? state.firewallPolicy : undefined; resourceInputs["kind"] = state ? state.kind : undefined; resourceInputs["match"] = state ? state.match : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["ruleName"] = state ? state.ruleName : undefined; resourceInputs["ruleTupleCount"] = state ? state.ruleTupleCount : undefined; resourceInputs["securityProfileGroup"] = state ? state.securityProfileGroup : undefined; resourceInputs["targetSecureTags"] = state ? state.targetSecureTags : undefined; resourceInputs["tlsInspect"] = state ? state.tlsInspect : undefined; } else { const args = argsOrState; if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.direction === undefined) && !opts.urn) { throw new Error("Missing required property 'direction'"); } if ((!args || args.firewallPolicy === undefined) && !opts.urn) { throw new Error("Missing required property 'firewallPolicy'"); } if ((!args || args.match === undefined) && !opts.urn) { throw new Error("Missing required property 'match'"); } if ((!args || args.priority === undefined) && !opts.urn) { throw new Error("Missing required property 'priority'"); } resourceInputs["action"] = args ? args.action : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["direction"] = args ? args.direction : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["firewallPolicy"] = args ? args.firewallPolicy : undefined; resourceInputs["match"] = args ? args.match : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["ruleName"] = args ? args.ruleName : undefined; resourceInputs["securityProfileGroup"] = args ? args.securityProfileGroup : undefined; resourceInputs["targetSecureTags"] = args ? args.targetSecureTags : undefined; resourceInputs["tlsInspect"] = args ? args.tlsInspect : undefined; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["kind"] = undefined /*out*/; resourceInputs["ruleTupleCount"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkFirewallPolicyPacketMirroringRule.__pulumiType, name, resourceInputs, opts); } } exports.NetworkFirewallPolicyPacketMirroringRule = NetworkFirewallPolicyPacketMirroringRule; /** @internal */ NetworkFirewallPolicyPacketMirroringRule.__pulumiType = 'gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule'; //# sourceMappingURL=networkFirewallPolicyPacketMirroringRule.js.map