All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.macie2.kotlin.ClassificationJobArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.macie2.kotlin

import com.pulumi.aws.macie2.ClassificationJobArgs.builder
import com.pulumi.aws.macie2.kotlin.inputs.ClassificationJobS3JobDefinitionArgs
import com.pulumi.aws.macie2.kotlin.inputs.ClassificationJobS3JobDefinitionArgsBuilder
import com.pulumi.aws.macie2.kotlin.inputs.ClassificationJobScheduleFrequencyArgs
import com.pulumi.aws.macie2.kotlin.inputs.ClassificationJobScheduleFrequencyArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a resource to manage an [AWS Macie Classification Job](https://docs.aws.amazon.com/macie/latest/APIReference/jobs.html).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.macie2.Account("test", {});
 * const testClassificationJob = new aws.macie2.ClassificationJob("test", {
 *     jobType: "ONE_TIME",
 *     name: "NAME OF THE CLASSIFICATION JOB",
 *     s3JobDefinition: {
 *         bucketDefinitions: [{
 *             accountId: "ACCOUNT ID",
 *             buckets: ["S3 BUCKET NAME"],
 *         }],
 *     },
 * }, {
 *     dependsOn: [test],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.macie2.Account("test")
 * test_classification_job = aws.macie2.ClassificationJob("test",
 *     job_type="ONE_TIME",
 *     name="NAME OF THE CLASSIFICATION JOB",
 *     s3_job_definition={
 *         "bucket_definitions": [{
 *             "account_id": "ACCOUNT ID",
 *             "buckets": ["S3 BUCKET NAME"],
 *         }],
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[test]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.Macie2.Account("test");
 *     var testClassificationJob = new Aws.Macie2.ClassificationJob("test", new()
 *     {
 *         JobType = "ONE_TIME",
 *         Name = "NAME OF THE CLASSIFICATION JOB",
 *         S3JobDefinition = new Aws.Macie2.Inputs.ClassificationJobS3JobDefinitionArgs
 *         {
 *             BucketDefinitions = new[]
 *             {
 *                 new Aws.Macie2.Inputs.ClassificationJobS3JobDefinitionBucketDefinitionArgs
 *                 {
 *                     AccountId = "ACCOUNT ID",
 *                     Buckets = new[]
 *                     {
 *                         "S3 BUCKET NAME",
 *                     },
 *                 },
 *             },
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             test,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/macie2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		test, err := macie2.NewAccount(ctx, "test", nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = macie2.NewClassificationJob(ctx, "test", &macie2.ClassificationJobArgs{
 * 			JobType: pulumi.String("ONE_TIME"),
 * 			Name:    pulumi.String("NAME OF THE CLASSIFICATION JOB"),
 * 			S3JobDefinition: &macie2.ClassificationJobS3JobDefinitionArgs{
 * 				BucketDefinitions: macie2.ClassificationJobS3JobDefinitionBucketDefinitionArray{
 * 					&macie2.ClassificationJobS3JobDefinitionBucketDefinitionArgs{
 * 						AccountId: pulumi.String("ACCOUNT ID"),
 * 						Buckets: pulumi.StringArray{
 * 							pulumi.String("S3 BUCKET NAME"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			test,
 * 		}))
 * 		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.aws.macie2.Account;
 * import com.pulumi.aws.macie2.ClassificationJob;
 * import com.pulumi.aws.macie2.ClassificationJobArgs;
 * import com.pulumi.aws.macie2.inputs.ClassificationJobS3JobDefinitionArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 test = new Account("test");
 *         var testClassificationJob = new ClassificationJob("testClassificationJob", ClassificationJobArgs.builder()
 *             .jobType("ONE_TIME")
 *             .name("NAME OF THE CLASSIFICATION JOB")
 *             .s3JobDefinition(ClassificationJobS3JobDefinitionArgs.builder()
 *                 .bucketDefinitions(ClassificationJobS3JobDefinitionBucketDefinitionArgs.builder()
 *                     .accountId("ACCOUNT ID")
 *                     .buckets("S3 BUCKET NAME")
 *                     .build())
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(test)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:macie2:Account
 *   testClassificationJob:
 *     type: aws:macie2:ClassificationJob
 *     name: test
 *     properties:
 *       jobType: ONE_TIME
 *       name: NAME OF THE CLASSIFICATION JOB
 *       s3JobDefinition:
 *         bucketDefinitions:
 *           - accountId: ACCOUNT ID
 *             buckets:
 *               - S3 BUCKET NAME
 *     options:
 *       dependson:
 *         - ${test}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import `aws_macie2_classification_job` using the id. For example:
 * ```sh
 * $ pulumi import aws:macie2/classificationJob:ClassificationJob example abcd1
 * ```
 * @property customDataIdentifierIds The custom data identifiers to use for data analysis and classification.
 * @property description A custom description of the job. The description can contain as many as 200 characters.
 * @property initialRun Specifies whether to analyze all existing, eligible objects immediately after the job is created.
 * @property jobStatus The status for the job. Valid values are: `CANCELLED`, `RUNNING` and `USER_PAUSED`
 * @property jobType The schedule for running the job. Valid values are: `ONE_TIME` - Run the job only once. If you specify this value, don't specify a value for the `schedule_frequency` property. `SCHEDULED` - Run the job on a daily, weekly, or monthly basis. If you specify this value, use the `schedule_frequency` property to define the recurrence pattern for the job.
 * @property name A custom name for the job. The name can contain as many as 500 characters. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
 * @property namePrefix Creates a unique name beginning with the specified prefix. Conflicts with `name`.
 * @property s3JobDefinition The S3 buckets that contain the objects to analyze, and the scope of that analysis. (documented below)
 * @property samplingPercentage The sampling depth, as a percentage, to apply when processing objects. This value determines the percentage of eligible objects that the job analyzes. If this value is less than 100, Amazon Macie selects the objects to analyze at random, up to the specified percentage, and analyzes all the data in those objects.
 * @property scheduleFrequency The recurrence pattern for running the job. To run the job only once, don't specify a value for this property and set the value for the `job_type` property to `ONE_TIME`. (documented below)
 * @property tags A map of key-value pairs that specifies the tags to associate with the job. A job can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
 */
public data class ClassificationJobArgs(
    public val customDataIdentifierIds: Output>? = null,
    public val description: Output? = null,
    public val initialRun: Output? = null,
    public val jobStatus: Output? = null,
    public val jobType: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val s3JobDefinition: Output? = null,
    public val samplingPercentage: Output? = null,
    public val scheduleFrequency: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.macie2.ClassificationJobArgs =
        com.pulumi.aws.macie2.ClassificationJobArgs.builder()
            .customDataIdentifierIds(
                customDataIdentifierIds?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .initialRun(initialRun?.applyValue({ args0 -> args0 }))
            .jobStatus(jobStatus?.applyValue({ args0 -> args0 }))
            .jobType(jobType?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .s3JobDefinition(s3JobDefinition?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .samplingPercentage(samplingPercentage?.applyValue({ args0 -> args0 }))
            .scheduleFrequency(scheduleFrequency?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ClassificationJobArgs].
 */
@PulumiTagMarker
public class ClassificationJobArgsBuilder internal constructor() {
    private var customDataIdentifierIds: Output>? = null

    private var description: Output? = null

    private var initialRun: Output? = null

    private var jobStatus: Output? = null

    private var jobType: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var s3JobDefinition: Output? = null

    private var samplingPercentage: Output? = null

    private var scheduleFrequency: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The custom data identifiers to use for data analysis and classification.
     */
    @JvmName("lcbpkrhmafhjwryb")
    public suspend fun customDataIdentifierIds(`value`: Output>) {
        this.customDataIdentifierIds = value
    }

    @JvmName("hbafkbjwyscehgdl")
    public suspend fun customDataIdentifierIds(vararg values: Output) {
        this.customDataIdentifierIds = Output.all(values.asList())
    }

    /**
     * @param values The custom data identifiers to use for data analysis and classification.
     */
    @JvmName("pyycimeuxtlqjqfd")
    public suspend fun customDataIdentifierIds(values: List>) {
        this.customDataIdentifierIds = Output.all(values)
    }

    /**
     * @param value A custom description of the job. The description can contain as many as 200 characters.
     */
    @JvmName("fflkjiifcirhxedx")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies whether to analyze all existing, eligible objects immediately after the job is created.
     */
    @JvmName("aqxmpqxrybwqmjkp")
    public suspend fun initialRun(`value`: Output) {
        this.initialRun = value
    }

    /**
     * @param value The status for the job. Valid values are: `CANCELLED`, `RUNNING` and `USER_PAUSED`
     */
    @JvmName("jfpqggxsfswuldno")
    public suspend fun jobStatus(`value`: Output) {
        this.jobStatus = value
    }

    /**
     * @param value The schedule for running the job. Valid values are: `ONE_TIME` - Run the job only once. If you specify this value, don't specify a value for the `schedule_frequency` property. `SCHEDULED` - Run the job on a daily, weekly, or monthly basis. If you specify this value, use the `schedule_frequency` property to define the recurrence pattern for the job.
     */
    @JvmName("newnoufkjtwrukva")
    public suspend fun jobType(`value`: Output) {
        this.jobType = value
    }

    /**
     * @param value A custom name for the job. The name can contain as many as 500 characters. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
     */
    @JvmName("gghjcnxpqnubvpln")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("hjbqnhhgvymgddlw")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value The S3 buckets that contain the objects to analyze, and the scope of that analysis. (documented below)
     */
    @JvmName("wnhnmltnpowojptm")
    public suspend fun s3JobDefinition(`value`: Output) {
        this.s3JobDefinition = value
    }

    /**
     * @param value The sampling depth, as a percentage, to apply when processing objects. This value determines the percentage of eligible objects that the job analyzes. If this value is less than 100, Amazon Macie selects the objects to analyze at random, up to the specified percentage, and analyzes all the data in those objects.
     */
    @JvmName("kbmlngnrircpvfjv")
    public suspend fun samplingPercentage(`value`: Output) {
        this.samplingPercentage = value
    }

    /**
     * @param value The recurrence pattern for running the job. To run the job only once, don't specify a value for this property and set the value for the `job_type` property to `ONE_TIME`. (documented below)
     */
    @JvmName("vmthwxqoxmxmdrjn")
    public suspend fun scheduleFrequency(`value`: Output) {
        this.scheduleFrequency = value
    }

    /**
     * @param value A map of key-value pairs that specifies the tags to associate with the job. A job can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
     */
    @JvmName("krvghpguljrhmplf")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The custom data identifiers to use for data analysis and classification.
     */
    @JvmName("jnowiijmrukdracq")
    public suspend fun customDataIdentifierIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customDataIdentifierIds = mapped
    }

    /**
     * @param values The custom data identifiers to use for data analysis and classification.
     */
    @JvmName("mcsbyubjogbcycat")
    public suspend fun customDataIdentifierIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.customDataIdentifierIds = mapped
    }

    /**
     * @param value A custom description of the job. The description can contain as many as 200 characters.
     */
    @JvmName("eoykjltluxgvwjit")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies whether to analyze all existing, eligible objects immediately after the job is created.
     */
    @JvmName("hbdprngavbcnnyea")
    public suspend fun initialRun(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.initialRun = mapped
    }

    /**
     * @param value The status for the job. Valid values are: `CANCELLED`, `RUNNING` and `USER_PAUSED`
     */
    @JvmName("yxijbyfmxdmyhfce")
    public suspend fun jobStatus(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobStatus = mapped
    }

    /**
     * @param value The schedule for running the job. Valid values are: `ONE_TIME` - Run the job only once. If you specify this value, don't specify a value for the `schedule_frequency` property. `SCHEDULED` - Run the job on a daily, weekly, or monthly basis. If you specify this value, use the `schedule_frequency` property to define the recurrence pattern for the job.
     */
    @JvmName("cflvcnoppwfuuavp")
    public suspend fun jobType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobType = mapped
    }

    /**
     * @param value A custom name for the job. The name can contain as many as 500 characters. If omitted, the provider will assign a random, unique name. Conflicts with `name_prefix`.
     */
    @JvmName("wegniyojtsfevxdi")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("dsfujfqdsycroxrv")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value The S3 buckets that contain the objects to analyze, and the scope of that analysis. (documented below)
     */
    @JvmName("jprdhyccsnjysmns")
    public suspend fun s3JobDefinition(`value`: ClassificationJobS3JobDefinitionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.s3JobDefinition = mapped
    }

    /**
     * @param argument The S3 buckets that contain the objects to analyze, and the scope of that analysis. (documented below)
     */
    @JvmName("gmxjjaceknwaxyee")
    public suspend fun s3JobDefinition(argument: suspend ClassificationJobS3JobDefinitionArgsBuilder.() -> Unit) {
        val toBeMapped = ClassificationJobS3JobDefinitionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.s3JobDefinition = mapped
    }

    /**
     * @param value The sampling depth, as a percentage, to apply when processing objects. This value determines the percentage of eligible objects that the job analyzes. If this value is less than 100, Amazon Macie selects the objects to analyze at random, up to the specified percentage, and analyzes all the data in those objects.
     */
    @JvmName("pagfuwkjtpsgalut")
    public suspend fun samplingPercentage(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.samplingPercentage = mapped
    }

    /**
     * @param value The recurrence pattern for running the job. To run the job only once, don't specify a value for this property and set the value for the `job_type` property to `ONE_TIME`. (documented below)
     */
    @JvmName("arniwmimopewvato")
    public suspend fun scheduleFrequency(`value`: ClassificationJobScheduleFrequencyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scheduleFrequency = mapped
    }

    /**
     * @param argument The recurrence pattern for running the job. To run the job only once, don't specify a value for this property and set the value for the `job_type` property to `ONE_TIME`. (documented below)
     */
    @JvmName("obupmulebabcwlem")
    public suspend fun scheduleFrequency(argument: suspend ClassificationJobScheduleFrequencyArgsBuilder.() -> Unit) {
        val toBeMapped = ClassificationJobScheduleFrequencyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.scheduleFrequency = mapped
    }

    /**
     * @param value A map of key-value pairs that specifies the tags to associate with the job. A job can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
     */
    @JvmName("wvioifhfeiatdtym")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A map of key-value pairs that specifies the tags to associate with the job. A job can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
     */
    @JvmName("csidngmshrsdsijj")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ClassificationJobArgs = ClassificationJobArgs(
        customDataIdentifierIds = customDataIdentifierIds,
        description = description,
        initialRun = initialRun,
        jobStatus = jobStatus,
        jobType = jobType,
        name = name,
        namePrefix = namePrefix,
        s3JobDefinition = s3JobDefinition,
        samplingPercentage = samplingPercentage,
        scheduleFrequency = scheduleFrequency,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy