@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
153 lines • 7.72 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.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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["availabilityZoneChangeProtection"] = state ? state.availabilityZoneChangeProtection : undefined;
resourceInputs["availabilityZoneMappings"] = state ? state.availabilityZoneMappings : undefined;
resourceInputs["deleteProtection"] = state ? state.deleteProtection : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enabledAnalysisTypes"] = state ? state.enabledAnalysisTypes : undefined;
resourceInputs["encryptionConfiguration"] = state ? state.encryptionConfiguration : undefined;
resourceInputs["firewallPolicyArn"] = state ? state.firewallPolicyArn : undefined;
resourceInputs["firewallPolicyChangeProtection"] = state ? state.firewallPolicyChangeProtection : undefined;
resourceInputs["firewallStatuses"] = state ? state.firewallStatuses : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["subnetChangeProtection"] = state ? state.subnetChangeProtection : undefined;
resourceInputs["subnetMappings"] = state ? state.subnetMappings : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["transitGatewayId"] = state ? state.transitGatewayId : undefined;
resourceInputs["transitGatewayOwnerAccountId"] = state ? state.transitGatewayOwnerAccountId : undefined;
resourceInputs["updateToken"] = state ? state.updateToken : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.firewallPolicyArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'firewallPolicyArn'");
}
resourceInputs["availabilityZoneChangeProtection"] = args ? args.availabilityZoneChangeProtection : undefined;
resourceInputs["availabilityZoneMappings"] = args ? args.availabilityZoneMappings : undefined;
resourceInputs["deleteProtection"] = args ? args.deleteProtection : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enabledAnalysisTypes"] = args ? args.enabledAnalysisTypes : undefined;
resourceInputs["encryptionConfiguration"] = args ? args.encryptionConfiguration : undefined;
resourceInputs["firewallPolicyArn"] = args ? args.firewallPolicyArn : undefined;
resourceInputs["firewallPolicyChangeProtection"] = args ? args.firewallPolicyChangeProtection : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["subnetChangeProtection"] = args ? args.subnetChangeProtection : undefined;
resourceInputs["subnetMappings"] = args ? args.subnetMappings : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["transitGatewayId"] = args ? args.transitGatewayId : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
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