com.pulumi.cloudflare.kotlin.ZeroTrustDlpProfileArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.ZeroTrustDlpProfileArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDlpProfileContextAwarenessArgs
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDlpProfileContextAwarenessArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDlpProfileEntryArgs
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustDlpProfileEntryArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a Cloudflare DLP Profile resource. Data Loss Prevention profiles
* are a set of entries that can be matched in HTTP bodies or files.
* They are referenced in Zero Trust Gateway rules.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* // Predefined profile must be imported, cannot be created
* const creds = new cloudflare.ZeroTrustDlpProfile("creds", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "Credentials and Secrets",
* type: "predefined",
* allowedMatchCount: 3,
* entries: [
* {
* enabled: true,
* name: "Amazon AWS Access Key ID",
* id: "d8fcfc9c-773c-405e-8426-21ecbb67ba93",
* },
* {
* enabled: false,
* id: "2c0e33e1-71da-40c8-aad3-32e674ad3d96",
* name: "Amazon AWS Secret Access Key",
* },
* {
* enabled: true,
* id: "4e92c006-3802-4dff-bbe1-8e1513b1c92a",
* name: "Microsoft Azure Client Secret",
* },
* {
* enabled: false,
* id: "5c713294-2375-4904-abcf-e4a15be4d592",
* name: "SSH Private Key",
* },
* {
* enabled: true,
* id: "6c6579e4-d832-42d5-905c-8e53340930f2",
* name: "Google GCP API Key",
* },
* ],
* });
* // Custom profile
* const exampleCustom = new cloudflare.ZeroTrustDlpProfile("example_custom", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "Example Custom Profile",
* description: "A profile with example entries",
* type: "custom",
* allowedMatchCount: 0,
* entries: [
* {
* name: "Matches visa credit cards",
* enabled: true,
* pattern: {
* regex: "4\\d{3}([-\\. ])?\\d{4}([-\\. ])?\\d{4}([-\\. ])?\\d{4}",
* validation: "luhn",
* },
* },
* {
* name: "Matches diners club card",
* enabled: true,
* pattern: {
* regex: "(?:0[0-5]|[68][0-9])[0-9]{11}",
* validation: "luhn",
* },
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* # Predefined profile must be imported, cannot be created
* creds = cloudflare.ZeroTrustDlpProfile("creds",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="Credentials and Secrets",
* type="predefined",
* allowed_match_count=3,
* entries=[
* {
* "enabled": True,
* "name": "Amazon AWS Access Key ID",
* "id": "d8fcfc9c-773c-405e-8426-21ecbb67ba93",
* },
* {
* "enabled": False,
* "id": "2c0e33e1-71da-40c8-aad3-32e674ad3d96",
* "name": "Amazon AWS Secret Access Key",
* },
* {
* "enabled": True,
* "id": "4e92c006-3802-4dff-bbe1-8e1513b1c92a",
* "name": "Microsoft Azure Client Secret",
* },
* {
* "enabled": False,
* "id": "5c713294-2375-4904-abcf-e4a15be4d592",
* "name": "SSH Private Key",
* },
* {
* "enabled": True,
* "id": "6c6579e4-d832-42d5-905c-8e53340930f2",
* "name": "Google GCP API Key",
* },
* ])
* # Custom profile
* example_custom = cloudflare.ZeroTrustDlpProfile("example_custom",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="Example Custom Profile",
* description="A profile with example entries",
* type="custom",
* allowed_match_count=0,
* entries=[
* {
* "name": "Matches visa credit cards",
* "enabled": True,
* "pattern": {
* "regex": "4\\d{3}([-\\. ])?\\d{4}([-\\. ])?\\d{4}([-\\. ])?\\d{4}",
* "validation": "luhn",
* },
* },
* {
* "name": "Matches diners club card",
* "enabled": True,
* "pattern": {
* "regex": "(?:0[0-5]|[68][0-9])[0-9]{11}",
* "validation": "luhn",
* },
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* // Predefined profile must be imported, cannot be created
* var creds = new Cloudflare.ZeroTrustDlpProfile("creds", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "Credentials and Secrets",
* Type = "predefined",
* AllowedMatchCount = 3,
* Entries = new[]
* {
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Enabled = true,
* Name = "Amazon AWS Access Key ID",
* Id = "d8fcfc9c-773c-405e-8426-21ecbb67ba93",
* },
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Enabled = false,
* Id = "2c0e33e1-71da-40c8-aad3-32e674ad3d96",
* Name = "Amazon AWS Secret Access Key",
* },
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Enabled = true,
* Id = "4e92c006-3802-4dff-bbe1-8e1513b1c92a",
* Name = "Microsoft Azure Client Secret",
* },
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Enabled = false,
* Id = "5c713294-2375-4904-abcf-e4a15be4d592",
* Name = "SSH Private Key",
* },
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Enabled = true,
* Id = "6c6579e4-d832-42d5-905c-8e53340930f2",
* Name = "Google GCP API Key",
* },
* },
* });
* // Custom profile
* var exampleCustom = new Cloudflare.ZeroTrustDlpProfile("example_custom", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "Example Custom Profile",
* Description = "A profile with example entries",
* Type = "custom",
* AllowedMatchCount = 0,
* Entries = new[]
* {
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Name = "Matches visa credit cards",
* Enabled = true,
* Pattern = new Cloudflare.Inputs.ZeroTrustDlpProfileEntryPatternArgs
* {
* Regex = "4\\d{3}([-\\. ])?\\d{4}([-\\. ])?\\d{4}([-\\. ])?\\d{4}",
* Validation = "luhn",
* },
* },
* new Cloudflare.Inputs.ZeroTrustDlpProfileEntryArgs
* {
* Name = "Matches diners club card",
* Enabled = true,
* Pattern = new Cloudflare.Inputs.ZeroTrustDlpProfileEntryPatternArgs
* {
* Regex = "(?:0[0-5]|[68][0-9])[0-9]{11}",
* Validation = "luhn",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // Predefined profile must be imported, cannot be created
* _, err := cloudflare.NewZeroTrustDlpProfile(ctx, "creds", &cloudflare.ZeroTrustDlpProfileArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("Credentials and Secrets"),
* Type: pulumi.String("predefined"),
* AllowedMatchCount: pulumi.Int(3),
* Entries: cloudflare.ZeroTrustDlpProfileEntryArray{
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Enabled: pulumi.Bool(true),
* Name: pulumi.String("Amazon AWS Access Key ID"),
* Id: pulumi.String("d8fcfc9c-773c-405e-8426-21ecbb67ba93"),
* },
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Enabled: pulumi.Bool(false),
* Id: pulumi.String("2c0e33e1-71da-40c8-aad3-32e674ad3d96"),
* Name: pulumi.String("Amazon AWS Secret Access Key"),
* },
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Enabled: pulumi.Bool(true),
* Id: pulumi.String("4e92c006-3802-4dff-bbe1-8e1513b1c92a"),
* Name: pulumi.String("Microsoft Azure Client Secret"),
* },
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Enabled: pulumi.Bool(false),
* Id: pulumi.String("5c713294-2375-4904-abcf-e4a15be4d592"),
* Name: pulumi.String("SSH Private Key"),
* },
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Enabled: pulumi.Bool(true),
* Id: pulumi.String("6c6579e4-d832-42d5-905c-8e53340930f2"),
* Name: pulumi.String("Google GCP API Key"),
* },
* },
* })
* if err != nil {
* return err
* }
* // Custom profile
* _, err = cloudflare.NewZeroTrustDlpProfile(ctx, "example_custom", &cloudflare.ZeroTrustDlpProfileArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("Example Custom Profile"),
* Description: pulumi.String("A profile with example entries"),
* Type: pulumi.String("custom"),
* AllowedMatchCount: pulumi.Int(0),
* Entries: cloudflare.ZeroTrustDlpProfileEntryArray{
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Name: pulumi.String("Matches visa credit cards"),
* Enabled: pulumi.Bool(true),
* Pattern: &cloudflare.ZeroTrustDlpProfileEntryPatternArgs{
* Regex: pulumi.String("4\\d{3}([-\\. ])?\\d{4}([-\\. ])?\\d{4}([-\\. ])?\\d{4}"),
* Validation: pulumi.String("luhn"),
* },
* },
* &cloudflare.ZeroTrustDlpProfileEntryArgs{
* Name: pulumi.String("Matches diners club card"),
* Enabled: pulumi.Bool(true),
* Pattern: &cloudflare.ZeroTrustDlpProfileEntryPatternArgs{
* Regex: pulumi.String("(?:0[0-5]|[68][0-9])[0-9]{11}"),
* Validation: pulumi.String("luhn"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.cloudflare.ZeroTrustDlpProfile;
* import com.pulumi.cloudflare.ZeroTrustDlpProfileArgs;
* import com.pulumi.cloudflare.inputs.ZeroTrustDlpProfileEntryArgs;
* import com.pulumi.cloudflare.inputs.ZeroTrustDlpProfileEntryPatternArgs;
* 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) {
* // Predefined profile must be imported, cannot be created
* var creds = new ZeroTrustDlpProfile("creds", ZeroTrustDlpProfileArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("Credentials and Secrets")
* .type("predefined")
* .allowedMatchCount(3)
* .entries(
* ZeroTrustDlpProfileEntryArgs.builder()
* .enabled(true)
* .name("Amazon AWS Access Key ID")
* .id("d8fcfc9c-773c-405e-8426-21ecbb67ba93")
* .build(),
* ZeroTrustDlpProfileEntryArgs.builder()
* .enabled(false)
* .id("2c0e33e1-71da-40c8-aad3-32e674ad3d96")
* .name("Amazon AWS Secret Access Key")
* .build(),
* ZeroTrustDlpProfileEntryArgs.builder()
* .enabled(true)
* .id("4e92c006-3802-4dff-bbe1-8e1513b1c92a")
* .name("Microsoft Azure Client Secret")
* .build(),
* ZeroTrustDlpProfileEntryArgs.builder()
* .enabled(false)
* .id("5c713294-2375-4904-abcf-e4a15be4d592")
* .name("SSH Private Key")
* .build(),
* ZeroTrustDlpProfileEntryArgs.builder()
* .enabled(true)
* .id("6c6579e4-d832-42d5-905c-8e53340930f2")
* .name("Google GCP API Key")
* .build())
* .build());
* // Custom profile
* var exampleCustom = new ZeroTrustDlpProfile("exampleCustom", ZeroTrustDlpProfileArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("Example Custom Profile")
* .description("A profile with example entries")
* .type("custom")
* .allowedMatchCount(0)
* .entries(
* ZeroTrustDlpProfileEntryArgs.builder()
* .name("Matches visa credit cards")
* .enabled(true)
* .pattern(ZeroTrustDlpProfileEntryPatternArgs.builder()
* .regex("4\\d{3}([-\\. ])?\\d{4}([-\\. ])?\\d{4}([-\\. ])?\\d{4}")
* .validation("luhn")
* .build())
* .build(),
* ZeroTrustDlpProfileEntryArgs.builder()
* .name("Matches diners club card")
* .enabled(true)
* .pattern(ZeroTrustDlpProfileEntryPatternArgs.builder()
* .regex("(?:0[0-5]|[68][0-9])[0-9]{11}")
* .validation("luhn")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Predefined profile must be imported, cannot be created
* creds:
* type: cloudflare:ZeroTrustDlpProfile
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: Credentials and Secrets
* type: predefined
* allowedMatchCount: 3
* entries:
* - enabled: true
* name: Amazon AWS Access Key ID
* id: d8fcfc9c-773c-405e-8426-21ecbb67ba93
* - enabled: false
* id: 2c0e33e1-71da-40c8-aad3-32e674ad3d96
* name: Amazon AWS Secret Access Key
* - enabled: true
* id: 4e92c006-3802-4dff-bbe1-8e1513b1c92a
* name: Microsoft Azure Client Secret
* - enabled: false
* id: 5c713294-2375-4904-abcf-e4a15be4d592
* name: SSH Private Key
* - enabled: true
* id: 6c6579e4-d832-42d5-905c-8e53340930f2
* name: Google GCP API Key
* # Custom profile
* exampleCustom:
* type: cloudflare:ZeroTrustDlpProfile
* name: example_custom
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: Example Custom Profile
* description: A profile with example entries
* type: custom
* allowedMatchCount: 0
* entries:
* - name: Matches visa credit cards
* enabled: true
* pattern:
* regex: 4\d{3}([-\. ])?\d{4}([-\. ])?\d{4}([-\. ])?\d{4}
* validation: luhn
* - name: Matches diners club card
* enabled: true
* pattern:
* regex: (?:0[0-5]|[68][0-9])[0-9]{11}
* validation: luhn
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/zeroTrustDlpProfile:ZeroTrustDlpProfile example /
* ```
* @property accountId The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
* @property allowedMatchCount Related DLP policies will trigger when the match count exceeds the number set.
* @property contextAwareness Scan the context of predefined entries to only return matches surrounded by keywords.
* @property description Brief summary of the profile and its intended use.
* @property entries List of entries to apply to the profile.
* @property name Name of the profile. **Modifying this attribute will force creation of a new resource.**
* @property ocrEnabled If true, scan images via OCR to determine if any text present matches filters.
* @property type The type of the profile. Available values: `custom`, `predefined`. **Modifying this attribute will force creation of a new resource.**
*/
public data class ZeroTrustDlpProfileArgs(
public val accountId: Output? = null,
public val allowedMatchCount: Output? = null,
public val contextAwareness: Output? = null,
public val description: Output? = null,
public val entries: Output>? = null,
public val name: Output? = null,
public val ocrEnabled: Output? = null,
public val type: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.ZeroTrustDlpProfileArgs =
com.pulumi.cloudflare.ZeroTrustDlpProfileArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.allowedMatchCount(allowedMatchCount?.applyValue({ args0 -> args0 }))
.contextAwareness(contextAwareness?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.description(description?.applyValue({ args0 -> args0 }))
.entries(
entries?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.name(name?.applyValue({ args0 -> args0 }))
.ocrEnabled(ocrEnabled?.applyValue({ args0 -> args0 }))
.type(type?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ZeroTrustDlpProfileArgs].
*/
@PulumiTagMarker
public class ZeroTrustDlpProfileArgsBuilder internal constructor() {
private var accountId: Output? = null
private var allowedMatchCount: Output? = null
private var contextAwareness: Output? = null
private var description: Output? = null
private var entries: Output>? = null
private var name: Output? = null
private var ocrEnabled: Output? = null
private var type: Output? = null
/**
* @param value The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("hojmjbygvdspfmrj")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value Related DLP policies will trigger when the match count exceeds the number set.
*/
@JvmName("fhbktienwgplauux")
public suspend fun allowedMatchCount(`value`: Output) {
this.allowedMatchCount = value
}
/**
* @param value Scan the context of predefined entries to only return matches surrounded by keywords.
*/
@JvmName("dtbjwoighlosldnf")
public suspend fun contextAwareness(`value`: Output) {
this.contextAwareness = value
}
/**
* @param value Brief summary of the profile and its intended use.
*/
@JvmName("qpubdabhohhdddwu")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value List of entries to apply to the profile.
*/
@JvmName("wccixujdgxmnmmwh")
public suspend fun entries(`value`: Output>) {
this.entries = value
}
@JvmName("vlukfvjitwwgokdq")
public suspend fun entries(vararg values: Output) {
this.entries = Output.all(values.asList())
}
/**
* @param values List of entries to apply to the profile.
*/
@JvmName("pdhjlqplcmspsqqq")
public suspend fun entries(values: List