1. Packages
  2. Zscaler Internet Access (ZIA)
  3. API Docs
  4. DLPNotificationTemplates
Zscaler Internet Access v0.0.6 published on Wednesday, Apr 10, 2024 by Zscaler

zia.DLPNotificationTemplates

Explore with Pulumi AI

zia logo
Zscaler Internet Access v0.0.6 published on Wednesday, Apr 10, 2024 by Zscaler

    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:      readFileOrPanic("./index.html"),
    			PlainTextMessage: 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.

    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

    The DLPNotificationTemplates resource accepts the following input properties:

    HtmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    PlainTextMessage string
    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.
    AttachContent bool
    If set to true, the content that is violation is attached to the DLP notification email.
    Name string
    The DLP policy rule name.
    TlsEnabled bool
    If set to true, the content that is violation is attached to the DLP notification email.
    HtmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    PlainTextMessage string
    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.
    AttachContent bool
    If set to true, the content that is violation is attached to the DLP notification email.
    Name string
    The DLP policy rule name.
    TlsEnabled bool
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage String
    The template for the HTML message body that must be displayed in the DLP notification email.
    plainTextMessage String
    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.
    attachContent Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    name String
    The DLP policy rule name.
    tlsEnabled Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    plainTextMessage string
    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.
    attachContent boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    name string
    The DLP policy rule name.
    tlsEnabled boolean
    If 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.
    plain_text_message str
    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
    If set to true, the content that is violation is attached to the DLP notification email.
    name str
    The DLP policy rule name.
    tls_enabled bool
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage String
    The template for the HTML message body that must be displayed in the DLP notification email.
    plainTextMessage String
    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.
    attachContent Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    name String
    The DLP policy rule name.
    tlsEnabled Boolean
    If set to true, the content that is violation is attached to the DLP notification email.

    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.
    TemplateId int
    The unique identifier for a DLP notification template
    Id string
    The provider-assigned unique ID for this managed resource.
    TemplateId int
    The unique identifier for a DLP notification template
    id String
    The provider-assigned unique ID for this managed resource.
    templateId Integer
    The unique identifier for a DLP notification template
    id string
    The provider-assigned unique ID for this managed resource.
    templateId 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.
    templateId 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.
    The following state arguments are supported:
    AttachContent bool
    If set to true, the content that is violation is attached to the DLP notification email.
    HtmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    Name string
    The DLP policy rule name.
    PlainTextMessage string
    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.
    TemplateId int
    The unique identifier for a DLP notification template
    TlsEnabled bool
    If set to true, the content that is violation is attached to the DLP notification email.
    AttachContent bool
    If set to true, the content that is violation is attached to the DLP notification email.
    HtmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    Name string
    The DLP policy rule name.
    PlainTextMessage string
    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.
    TemplateId int
    The unique identifier for a DLP notification template
    TlsEnabled bool
    If set to true, the content that is violation is attached to the DLP notification email.
    attachContent Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage String
    The template for the HTML message body that must be displayed in the DLP notification email.
    name String
    The DLP policy rule name.
    plainTextMessage String
    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.
    templateId Integer
    The unique identifier for a DLP notification template
    tlsEnabled Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    attachContent boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage string
    The template for the HTML message body that must be displayed in the DLP notification email.
    name string
    The DLP policy rule name.
    plainTextMessage string
    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.
    templateId number
    The unique identifier for a DLP notification template
    tlsEnabled boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    attach_content bool
    If 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 policy rule name.
    plain_text_message str
    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, the content that is violation is attached to the DLP notification email.
    attachContent Boolean
    If set to true, the content that is violation is attached to the DLP notification email.
    htmlMessage String
    The template for the HTML message body that must be displayed in the DLP notification email.
    name String
    The DLP policy rule name.
    plainTextMessage String
    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.
    templateId Number
    The unique identifier for a DLP notification template
    tlsEnabled Boolean
    If set to true, the content that is violation is attached to the DLP notification email.

    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.
    zia logo
    Zscaler Internet Access v0.0.6 published on Wednesday, Apr 10, 2024 by Zscaler