Skip to content

FirewallPolicy

Source: src/AWS/NetworkFirewall/FirewallPolicy.ts

An AWS Network Firewall policy — defines a firewall’s traffic inspection behavior as a collection of stateless and stateful rule group references plus default actions. One policy can be shared by multiple firewalls.

Pass-everything Policy

import * as NetworkFirewall from "alchemy/AWS/NetworkFirewall";
const policy = yield* NetworkFirewall.FirewallPolicy("Policy", {
firewallPolicy: {
StatelessDefaultActions: ["aws:pass"],
StatelessFragmentDefaultActions: ["aws:pass"],
},
});

Policy referencing Rule Groups

const stateless = yield* NetworkFirewall.RuleGroup("Stateless", {
type: "STATELESS",
capacity: 10,
ruleGroup: { ... },
});
const policy = yield* NetworkFirewall.FirewallPolicy("Policy", {
firewallPolicy: {
StatelessDefaultActions: ["aws:forward_to_sfe"],
StatelessFragmentDefaultActions: ["aws:forward_to_sfe"],
StatelessRuleGroupReferences: [
{ ResourceArn: stateless.ruleGroupArn, Priority: 1 },
],
},
});