resource "aws_networkfirewall_firewall_policy" "example" {
description = "Firewall policy"
firewall_policy_name = "firewall-policy"
firewall_policy {
stateful_rule_group_references {
resoure_arn = ""
}
stateless_custom_actions {
action_definition {
publish_metric_action {
dimensions {
value = ""
}
}
}
action_name = "action"
}
stateless_default_actions = ["actions"]
stateless_fragment_default_actions = ["actions"]
stateless_rule_group_references {
priority = 1
resoure_arn = ""
}
}
tags = {
Key = "Value"
}
}
resource "aws_networkfirewall_firewall" "example" {
delete_protection = false
description = "Firewall"
firewall_name = "firewall"
firewall_policy_arn = aws_networkfirewall_firewall_policy.example.arn
firewall_policy_change_protection = true
subnet_change_protection = false
subnet_mappings {
subnet_id = aws_subnet.example.id
}
tags = {
Key = "Value"
}
vpc_id = aws_vpc.example.id
}
resource "aws_networkfirewall_rule_group" "example" {
capacity = 10
description = "Rule Group"
rule_group = {
rules_source = {
rules_source_list = {
generated_rules_type = ""
targets = [""]
target_types = [""]
}
rules_string = ""
stateful_rules = {
action = ""
header = {
destination = ""
destination_port = ""
direction = ""
protocol = ""
source = ""
source_port = ""
}
rule_options = {
keyword = ""
settings = [""]
}
}
stateless_rules_and_custom_actions = {
custom_actions = {
action_definition = {
}
}
stateless_rules = {
# ...
}
}
}
}
tags = {
Key = "Value"
}
type = "STATELESS"
}
resource "aws_networkfirewall_subnet_association" "example" {
firewall_arn = aws_networkfirewall_firewall.example.arn
firewall_name = aws_networkfirewall_firewall.example.firewall_name
subnet_mapping = {
subnet_id = aws_subnet.example.id
}
}
https://aws.amazon.com/blogs/aws/aws-network-firewall-new-managed-firewall-service-in-vpc/
Something's odd here, the launch announcement explicitly mentions Hashicorp and Terraform:
HashiCorp Terraform provides a declarative language for defining network protections for VPCs with AWS Network Firewall.
With HashiCorp Terraform customers can collaborate with others on their team to define firewall rules for fine-grained control over their network.
Within customers' configuration, they can also leverage AWS Firewall manager to build policies and use AWS Network Firewall to apply those policies across VPCs.
Maybe something needs merging?
@bentterp I think you're right. The code was probably under embargo - will close.
Going to re-open this so folks have a place to find this out, but yes, there is code that will appear today. 馃槃
This has been released in version 3.16.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!
Most helpful comment
Going to re-open this so folks have a place to find this out, but yes, there is code that will appear today. 馃槃