published on Friday, Nov 13, 2026 by Pulumi
published on Friday, Nov 13, 2026 by Pulumi
Manages an AWS Network Security Manager Policy. A policy combines templates and rules with enforcement settings for a firewall type, such as AWS WAF or AWS Shield Advanced.
Changes to a policy are published unless isPublished is false.
Example Usage
AWS WAF Policy
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.networksecuritymanager.Policy("example", {
configuration: {
wafConfig: {
conflictResolution: "MERGE_WHERE_APPLICABLE",
existingCustomerWebAclResolution: "RETROFIT",
},
remediationEnabled: true,
resourcesCleanUp: true,
},
templateOrRules: [{
ruleIdentifier: exampleAwsNetworksecuritymanagerRule.arn,
}],
name: "baseline-waf",
firewallType: "WAF",
priority: 1,
});
import pulumi
import pulumi_aws as aws
example = aws.networksecuritymanager.Policy("example",
configuration={
"waf_config": {
"conflict_resolution": "MERGE_WHERE_APPLICABLE",
"existing_customer_web_acl_resolution": "RETROFIT",
},
"remediation_enabled": True,
"resources_clean_up": True,
},
template_or_rules=[{
"rule_identifier": example_aws_networksecuritymanager_rule["arn"],
}],
name="baseline-waf",
firewall_type="WAF",
priority=1)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/networksecuritymanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networksecuritymanager.NewPolicy(ctx, "example", &networksecuritymanager.PolicyArgs{
Configuration: &networksecuritymanager.PolicyConfigurationArgs{
WafConfig: &networksecuritymanager.PolicyConfigurationWafConfigArgs{
ConflictResolution: pulumi.String("MERGE_WHERE_APPLICABLE"),
ExistingCustomerWebAclResolution: pulumi.String("RETROFIT"),
},
RemediationEnabled: pulumi.Bool(true),
ResourcesCleanUp: pulumi.Bool(true),
},
TemplateOrRules: networksecuritymanager.PolicyTemplateOrRuleArray{
&networksecuritymanager.PolicyTemplateOrRuleArgs{
RuleIdentifier: pulumi.Any(exampleAwsNetworksecuritymanagerRule.Arn),
},
},
Name: pulumi.String("baseline-waf"),
FirewallType: pulumi.String("WAF"),
Priority: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.NetworkSecurityManager.Policy("example", new()
{
Configuration = new Aws.NetworkSecurityManager.Inputs.PolicyConfigurationArgs
{
WafConfig = new Aws.NetworkSecurityManager.Inputs.PolicyConfigurationWafConfigArgs
{
ConflictResolution = "MERGE_WHERE_APPLICABLE",
ExistingCustomerWebAclResolution = "RETROFIT",
},
RemediationEnabled = true,
ResourcesCleanUp = true,
},
TemplateOrRules = new[]
{
new Aws.NetworkSecurityManager.Inputs.PolicyTemplateOrRuleArgs
{
RuleIdentifier = exampleAwsNetworksecuritymanagerRule.Arn,
},
},
Name = "baseline-waf",
FirewallType = "WAF",
Priority = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.networksecuritymanager.Policy;
import com.pulumi.aws.networksecuritymanager.PolicyArgs;
import com.pulumi.aws.networksecuritymanager.inputs.PolicyConfigurationArgs;
import com.pulumi.aws.networksecuritymanager.inputs.PolicyConfigurationWafConfigArgs;
import com.pulumi.aws.networksecuritymanager.inputs.PolicyTemplateOrRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Policy("example", PolicyArgs.builder()
.configuration(PolicyConfigurationArgs.builder()
.wafConfig(PolicyConfigurationWafConfigArgs.builder()
.conflictResolution("MERGE_WHERE_APPLICABLE")
.existingCustomerWebAclResolution("RETROFIT")
.build())
.remediationEnabled(true)
.resourcesCleanUp(true)
.build())
.templateOrRules(PolicyTemplateOrRuleArgs.builder()
.ruleIdentifier(exampleAwsNetworksecuritymanagerRule.get("arn"))
.build())
.name("baseline-waf")
.firewallType("WAF")
.priority(1)
.build());
}
}
resources:
example:
type: aws:networksecuritymanager:Policy
properties:
configuration:
wafConfig:
conflictResolution: MERGE_WHERE_APPLICABLE
existingCustomerWebAclResolution: RETROFIT
remediationEnabled: true
resourcesCleanUp: true
templateOrRules:
- ruleIdentifier: ${exampleAwsNetworksecuritymanagerRule.arn}
name: baseline-waf
firewallType: WAF
priority: 1
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_networksecuritymanager_policy" "example" {
lifecycle {
create_before_destroy = true
}
configuration {
waf_config {
conflict_resolution = "MERGE_WHERE_APPLICABLE"
existing_customer_web_acl_resolution = "RETROFIT"
}
remediation_enabled = true
resources_clean_up = true
}
template_or_rule {
rule_identifier = exampleAwsNetworksecuritymanagerRule.arn
}
name = "baseline-waf"
firewall_type = "WAF"
priority = 1
}
AWS Shield Advanced Policy
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.networksecuritymanager.Policy("example", {
configuration: {
remediationEnabled: true,
resourcesCleanUp: true,
},
name: "baseline-shield",
firewallType: "SHIELD_ADVANCED",
priority: 2,
});
import pulumi
import pulumi_aws as aws
example = aws.networksecuritymanager.Policy("example",
configuration={
"remediation_enabled": True,
"resources_clean_up": True,
},
name="baseline-shield",
firewall_type="SHIELD_ADVANCED",
priority=2)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/networksecuritymanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networksecuritymanager.NewPolicy(ctx, "example", &networksecuritymanager.PolicyArgs{
Configuration: &networksecuritymanager.PolicyConfigurationArgs{
RemediationEnabled: pulumi.Bool(true),
ResourcesCleanUp: pulumi.Bool(true),
},
Name: pulumi.String("baseline-shield"),
FirewallType: pulumi.String("SHIELD_ADVANCED"),
Priority: pulumi.Int(2),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.NetworkSecurityManager.Policy("example", new()
{
Configuration = new Aws.NetworkSecurityManager.Inputs.PolicyConfigurationArgs
{
RemediationEnabled = true,
ResourcesCleanUp = true,
},
Name = "baseline-shield",
FirewallType = "SHIELD_ADVANCED",
Priority = 2,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.networksecuritymanager.Policy;
import com.pulumi.aws.networksecuritymanager.PolicyArgs;
import com.pulumi.aws.networksecuritymanager.inputs.PolicyConfigurationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Policy("example", PolicyArgs.builder()
.configuration(PolicyConfigurationArgs.builder()
.remediationEnabled(true)
.resourcesCleanUp(true)
.build())
.name("baseline-shield")
.firewallType("SHIELD_ADVANCED")
.priority(2)
.build());
}
}
resources:
example:
type: aws:networksecuritymanager:Policy
properties:
configuration:
remediationEnabled: true
resourcesCleanUp: true
name: baseline-shield
firewallType: SHIELD_ADVANCED
priority: 2
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_networksecuritymanager_policy" "example" {
lifecycle {
create_before_destroy = true
}
configuration {
remediation_enabled = true
resources_clean_up = true
}
name = "baseline-shield"
firewall_type = "SHIELD_ADVANCED"
priority = 2
}
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);@overload
def Policy(resource_name: str,
args: PolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
opts: Optional[ResourceOptions] = None,
configuration: Optional[PolicyConfigurationArgs] = None,
firewall_type: Optional[str] = None,
priority: Optional[int] = None,
description: Optional[str] = None,
is_published: Optional[bool] = None,
name: Optional[str] = None,
region: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
template_or_rules: Optional[Sequence[PolicyTemplateOrRuleArgs]] = None)func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: aws:networksecuritymanager:Policy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws_networksecuritymanager_policy" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplepolicyResourceResourceFromNetworksecuritymanagerpolicy = new Aws.NetworkSecurityManager.Policy("examplepolicyResourceResourceFromNetworksecuritymanagerpolicy", new()
{
Configuration = new Aws.NetworkSecurityManager.Inputs.PolicyConfigurationArgs
{
RemediationEnabled = false,
ResourcesCleanUp = false,
WafConfig = new Aws.NetworkSecurityManager.Inputs.PolicyConfigurationWafConfigArgs
{
ConflictResolution = "string",
ExistingCustomerWebAclResolution = "string",
},
},
FirewallType = "string",
Priority = 0,
Description = "string",
IsPublished = false,
Name = "string",
Region = "string",
Tags =
{
{ "string", "string" },
},
TemplateOrRules = new[]
{
new Aws.NetworkSecurityManager.Inputs.PolicyTemplateOrRuleArgs
{
RuleIdentifier = "string",
TemplateIdentifier = "string",
},
},
});
example, err := networksecuritymanager.NewPolicy(ctx, "examplepolicyResourceResourceFromNetworksecuritymanagerpolicy", &networksecuritymanager.PolicyArgs{
Configuration: &networksecuritymanager.PolicyConfigurationArgs{
RemediationEnabled: pulumi.Bool(false),
ResourcesCleanUp: pulumi.Bool(false),
WafConfig: &networksecuritymanager.PolicyConfigurationWafConfigArgs{
ConflictResolution: pulumi.String("string"),
ExistingCustomerWebAclResolution: pulumi.String("string"),
},
},
FirewallType: pulumi.String("string"),
Priority: pulumi.Int(0),
Description: pulumi.String("string"),
IsPublished: pulumi.Bool(false),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
TemplateOrRules: networksecuritymanager.PolicyTemplateOrRuleArray{
&networksecuritymanager.PolicyTemplateOrRuleArgs{
RuleIdentifier: pulumi.String("string"),
TemplateIdentifier: pulumi.String("string"),
},
},
})
resource "aws_networksecuritymanager_policy" "examplepolicyResourceResourceFromNetworksecuritymanagerpolicy" {
lifecycle {
create_before_destroy = true
}
configuration = {
remediation_enabled = false
resources_clean_up = false
waf_config = {
conflict_resolution = "string"
existing_customer_web_acl_resolution = "string"
}
}
firewall_type = "string"
priority = 0
description = "string"
is_published = false
name = "string"
region = "string"
tags = {
"string" = "string"
}
template_or_rules {
rule_identifier = "string"
template_identifier = "string"
}
}
var examplepolicyResourceResourceFromNetworksecuritymanagerpolicy = new com.pulumi.aws.networksecuritymanager.Policy("examplepolicyResourceResourceFromNetworksecuritymanagerpolicy", com.pulumi.aws.networksecuritymanager.PolicyArgs.builder()
.configuration(PolicyConfigurationArgs.builder()
.remediationEnabled(false)
.resourcesCleanUp(false)
.wafConfig(PolicyConfigurationWafConfigArgs.builder()
.conflictResolution("string")
.existingCustomerWebAclResolution("string")
.build())
.build())
.firewallType("string")
.priority(0)
.description("string")
.isPublished(false)
.name("string")
.region("string")
.tags(Map.of("string", "string"))
.templateOrRules(PolicyTemplateOrRuleArgs.builder()
.ruleIdentifier("string")
.templateIdentifier("string")
.build())
.build());
examplepolicy_resource_resource_from_networksecuritymanagerpolicy = aws.networksecuritymanager.Policy("examplepolicyResourceResourceFromNetworksecuritymanagerpolicy",
configuration={
"remediation_enabled": False,
"resources_clean_up": False,
"waf_config": {
"conflict_resolution": "string",
"existing_customer_web_acl_resolution": "string",
},
},
firewall_type="string",
priority=0,
description="string",
is_published=False,
name="string",
region="string",
tags={
"string": "string",
},
template_or_rules=[{
"rule_identifier": "string",
"template_identifier": "string",
}])
const examplepolicyResourceResourceFromNetworksecuritymanagerpolicy = new aws.networksecuritymanager.Policy("examplepolicyResourceResourceFromNetworksecuritymanagerpolicy", {
configuration: {
remediationEnabled: false,
resourcesCleanUp: false,
wafConfig: {
conflictResolution: "string",
existingCustomerWebAclResolution: "string",
},
},
firewallType: "string",
priority: 0,
description: "string",
isPublished: false,
name: "string",
region: "string",
tags: {
string: "string",
},
templateOrRules: [{
ruleIdentifier: "string",
templateIdentifier: "string",
}],
});
type: aws:networksecuritymanager:Policy
properties:
configuration:
remediationEnabled: false
resourcesCleanUp: false
wafConfig:
conflictResolution: string
existingCustomerWebAclResolution: string
description: string
firewallType: string
isPublished: false
name: string
priority: 0
region: string
tags:
string: string
templateOrRules:
- ruleIdentifier: string
templateIdentifier: string
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Policy resource accepts the following input properties:
- Configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - Firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - Priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- Description string
- Description of the policy.
- Is
Published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the policy. Changing this value forces a new resource.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Template
Or List<PolicyRules Template Or Rule> Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- Configuration
Policy
Configuration Args - Settings that control the policy's behavior. See
configurationbelow. - Firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - Priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- Description string
- Description of the policy.
- Is
Published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the policy. Changing this value forces a new resource.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Template
Or []PolicyRules Template Or Rule Args Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- configuration object
- Settings that control the policy's behavior. See
configurationbelow. - firewall_
type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - priority number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- description string
- Description of the policy.
- is_
published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the policy. Changing this value forces a new resource.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map(string)
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - template_
or_ list(object)rules Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - firewall
Type String - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - priority Integer
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- description String
- Description of the policy.
- is
Published Boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the policy. Changing this value forces a new resource.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - template
Or List<PolicyRules Template Or Rule> Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - priority number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- description string
- Description of the policy.
- is
Published boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the policy. Changing this value forces a new resource.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - template
Or PolicyRules Template Or Rule[] Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- configuration
Policy
Configuration Args - Settings that control the policy's behavior. See
configurationbelow. - firewall_
type str - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- description str
- Description of the policy.
- is_
published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name str
- Name of the policy. Changing this value forces a new resource.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - template_
or_ Sequence[Policyrules Template Or Rule Args] Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- configuration Property Map
- Settings that control the policy's behavior. See
configurationbelow. - firewall
Type String - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - priority Number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- description String
- Description of the policy.
- is
Published Boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the policy. Changing this value forces a new resource.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - template
Or List<Property Map>Rules Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
Look up Existing Policy Resource
Get an existing Policy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PolicyState, opts?: CustomResourceOptions): Policy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
configuration: Optional[PolicyConfigurationArgs] = None,
description: Optional[str] = None,
firewall_type: Optional[str] = None,
is_published: Optional[bool] = None,
name: Optional[str] = None,
priority: Optional[int] = None,
region: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
template_or_rules: Optional[Sequence[PolicyTemplateOrRuleArgs]] = None) -> Policyfunc GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)resources: existingPolicy: type: aws:networksecuritymanager:Policy get: id: ${id}import {
to = aws_networksecuritymanager_policy.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state PolicyState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state PolicyState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state PolicyState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state PolicyState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Arn string
- ARN of the policy.
- Configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - Description string
- Description of the policy.
- Firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - Is
Published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the policy. Changing this value forces a new resource.
- Priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - Template
Or List<PolicyRules Template Or Rule> Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- Arn string
- ARN of the policy.
- Configuration
Policy
Configuration Args - Settings that control the policy's behavior. See
configurationbelow. - Description string
- Description of the policy.
- Firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - Is
Published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the policy. Changing this value forces a new resource.
- Priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - Template
Or []PolicyRules Template Or Rule Args Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- arn string
- ARN of the policy.
- configuration object
- Settings that control the policy's behavior. See
configurationbelow. - description string
- Description of the policy.
- firewall_
type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - is_
published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the policy. Changing this value forces a new resource.
- priority number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map(string)
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - map(string)
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - template_
or_ list(object)rules Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- arn String
- ARN of the policy.
- configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - description String
- Description of the policy.
- firewall
Type String - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - is
Published Boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the policy. Changing this value forces a new resource.
- priority Integer
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - template
Or List<PolicyRules Template Or Rule> Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- arn string
- ARN of the policy.
- configuration
Policy
Configuration - Settings that control the policy's behavior. See
configurationbelow. - description string
- Description of the policy.
- firewall
Type string - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - is
Published boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the policy. Changing this value forces a new resource.
- priority number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - template
Or PolicyRules Template Or Rule[] Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- arn str
- ARN of the policy.
- configuration
Policy
Configuration Args - Settings that control the policy's behavior. See
configurationbelow. - description str
- Description of the policy.
- firewall_
type str - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - is_
published bool - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name str
- Name of the policy. Changing this value forces a new resource.
- priority int
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - template_
or_ Sequence[Policyrules Template Or Rule Args] Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
- arn String
- ARN of the policy.
- configuration Property Map
- Settings that control the policy's behavior. See
configurationbelow. - description String
- Description of the policy.
- firewall
Type String - Firewall type of the policy. Valid values:
WAF,SHIELD_ADVANCED. Changing this value forces a new resource. - is
Published Boolean - Whether to publish the policy. When
true, the policy is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published policy, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the policy. Changing this value forces a new resource.
- priority Number
Priority of the policy. A lower number indicates a higher priority. Minimum value of
1. Must be unique across policies in the AWS account.The following arguments are optional:
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block. - template
Or List<Property Map>Rules Ordered list of templates and rules to associate with the policy. For
WAFpolicies, specify 1 to 100 entries, of which at most 2 can be templates. Must be omitted forSHIELD_ADVANCEDpolicies. SeetemplateOrRulebelow.Note: A rule or template referenced by a published policy cannot be deleted. Configure
createBeforeDestroyon referenced rule and template resources so that a replacement is associated with the policy before the old resource is deleted.
Supporting Types
PolicyConfiguration, PolicyConfigurationArgs
- Remediation
Enabled bool - Whether to automatically remediate noncompliant resources.
- Resources
Clean boolUp - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - Waf
Config PolicyConfiguration Waf Config - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- Remediation
Enabled bool - Whether to automatically remediate noncompliant resources.
- Resources
Clean boolUp - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - Waf
Config PolicyConfiguration Waf Config - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- remediation_
enabled bool - Whether to automatically remediate noncompliant resources.
- resources_
clean_ boolup - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - waf_
config object - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- remediation
Enabled Boolean - Whether to automatically remediate noncompliant resources.
- resources
Clean BooleanUp - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - waf
Config PolicyConfiguration Waf Config - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- remediation
Enabled boolean - Whether to automatically remediate noncompliant resources.
- resources
Clean booleanUp - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - waf
Config PolicyConfiguration Waf Config - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- remediation_
enabled bool - Whether to automatically remediate noncompliant resources.
- resources_
clean_ boolup - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - waf_
config PolicyConfiguration Waf Config - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
- remediation
Enabled Boolean - Whether to automatically remediate noncompliant resources.
- resources
Clean BooleanUp - Whether to automatically remove the resources the service created when they are no longer needed. The service currently only accepts
true. - waf
Config Property Map - AWS WAF-specific settings. Required for
WAFpolicies. SeewafConfigbelow.
PolicyConfigurationWafConfig, PolicyConfigurationWafConfigArgs
- Conflict
Resolution string - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - Existing
Customer stringWeb Acl Resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- Conflict
Resolution string - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - Existing
Customer stringWeb Acl Resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- conflict_
resolution string - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - existing_
customer_ stringweb_ acl_ resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- conflict
Resolution String - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - existing
Customer StringWeb Acl Resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- conflict
Resolution string - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - existing
Customer stringWeb Acl Resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- conflict_
resolution str - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - existing_
customer_ strweb_ acl_ resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
- conflict
Resolution String - Conflict-resolution strategy. Valid values:
MERGE_WHERE_APPLICABLE. - existing
Customer StringWeb Acl Resolution - How remediation is handled when a resource already has a customer-created web ACL. Valid values:
RETROFIT,OVERRIDE_ASSOCIATION,NO_REMEDIATION.
PolicyTemplateOrRule, PolicyTemplateOrRuleArgs
- Rule
Identifier string - ARN of the rule.
- Template
Identifier string - ARN of the template.
- Rule
Identifier string - ARN of the rule.
- Template
Identifier string - ARN of the template.
- rule_
identifier string - ARN of the rule.
- template_
identifier string - ARN of the template.
- rule
Identifier String - ARN of the rule.
- template
Identifier String - ARN of the template.
- rule
Identifier string - ARN of the rule.
- template
Identifier string - ARN of the template.
- rule_
identifier str - ARN of the rule.
- template_
identifier str - ARN of the template.
- rule
Identifier String - ARN of the rule.
- template
Identifier String - ARN of the template.
Import
Identity Schema
Required
arn(String) ARN of the policy.
Using pulumi import, import Network Security Manager Policy using the arn. For example:
$ pulumi import aws:networksecuritymanager/policy:Policy example arn:aws:network-security-manager:us-east-1:123456789012:policy:abcd1234efgh
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Friday, Nov 13, 2026 by Pulumi