UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

153 lines 7.03 kB
"use strict"; // *** 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.Firewall = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an AWS Network Firewall Firewall Resource * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.networkfirewall.Firewall("example", { * name: "example", * firewallPolicyArn: exampleAwsNetworkfirewallFirewallPolicy.arn, * vpcId: exampleAwsVpc.id, * enabledAnalysisTypes: [ * "TLS_SNI", * "HTTP_HOST", * ], * subnetMappings: [{ * subnetId: exampleAwsSubnet.id, * }], * tags: { * Tag1: "Value1", * Tag2: "Value2", * }, * }); * ``` * * ### Transit Gateway Attached Firewall * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.getAvailabilityZones({ * state: "available", * }); * const exampleFirewall = new aws.networkfirewall.Firewall("example", { * name: "example", * firewallPolicyArn: exampleAwsNetworkfirewallFirewallPolicy.arn, * transitGatewayId: exampleAwsEc2TransitGateway.id, * availabilityZoneMappings: [ * { * availabilityZoneId: example.then(example => example.zoneIds?.[0]), * }, * { * availabilityZoneId: example.then(example => example.zoneIds?.[1]), * }, * ], * }); * ``` * * ### Transit Gateway Attached Firewall (Cross Account) * * A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and create Network Firewall in the second account to the Transit Gateway via the `aws.networkfirewall.Firewall` and `awsNetworkfirewallNetworkFirewallTransitGatewayAttachmentAccepter` resources can be found in the `./examples/network-firewall-cross-account-transit-gateway` directory within the Github Repository * * ## Import * * Using `pulumi import`, import Network Firewall Firewalls using their `arn`. For example: * * ```sh * $ pulumi import aws:networkfirewall/firewall:Firewall example arn:aws:network-firewall:us-west-1:123456789012:firewall/example * ``` */ class Firewall extends pulumi.CustomResource { /** * Get an existing Firewall 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 Firewall(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Firewall. 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'] === Firewall.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["availabilityZoneChangeProtection"] = state?.availabilityZoneChangeProtection; resourceInputs["availabilityZoneMappings"] = state?.availabilityZoneMappings; resourceInputs["deleteProtection"] = state?.deleteProtection; resourceInputs["description"] = state?.description; resourceInputs["enabledAnalysisTypes"] = state?.enabledAnalysisTypes; resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration; resourceInputs["firewallPolicyArn"] = state?.firewallPolicyArn; resourceInputs["firewallPolicyChangeProtection"] = state?.firewallPolicyChangeProtection; resourceInputs["firewallStatuses"] = state?.firewallStatuses; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["subnetChangeProtection"] = state?.subnetChangeProtection; resourceInputs["subnetMappings"] = state?.subnetMappings; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["transitGatewayId"] = state?.transitGatewayId; resourceInputs["transitGatewayOwnerAccountId"] = state?.transitGatewayOwnerAccountId; resourceInputs["updateToken"] = state?.updateToken; resourceInputs["vpcId"] = state?.vpcId; } else { const args = argsOrState; if (args?.firewallPolicyArn === undefined && !opts.urn) { throw new Error("Missing required property 'firewallPolicyArn'"); } resourceInputs["availabilityZoneChangeProtection"] = args?.availabilityZoneChangeProtection; resourceInputs["availabilityZoneMappings"] = args?.availabilityZoneMappings; resourceInputs["deleteProtection"] = args?.deleteProtection; resourceInputs["description"] = args?.description; resourceInputs["enabledAnalysisTypes"] = args?.enabledAnalysisTypes; resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration; resourceInputs["firewallPolicyArn"] = args?.firewallPolicyArn; resourceInputs["firewallPolicyChangeProtection"] = args?.firewallPolicyChangeProtection; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["subnetChangeProtection"] = args?.subnetChangeProtection; resourceInputs["subnetMappings"] = args?.subnetMappings; resourceInputs["tags"] = args?.tags; resourceInputs["transitGatewayId"] = args?.transitGatewayId; resourceInputs["vpcId"] = args?.vpcId; resourceInputs["arn"] = undefined /*out*/; resourceInputs["firewallStatuses"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["transitGatewayOwnerAccountId"] = undefined /*out*/; resourceInputs["updateToken"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Firewall.__pulumiType, name, resourceInputs, opts); } } exports.Firewall = Firewall; /** @internal */ Firewall.__pulumiType = 'aws:networkfirewall/firewall:Firewall'; //# sourceMappingURL=firewall.js.map