[New Service]: AWS Network Security Manager

Author: ardittiCreated Sep 25, 2026Updated Sep 26, 2026
Labelsneeds-triage

What new functionality are you requesting?

  • Service: AWS Network Security Manager (networksecuritymanager)
  • aws_networksecuritymanager_admin_account
  • aws_networksecuritymanager_scope
  • aws_networksecuritymanager_rule
  • aws_networksecuritymanager_template
  • aws_networksecuritymanager_policy
  • aws_networksecuritymanager_deployment

Description

AWS Network Security Manager was announced generally available on 2026-09-24 (US East (N. Virginia)). It centrally deploys and continuously enforces AWS WAF and AWS Shield Advanced protections across an AWS Organization: a scope selects the accounts / OUs and resource types (AWS::CloudFront::Distribution, AWS::ElasticLoadBalancingV2::LoadBalancer::application, AWS::ApiGateway::Stage, AWS::EC2::EIP, AWS::ElasticLoadBalancing::LoadBalancer), rules and templates describe the WAF configuration, a policy (firewall type WAF or SHIELD_ADVANCED) binds templates/rules to remediation settings, and a deployment applies policies to a scope. The organization's management account delegates administration with PutAdminAccount.

The AWS SDK for Go v2 module service/networksecuritymanager v1.0.0 was released on 2026-09-23 (API version 2025-10-30, 46 operations, regional network-security-manager.<region>.api.aws endpoints with FIPS variants). The API Reference and AWS CLI (aws network-security-manager) are live. CloudFormation has no AWS::NetworkSecurityManager::* resource types yet, so the provider needs to talk to the service through the new SDK client.

Some API characteristics relevant to the resource design (verified against the live service):

  • Every entity (Scope, Rule, Template, Policy, Deployment) is versioned. Create* produces version 1 in status ACTIVE; Update* with isPublished = false creates a pending DRAFT version addressed by a :DRAFT-qualified ARN, while isPublished = true publishes it. While a draft exists the base ARN cannot be updated or deleted. The resources should publish on update by default so a Terraform-managed entity never carries a dangling draft.
  • Get*/Update*/Delete* take the full ARN as identifier (a bare id is rejected). Updates are guarded by an updateToken returned from the previous read/write.
  • All entities support tagging (ListTagsForResource / TagResource / UntagResource).

Potential Terraform Configuration

hcl
resource "aws_networksecuritymanager_scope" "example" {
  name = "production-edge"

  resource_scopes = {
    "AWS::CloudFront::Distribution" = {
      include_all = true
    }
    "AWS::ElasticLoadBalancingV2::LoadBalancer::application" = {
      include_all = true
    }
  }
}

resource "aws_networksecuritymanager_rule" "example" {
  name          = "common-rule-set"
  firewall_type = "WAF"
  rule_type     = "CONFIGURATION"
  configuration = jsonencode({
    # WAF rule configuration document
  })
}

resource "aws_networksecuritymanager_template" "example" {
  name          = "baseline"
  firewall_type = "WAF"

  rule {
    rule_arn = aws_networksecuritymanager_rule.example.arn
  }
}

resource "aws_networksecuritymanager_policy" "example" {
  name          = "baseline-waf"
  firewall_type = "WAF"
  priority      = 1

  template {
    template_arn = aws_networksecuritymanager_template.example.arn
  }

  policy_configuration {
    remediation_enabled = true
    resources_clean_up  = false

    waf_config {
      existing_customer_web_acl_resolution = "RETROFIT"
      conflict_resolution                  = "MERGE_WHERE_APPLICABLE"
    }
  }
}

resource "aws_networksecuritymanager_deployment" "example" {
  name = "production-edge-baseline"

  deployment_configuration {
    enable_cross_account_visibility = true
  }

  policy {
    policy_arn = aws_networksecuritymanager_policy.example.arn
  }

  scope {
    scope_arn = aws_networksecuritymanager_scope.example.arn
  }
}

References

Would you like to implement a change?

Yes — I'm contributing this per the new-service process: the service client first, then the resources one per pull request, starting with aws_networksecuritymanager_scope.

Source: hashicorp/terraform-provider-aws