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

com.pulumi.aws.ses.kotlin.ConfigurationSet.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.ses.kotlin

import com.pulumi.aws.ses.kotlin.outputs.ConfigurationSetDeliveryOptions
import com.pulumi.aws.ses.kotlin.outputs.ConfigurationSetTrackingOptions
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.aws.ses.kotlin.outputs.ConfigurationSetDeliveryOptions.Companion.toKotlin as configurationSetDeliveryOptionsToKotlin
import com.pulumi.aws.ses.kotlin.outputs.ConfigurationSetTrackingOptions.Companion.toKotlin as configurationSetTrackingOptionsToKotlin

/**
 * Builder for [ConfigurationSet].
 */
@PulumiTagMarker
public class ConfigurationSetResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ConfigurationSetArgs = ConfigurationSetArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ConfigurationSetArgsBuilder.() -> Unit) {
        val builder = ConfigurationSetArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ConfigurationSet {
        val builtJavaResource = com.pulumi.aws.ses.ConfigurationSet(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ConfigurationSet(builtJavaResource)
    }
}

/**
 * Provides an SES configuration set resource.
 * ## Example Usage
 * ### Basic Example
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.ses.ConfigurationSet("test", {name: "some-configuration-set-test"});
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.ses.ConfigurationSet("test", name="some-configuration-set-test")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.Ses.ConfigurationSet("test", new()
 *     {
 *         Name = "some-configuration-set-test",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := ses.NewConfigurationSet(ctx, "test", &ses.ConfigurationSetArgs{
 * 			Name: pulumi.String("some-configuration-set-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.ses.ConfigurationSet;
 * import com.pulumi.aws.ses.ConfigurationSetArgs;
 * 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 ConfigurationSet("test", ConfigurationSetArgs.builder()
 *             .name("some-configuration-set-test")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:ses:ConfigurationSet
 *     properties:
 *       name: some-configuration-set-test
 * ```
 * 
 * ### Require TLS Connections
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.ses.ConfigurationSet("test", {
 *     name: "some-configuration-set-test",
 *     deliveryOptions: {
 *         tlsPolicy: "Require",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.ses.ConfigurationSet("test",
 *     name="some-configuration-set-test",
 *     delivery_options={
 *         "tls_policy": "Require",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.Ses.ConfigurationSet("test", new()
 *     {
 *         Name = "some-configuration-set-test",
 *         DeliveryOptions = new Aws.Ses.Inputs.ConfigurationSetDeliveryOptionsArgs
 *         {
 *             TlsPolicy = "Require",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := ses.NewConfigurationSet(ctx, "test", &ses.ConfigurationSetArgs{
 * 			Name: pulumi.String("some-configuration-set-test"),
 * 			DeliveryOptions: &ses.ConfigurationSetDeliveryOptionsArgs{
 * 				TlsPolicy: pulumi.String("Require"),
 * 			},
 * 		})
 * 		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.ses.ConfigurationSet;
 * import com.pulumi.aws.ses.ConfigurationSetArgs;
 * import com.pulumi.aws.ses.inputs.ConfigurationSetDeliveryOptionsArgs;
 * 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 ConfigurationSet("test", ConfigurationSetArgs.builder()
 *             .name("some-configuration-set-test")
 *             .deliveryOptions(ConfigurationSetDeliveryOptionsArgs.builder()
 *                 .tlsPolicy("Require")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:ses:ConfigurationSet
 *     properties:
 *       name: some-configuration-set-test
 *       deliveryOptions:
 *         tlsPolicy: Require
 * ```
 * 
 * ### Tracking Options
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.ses.ConfigurationSet("test", {
 *     name: "some-configuration-set-test",
 *     trackingOptions: {
 *         customRedirectDomain: "sub.example.com",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.ses.ConfigurationSet("test",
 *     name="some-configuration-set-test",
 *     tracking_options={
 *         "custom_redirect_domain": "sub.example.com",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.Ses.ConfigurationSet("test", new()
 *     {
 *         Name = "some-configuration-set-test",
 *         TrackingOptions = new Aws.Ses.Inputs.ConfigurationSetTrackingOptionsArgs
 *         {
 *             CustomRedirectDomain = "sub.example.com",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := ses.NewConfigurationSet(ctx, "test", &ses.ConfigurationSetArgs{
 * 			Name: pulumi.String("some-configuration-set-test"),
 * 			TrackingOptions: &ses.ConfigurationSetTrackingOptionsArgs{
 * 				CustomRedirectDomain: pulumi.String("sub.example.com"),
 * 			},
 * 		})
 * 		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.ses.ConfigurationSet;
 * import com.pulumi.aws.ses.ConfigurationSetArgs;
 * import com.pulumi.aws.ses.inputs.ConfigurationSetTrackingOptionsArgs;
 * 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 ConfigurationSet("test", ConfigurationSetArgs.builder()
 *             .name("some-configuration-set-test")
 *             .trackingOptions(ConfigurationSetTrackingOptionsArgs.builder()
 *                 .customRedirectDomain("sub.example.com")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:ses:ConfigurationSet
 *     properties:
 *       name: some-configuration-set-test
 *       trackingOptions:
 *         customRedirectDomain: sub.example.com
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import SES Configuration Sets using their `name`. For example:
 * ```sh
 * $ pulumi import aws:ses/configurationSet:ConfigurationSet test some-configuration-set-test
 * ```
 */
public class ConfigurationSet internal constructor(
    override val javaResource: com.pulumi.aws.ses.ConfigurationSet,
) : KotlinCustomResource(javaResource, ConfigurationSetMapper) {
    /**
     * SES configuration set ARN.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Whether messages that use the configuration set are required to use TLS. See below.
     */
    public val deliveryOptions: Output?
        get() = javaResource.deliveryOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> configurationSetDeliveryOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Date and time at which the reputation metrics for the configuration set were last reset. Resetting these metrics is known as a fresh start.
     */
    public val lastFreshStart: Output
        get() = javaResource.lastFreshStart().applyValue({ args0 -> args0 })

    /**
     * Name of the configuration set.
     * The following argument is optional:
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Whether or not Amazon SES publishes reputation metrics for the configuration set, such as bounce and complaint rates, to Amazon CloudWatch. The default value is `false`.
     */
    public val reputationMetricsEnabled: Output?
        get() = javaResource.reputationMetricsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether email sending is enabled or disabled for the configuration set. The default value is `true`.
     */
    public val sendingEnabled: Output?
        get() = javaResource.sendingEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Domain that is used to redirect email recipients to an Amazon SES-operated domain. See below. **NOTE:** This functionality is best effort.
     */
    public val trackingOptions: Output?
        get() = javaResource.trackingOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> configurationSetTrackingOptionsToKotlin(args0) })
            }).orElse(null)
        })
}

public object ConfigurationSetMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.ses.ConfigurationSet::class == javaResource::class

    override fun map(javaResource: Resource): ConfigurationSet = ConfigurationSet(
        javaResource as
            com.pulumi.aws.ses.ConfigurationSet,
    )
}

/**
 * @see [ConfigurationSet].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ConfigurationSet].
 */
public suspend fun configurationSet(
    name: String,
    block: suspend ConfigurationSetResourceBuilder.() -> Unit,
): ConfigurationSet {
    val builder = ConfigurationSetResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ConfigurationSet].
 * @param name The _unique_ name of the resulting resource.
 */
public fun configurationSet(name: String): ConfigurationSet {
    val builder = ConfigurationSetResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy