published on Friday, Nov 13, 2026 by Pulumi
published on Friday, Nov 13, 2026 by Pulumi
Manages an AWS Network Security Manager Template. A template groups one or more rules so they can be reused across policies.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.networksecuritymanager.Rule("example", {
name: "example",
firewallType: "WAF",
type: "CONFIGURATION",
configuration: JSON.stringify({
DefaultAction: {
Allow: {},
},
}),
});
const exampleTemplate = new aws.networksecuritymanager.Template("example", {
name: "example",
description: "Baseline web ACL settings",
firewallType: "WAF",
ruleArns: [example.arn],
});
import pulumi
import json
import pulumi_aws as aws
example = aws.networksecuritymanager.Rule("example",
name="example",
firewall_type="WAF",
type="CONFIGURATION",
configuration=json.dumps({
"DefaultAction": {
"Allow": {},
},
}))
example_template = aws.networksecuritymanager.Template("example",
name="example",
description="Baseline web ACL settings",
firewall_type="WAF",
rule_arns=[example.arn])
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]map[string]map[string]interface{}{
"DefaultAction": map[string]map[string]interface{}{
"Allow": map[string]interface{}{},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
example, err := networksecuritymanager.NewRule(ctx, "example", &networksecuritymanager.RuleArgs{
Name: pulumi.String("example"),
FirewallType: pulumi.String("WAF"),
Type: pulumi.String("CONFIGURATION"),
Configuration: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = networksecuritymanager.NewTemplate(ctx, "example", &networksecuritymanager.TemplateArgs{
Name: pulumi.String("example"),
Description: pulumi.String("Baseline web ACL settings"),
FirewallType: pulumi.String("WAF"),
RuleArns: pulumi.StringArray{
example.Arn,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.NetworkSecurityManager.Rule("example", new()
{
Name = "example",
FirewallType = "WAF",
Type = "CONFIGURATION",
Configuration = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["DefaultAction"] = new Dictionary<string, object?>
{
["Allow"] = new Dictionary<string, object?>
{
},
},
}),
});
var exampleTemplate = new Aws.NetworkSecurityManager.Template("example", new()
{
Name = "example",
Description = "Baseline web ACL settings",
FirewallType = "WAF",
RuleArns = new[]
{
example.Arn,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.networksecuritymanager.Rule;
import com.pulumi.aws.networksecuritymanager.RuleArgs;
import com.pulumi.aws.networksecuritymanager.Template;
import com.pulumi.aws.networksecuritymanager.TemplateArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 Rule("example", RuleArgs.builder()
.name("example")
.firewallType("WAF")
.type("CONFIGURATION")
.configuration(serializeJson(
jsonObject(
jsonProperty("DefaultAction", jsonObject(
jsonProperty("Allow", jsonObject(
))
))
)))
.build());
var exampleTemplate = new Template("exampleTemplate", TemplateArgs.builder()
.name("example")
.description("Baseline web ACL settings")
.firewallType("WAF")
.ruleArns(example.arn())
.build());
}
}
resources:
example:
type: aws:networksecuritymanager:Rule
properties:
name: example
firewallType: WAF
type: CONFIGURATION
configuration:
fn::toJSON:
DefaultAction:
Allow: {}
exampleTemplate:
type: aws:networksecuritymanager:Template
name: example
properties:
name: example
description: Baseline web ACL settings
firewallType: WAF
ruleArns:
- ${example.arn}
terraform {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_networksecuritymanager_rule" "example" {
lifecycle {
create_before_destroy = true
}
name = "example"
firewall_type = "WAF"
type = "CONFIGURATION"
configuration = jsonencode({
"DefaultAction" = {
"Allow" = {}
}
})
}
resource "aws_networksecuritymanager_template" "example" {
lifecycle {
create_before_destroy = true
}
name = "example"
description = "Baseline web ACL settings"
firewall_type = "WAF"
rule_arns = [aws_networksecuritymanager_rule.example.arn]
}
Create Template Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Template(name: string, args: TemplateArgs, opts?: CustomResourceOptions);@overload
def Template(resource_name: str,
args: TemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Template(resource_name: str,
opts: Optional[ResourceOptions] = None,
firewall_type: Optional[str] = None,
rule_arns: Optional[Sequence[str]] = None,
description: Optional[str] = None,
is_published: Optional[bool] = None,
name: Optional[str] = None,
region: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)func NewTemplate(ctx *Context, name string, args TemplateArgs, opts ...ResourceOption) (*Template, error)public Template(string name, TemplateArgs args, CustomResourceOptions? opts = null)
public Template(String name, TemplateArgs args)
public Template(String name, TemplateArgs args, CustomResourceOptions options)
type: aws:networksecuritymanager:Template
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws_networksecuritymanager_template" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args TemplateArgs
- 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 TemplateArgs
- 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 TemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TemplateArgs
- 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 templateResource = new Aws.NetworkSecurityManager.Template("templateResource", new()
{
FirewallType = "string",
RuleArns = new[]
{
"string",
},
Description = "string",
IsPublished = false,
Name = "string",
Region = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := networksecuritymanager.NewTemplate(ctx, "templateResource", &networksecuritymanager.TemplateArgs{
FirewallType: pulumi.String("string"),
RuleArns: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
IsPublished: pulumi.Bool(false),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
resource "aws_networksecuritymanager_template" "templateResource" {
lifecycle {
create_before_destroy = true
}
firewall_type = "string"
rule_arns = ["string"]
description = "string"
is_published = false
name = "string"
region = "string"
tags = {
"string" = "string"
}
}
var templateResource = new com.pulumi.aws.networksecuritymanager.Template("templateResource", com.pulumi.aws.networksecuritymanager.TemplateArgs.builder()
.firewallType("string")
.ruleArns("string")
.description("string")
.isPublished(false)
.name("string")
.region("string")
.tags(Map.of("string", "string"))
.build());
template_resource = aws.networksecuritymanager.Template("templateResource",
firewall_type="string",
rule_arns=["string"],
description="string",
is_published=False,
name="string",
region="string",
tags={
"string": "string",
})
const templateResource = new aws.networksecuritymanager.Template("templateResource", {
firewallType: "string",
ruleArns: ["string"],
description: "string",
isPublished: false,
name: "string",
region: "string",
tags: {
string: "string",
},
});
type: aws:networksecuritymanager:Template
properties:
description: string
firewallType: string
isPublished: false
name: string
region: string
ruleArns:
- string
tags:
string: string
Template 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 Template resource accepts the following input properties:
- Firewall
Type string - Firewall type of the template. Valid values:
WAF. - Rule
Arns List<string> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Description string
- Description of the template.
- Is
Published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the template.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Firewall
Type string - Firewall type of the template. Valid values:
WAF. - Rule
Arns []string Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Description string
- Description of the template.
- Is
Published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the template.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- firewall_
type string - Firewall type of the template. Valid values:
WAF. - rule_
arns list(string) Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- description string
- Description of the template.
- is_
published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the template.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map(string)
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- firewall
Type String - Firewall type of the template. Valid values:
WAF. - rule
Arns List<String> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- description String
- Description of the template.
- is
Published Boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the template.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- firewall
Type string - Firewall type of the template. Valid values:
WAF. - rule
Arns string[] Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- description string
- Description of the template.
- is
Published boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the template.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- firewall_
type str - Firewall type of the template. Valid values:
WAF. - rule_
arns Sequence[str] Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- description str
- Description of the template.
- is_
published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name str
- Name of the template.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- firewall
Type String - Firewall type of the template. Valid values:
WAF. - rule
Arns List<String> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- description String
- Description of the template.
- is
Published Boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the template.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- Map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Template resource produces the following output properties:
Look up Existing Template Resource
Get an existing Template 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?: TemplateState, opts?: CustomResourceOptions): Template@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
description: Optional[str] = None,
firewall_type: Optional[str] = None,
is_published: Optional[bool] = None,
name: Optional[str] = None,
region: Optional[str] = None,
rule_arns: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Templatefunc GetTemplate(ctx *Context, name string, id IDInput, state *TemplateState, opts ...ResourceOption) (*Template, error)public static Template Get(string name, Input<string> id, TemplateState? state, CustomResourceOptions? opts = null)public static Template get(String name, Output<String> id, TemplateState state, CustomResourceOptions options)resources: existingTemplate: type: aws:networksecuritymanager:Template get: id: ${id}import {
to = aws_networksecuritymanager_template.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 TemplateState
- 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 TemplateState
- 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 TemplateState
- 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 TemplateState
- 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 template.
- Description string
- Description of the template.
- Firewall
Type string - Firewall type of the template. Valid values:
WAF. - Is
Published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the template.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rule
Arns List<string> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Dictionary<string, string>
- Map of tags to assign 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.
- Arn string
- ARN of the template.
- Description string
- Description of the template.
- Firewall
Type string - Firewall type of the template. Valid values:
WAF. - Is
Published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - Name string
- Name of the template.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rule
Arns []string Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- map[string]string
- Map of tags to assign 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.
- arn string
- ARN of the template.
- description string
- Description of the template.
- firewall_
type string - Firewall type of the template. Valid values:
WAF. - is_
published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the template.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule_
arns list(string) Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- map(string)
- Map of tags to assign 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.
- arn String
- ARN of the template.
- description String
- Description of the template.
- firewall
Type String - Firewall type of the template. Valid values:
WAF. - is
Published Boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the template.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Arns List<String> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Map<String,String>
- Map of tags to assign 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.
- arn string
- ARN of the template.
- description string
- Description of the template.
- firewall
Type string - Firewall type of the template. Valid values:
WAF. - is
Published boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name string
- Name of the template.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Arns string[] Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- {[key: string]: string}
- Map of tags to assign 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.
- arn str
- ARN of the template.
- description str
- Description of the template.
- firewall_
type str - Firewall type of the template. Valid values:
WAF. - is_
published bool - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name str
- Name of the template.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule_
arns Sequence[str] Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Mapping[str, str]
- Map of tags to assign 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.
- arn String
- ARN of the template.
- description String
- Description of the template.
- firewall
Type String - Firewall type of the template. Valid values:
WAF. - is
Published Boolean - Whether to publish the template. When
true, the template is saved in the published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT); for a published template, the draft is saved on top of the published version. Defaults totrue. - name String
- Name of the template.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Arns List<String> Ordered list of ARNs of the rules to associate with the template. Specify 1 to 50 rules. Each rule can be associated only once.
The following arguments are optional:
- Map<String>
- Map of tags to assign 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.
Import
Identity Schema
Required
arn(String) ARN of the template.
Using pulumi import, import Network Security Manager Template using the arn. For example:
$ pulumi import aws:networksecuritymanager/template:Template example arn:aws:network-security-manager:us-east-1:123456789012:template:0123456789abcdef
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