createTemplate

Creates a template. A template groups one or more rules to simplify reuse across policies. You can also associate rules with a policy directly, without a template. Use isPublished to create the template in published (ACTIVE) or draft (DRAFT) state.

Samples

// Creates a new WAF template in published (ACTIVE) state with an associated rule.
val resp = networkSecurityManagerClient.createTemplate {
    clientToken = "550e8400-e29b-41d4-a716-446655440004"
    templateName = "standard-waf-template"
    templateDescription = "Standard WAF template with baseline rule groups"
    firewallType = TemplateFirewallType.fromValue("WAF")
    associatedRuleList = listOf<RuleReference>(
        RuleReference {
            ruleIdentifier = "arn:aws:network-security-manager:us-east-1:123456789012:rule:abc123"
        }            
    )
    isPublished = true
}