@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
214 lines • 8.25 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");
/**
* Provides an AWS Network Firewall Firewall Policy Resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const currentGetPartition = aws.getPartition({});
* const currentGetCallerIdentity = aws.getCallerIdentity({});
* const example = new aws.networkfirewall.FirewallPolicy("example", {
* name: "example",
* firewallPolicy: {
* statelessDefaultActions: ["aws:pass"],
* statelessFragmentDefaultActions: ["aws:drop"],
* statelessRuleGroupReferences: [{
* priority: 1,
* resourceArn: exampleAwsNetworkfirewallRuleGroup.arn,
* }],
* tlsInspectionConfigurationArn: Promise.all([currentGetPartition, current, currentGetCallerIdentity]).then(([currentGetPartition, current, currentGetCallerIdentity]) => `arn:${currentGetPartition.partition}:network-firewall:${current.region}:${currentGetCallerIdentity.accountId}:tls-configuration/example`),
* },
* tags: {
* Tag1: "Value1",
* Tag2: "Value2",
* },
* });
* ```
*
* ## Policy with a HOME_NET Override
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.networkfirewall.FirewallPolicy("example", {
* name: "example",
* firewallPolicy: {
* policyVariables: {
* ruleVariables: [{
* key: "HOME_NET",
* ipSet: {
* definitions: [
* "10.0.0.0/16",
* "10.1.0.0/24",
* ],
* },
* }],
* },
* statelessDefaultActions: ["aws:pass"],
* statelessFragmentDefaultActions: ["aws:drop"],
* statelessRuleGroupReferences: [{
* priority: 1,
* resourceArn: exampleAwsNetworkfirewallRuleGroup.arn,
* }],
* },
* tags: {
* Tag1: "Value1",
* Tag2: "Value2",
* },
* });
* ```
*
* ## Policy with a Custom Action for Stateless Inspection
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.networkfirewall.FirewallPolicy("example", {
* name: "example",
* firewallPolicy: {
* statelessDefaultActions: [
* "aws:pass",
* "ExampleCustomAction",
* ],
* statelessFragmentDefaultActions: ["aws:drop"],
* statelessCustomActions: [{
* actionDefinition: {
* publishMetricAction: {
* dimensions: [{
* value: "1",
* }],
* },
* },
* actionName: "ExampleCustomAction",
* }],
* },
* });
* ```
*
* ## Policy with Active Threat Defense in Action Order
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const currentGetPartition = aws.getPartition({});
* const example = new aws.networkfirewall.FirewallPolicy("example", {
* name: "example",
* firewallPolicy: {
* statelessFragmentDefaultActions: ["aws:drop"],
* statelessDefaultActions: ["aws:pass"],
* statefulRuleGroupReferences: [{
* deepThreatInspection: "true",
* resourceArn: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:network-firewall:${current.region}:aws-managed:stateful-rulegroup/AttackInfrastructureActionOrder`),
* }],
* },
* });
* ```
*
* ## Policy with Active Threat Defense in Strict Order
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const currentGetPartition = aws.getPartition({});
* const example = new aws.networkfirewall.FirewallPolicy("example", {
* name: "example",
* firewallPolicy: {
* statelessFragmentDefaultActions: ["aws:drop"],
* statelessDefaultActions: ["aws:pass"],
* statefulEngineOptions: {
* ruleOrder: "STRICT_ORDER",
* },
* statefulRuleGroupReferences: [{
* deepThreatInspection: "false",
* priority: 1,
* resourceArn: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:network-firewall:${current.region}:aws-managed:stateful-rulegroup/AttackInfrastructureStrictOrder`),
* }],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Network Firewall Policies using their `arn`. For example:
*
* ```sh
* $ pulumi import aws:networkfirewall/firewallPolicy:FirewallPolicy example arn:aws:network-firewall:us-west-1:123456789012:firewall-policy/example
* ```
*/
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["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration;
resourceInputs["firewallPolicy"] = state?.firewallPolicy;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["updateToken"] = state?.updateToken;
}
else {
const args = argsOrState;
if (args?.firewallPolicy === undefined && !opts.urn) {
throw new Error("Missing required property 'firewallPolicy'");
}
resourceInputs["description"] = args?.description;
resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration;
resourceInputs["firewallPolicy"] = args?.firewallPolicy;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["updateToken"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FirewallPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.FirewallPolicy = FirewallPolicy;
/** @internal */
FirewallPolicy.__pulumiType = 'aws:networkfirewall/firewallPolicy:FirewallPolicy';
//# sourceMappingURL=firewallPolicy.js.map