zia.DLPNotificationTemplates
Explore with Pulumi AI
The zia_dlp_notification_templates resource allows the creation and management of ZIA DLP Notification Templates in the Zscaler Internet Access cloud or via the API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as zia from "@bdzscaler/pulumi-zia";
const example = new zia.DLPNotificationTemplates("example", {
subject: `DLP Violation: ${TRANSACTION_ID} ${ENGINES}`,
attachContent: true,
tlsEnabled: true,
htmlMessage: fs.readFileSync("./index.html", "utf8"),
plainTextMessage: fs.readFileSync("./dlp.txt", "utf8"),
});
import pulumi
import zscaler_pulumi_zia as zia
example = zia.DLPNotificationTemplates("example",
subject=f"DLP Violation: {transactio_n__id} {engines}",
attach_content=True,
tls_enabled=True,
html_message=(lambda path: open(path).read())("./index.html"),
plain_text_message=(lambda path: open(path).read())("./dlp.txt"))
package main
import (
"fmt"
"os"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/zscaler/pulumi-zia/sdk/go/zia"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := zia.NewDLPNotificationTemplates(ctx, "example", &zia.DLPNotificationTemplatesArgs{
Subject: pulumi.String(fmt.Sprintf("DLP Violation: %v %v", TRANSACTION_ID, ENGINES)),
AttachContent: pulumi.Bool(true),
TlsEnabled: pulumi.Bool(true),
HtmlMessage: pulumi.String(readFileOrPanic("./index.html")),
PlainTextMessage: pulumi.String(readFileOrPanic("./dlp.txt")),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Zia = zscaler.PulumiPackage.Zia;
return await Deployment.RunAsync(() =>
{
var example = new Zia.DLPNotificationTemplates("example", new()
{
Subject = $"DLP Violation: {TRANSACTION_ID} {ENGINES}",
AttachContent = true,
TlsEnabled = true,
HtmlMessage = File.ReadAllText("./index.html"),
PlainTextMessage = File.ReadAllText("./dlp.txt"),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zia.DLPNotificationTemplates;
import com.pulumi.zia.DLPNotificationTemplatesArgs;
import java.util.List;
import java.util.ArrayList;
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 DLPNotificationTemplates("example", DLPNotificationTemplatesArgs.builder()
.subject(String.format("DLP Violation: %s %s", TRANSACTION_ID,ENGINES))
.attachContent(true)
.tlsEnabled(true)
.htmlMessage(Files.readString(Paths.get("./index.html")))
.plainTextMessage(Files.readString(Paths.get("./dlp.txt")))
.build());
}
}
resources:
example:
type: zia:DLPNotificationTemplates
properties:
subject: 'DLP Violation: ${TRANSACTION_ID} ${ENGINES}'
attachContent: true
tlsEnabled: true
htmlMessage:
fn::readFile: ./index.html
plainTextMessage:
fn::readFile: ./dlp.txt
Create DLPNotificationTemplates Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DLPNotificationTemplates(name: string, args: DLPNotificationTemplatesArgs, opts?: CustomResourceOptions);
@overload
def DLPNotificationTemplates(resource_name: str,
args: DLPNotificationTemplatesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DLPNotificationTemplates(resource_name: str,
opts: Optional[ResourceOptions] = None,
html_message: Optional[str] = None,
plain_text_message: Optional[str] = None,
subject: Optional[str] = None,
attach_content: Optional[bool] = None,
name: Optional[str] = None,
tls_enabled: Optional[bool] = None)
func NewDLPNotificationTemplates(ctx *Context, name string, args DLPNotificationTemplatesArgs, opts ...ResourceOption) (*DLPNotificationTemplates, error)
public DLPNotificationTemplates(string name, DLPNotificationTemplatesArgs args, CustomResourceOptions? opts = null)
public DLPNotificationTemplates(String name, DLPNotificationTemplatesArgs args)
public DLPNotificationTemplates(String name, DLPNotificationTemplatesArgs args, CustomResourceOptions options)
type: zia:DLPNotificationTemplates
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DLPNotificationTemplatesArgs
- 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 DLPNotificationTemplatesArgs
- 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 DLPNotificationTemplatesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DLPNotificationTemplatesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DLPNotificationTemplatesArgs
- 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 dlpnotificationTemplatesResource = new Zia.DLPNotificationTemplates("dlpnotificationTemplatesResource", new()
{
HtmlMessage = "string",
PlainTextMessage = "string",
Subject = "string",
AttachContent = false,
Name = "string",
TlsEnabled = false,
});
example, err := zia.NewDLPNotificationTemplates(ctx, "dlpnotificationTemplatesResource", &zia.DLPNotificationTemplatesArgs{
HtmlMessage: pulumi.String("string"),
PlainTextMessage: pulumi.String("string"),
Subject: pulumi.String("string"),
AttachContent: pulumi.Bool(false),
Name: pulumi.String("string"),
TlsEnabled: pulumi.Bool(false),
})
var dlpnotificationTemplatesResource = new DLPNotificationTemplates("dlpnotificationTemplatesResource", DLPNotificationTemplatesArgs.builder()
.htmlMessage("string")
.plainTextMessage("string")
.subject("string")
.attachContent(false)
.name("string")
.tlsEnabled(false)
.build());
dlpnotification_templates_resource = zia.DLPNotificationTemplates("dlpnotificationTemplatesResource",
html_message="string",
plain_text_message="string",
subject="string",
attach_content=False,
name="string",
tls_enabled=False)
const dlpnotificationTemplatesResource = new zia.DLPNotificationTemplates("dlpnotificationTemplatesResource", {
htmlMessage: "string",
plainTextMessage: "string",
subject: "string",
attachContent: false,
name: "string",
tlsEnabled: false,
});
type: zia:DLPNotificationTemplates
properties:
attachContent: false
htmlMessage: string
name: string
plainTextMessage: string
subject: string
tlsEnabled: false
DLPNotificationTemplates 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 DLPNotificationTemplates resource accepts the following input properties:
- Html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- Plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- Subject string
- The Subject line that is displayed within the DLP notification email
- Attach
Content bool - f set to true, the content that is violation is attached to the DLP notification email
- Name string
- The DLP notification template name
- Tls
Enabled bool - If set to true, TLS will be enabled
- Html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- Plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- Subject string
- The Subject line that is displayed within the DLP notification email
- Attach
Content bool - f set to true, the content that is violation is attached to the DLP notification email
- Name string
- The DLP notification template name
- Tls
Enabled bool - If set to true, TLS will be enabled
- html
Message String - The template for the HTML message body that must be displayed in the DLP notification email
- plain
Text StringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject String
- The Subject line that is displayed within the DLP notification email
- attach
Content Boolean - f set to true, the content that is violation is attached to the DLP notification email
- name String
- The DLP notification template name
- tls
Enabled Boolean - If set to true, TLS will be enabled
- html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject string
- The Subject line that is displayed within the DLP notification email
- attach
Content boolean - f set to true, the content that is violation is attached to the DLP notification email
- name string
- The DLP notification template name
- tls
Enabled boolean - If set to true, TLS will be enabled
- html_
message str - The template for the HTML message body that must be displayed in the DLP notification email
- plain_
text_ strmessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject str
- The Subject line that is displayed within the DLP notification email
- attach_
content bool - f set to true, the content that is violation is attached to the DLP notification email
- name str
- The DLP notification template name
- tls_
enabled bool - If set to true, TLS will be enabled
- html
Message String - The template for the HTML message body that must be displayed in the DLP notification email
- plain
Text StringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject String
- The Subject line that is displayed within the DLP notification email
- attach
Content Boolean - f set to true, the content that is violation is attached to the DLP notification email
- name String
- The DLP notification template name
- tls
Enabled Boolean - If set to true, TLS will be enabled
Outputs
All input properties are implicitly available as output properties. Additionally, the DLPNotificationTemplates resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Template
Id int - The unique identifier for a DLP notification template
- Id string
- The provider-assigned unique ID for this managed resource.
- Template
Id int - The unique identifier for a DLP notification template
- id String
- The provider-assigned unique ID for this managed resource.
- template
Id Integer - The unique identifier for a DLP notification template
- id string
- The provider-assigned unique ID for this managed resource.
- template
Id number - The unique identifier for a DLP notification template
- id str
- The provider-assigned unique ID for this managed resource.
- template_
id int - The unique identifier for a DLP notification template
- id String
- The provider-assigned unique ID for this managed resource.
- template
Id Number - The unique identifier for a DLP notification template
Look up Existing DLPNotificationTemplates Resource
Get an existing DLPNotificationTemplates 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?: DLPNotificationTemplatesState, opts?: CustomResourceOptions): DLPNotificationTemplates
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attach_content: Optional[bool] = None,
html_message: Optional[str] = None,
name: Optional[str] = None,
plain_text_message: Optional[str] = None,
subject: Optional[str] = None,
template_id: Optional[int] = None,
tls_enabled: Optional[bool] = None) -> DLPNotificationTemplates
func GetDLPNotificationTemplates(ctx *Context, name string, id IDInput, state *DLPNotificationTemplatesState, opts ...ResourceOption) (*DLPNotificationTemplates, error)
public static DLPNotificationTemplates Get(string name, Input<string> id, DLPNotificationTemplatesState? state, CustomResourceOptions? opts = null)
public static DLPNotificationTemplates get(String name, Output<String> id, DLPNotificationTemplatesState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Attach
Content bool - f set to true, the content that is violation is attached to the DLP notification email
- Html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- Name string
- The DLP notification template name
- Plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- Subject string
- The Subject line that is displayed within the DLP notification email
- Template
Id int - The unique identifier for a DLP notification template
- Tls
Enabled bool - If set to true, TLS will be enabled
- Attach
Content bool - f set to true, the content that is violation is attached to the DLP notification email
- Html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- Name string
- The DLP notification template name
- Plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- Subject string
- The Subject line that is displayed within the DLP notification email
- Template
Id int - The unique identifier for a DLP notification template
- Tls
Enabled bool - If set to true, TLS will be enabled
- attach
Content Boolean - f set to true, the content that is violation is attached to the DLP notification email
- html
Message String - The template for the HTML message body that must be displayed in the DLP notification email
- name String
- The DLP notification template name
- plain
Text StringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject String
- The Subject line that is displayed within the DLP notification email
- template
Id Integer - The unique identifier for a DLP notification template
- tls
Enabled Boolean - If set to true, TLS will be enabled
- attach
Content boolean - f set to true, the content that is violation is attached to the DLP notification email
- html
Message string - The template for the HTML message body that must be displayed in the DLP notification email
- name string
- The DLP notification template name
- plain
Text stringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject string
- The Subject line that is displayed within the DLP notification email
- template
Id number - The unique identifier for a DLP notification template
- tls
Enabled boolean - If set to true, TLS will be enabled
- attach_
content bool - f set to true, the content that is violation is attached to the DLP notification email
- html_
message str - The template for the HTML message body that must be displayed in the DLP notification email
- name str
- The DLP notification template name
- plain_
text_ strmessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject str
- The Subject line that is displayed within the DLP notification email
- template_
id int - The unique identifier for a DLP notification template
- tls_
enabled bool - If set to true, TLS will be enabled
- attach
Content Boolean - f set to true, the content that is violation is attached to the DLP notification email
- html
Message String - The template for the HTML message body that must be displayed in the DLP notification email
- name String
- The DLP notification template name
- plain
Text StringMessage - The template for the plain text UTF-8 message body that must be displayed in the DLP notification email
- subject String
- The Subject line that is displayed within the DLP notification email
- template
Id Number - The unique identifier for a DLP notification template
- tls
Enabled Boolean - If set to true, TLS will be enabled
Import
Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language.
Visit
zia_dlp_notification_templates can be imported by using <TEMPLATE ID>
or <TEMPLATE NAME>
as the import ID.
For example:
$ pulumi import zia:index/dLPNotificationTemplates:DLPNotificationTemplates example <template_id>
or
$ pulumi import zia:index/dLPNotificationTemplates:DLPNotificationTemplates example <template_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zia zscaler/pulumi-zia
- License
- MIT
- Notes
- This Pulumi package is based on the
zia
Terraform Provider.