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

com.pulumi.aws.cloudwatch.kotlin.EventEndpointArgs.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.cloudwatch.kotlin

import com.pulumi.aws.cloudwatch.EventEndpointArgs.builder
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointEventBusArgs
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointEventBusArgsBuilder
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointReplicationConfigArgs
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointReplicationConfigArgsBuilder
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointRoutingConfigArgs
import com.pulumi.aws.cloudwatch.kotlin.inputs.EventEndpointRoutingConfigArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a resource to create an EventBridge Global Endpoint.
 * > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const _this = new aws.cloudwatch.EventEndpoint("this", {
 *     name: "global-endpoint",
 *     roleArn: replication.arn,
 *     eventBuses: [
 *         {
 *             eventBusArn: primary.arn,
 *         },
 *         {
 *             eventBusArn: secondary.arn,
 *         },
 *     ],
 *     replicationConfig: {
 *         state: "DISABLED",
 *     },
 *     routingConfig: {
 *         failoverConfig: {
 *             primary: {
 *                 healthCheck: primaryAwsRoute53HealthCheck.arn,
 *             },
 *             secondary: {
 *                 route: "us-east-2",
 *             },
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * this = aws.cloudwatch.EventEndpoint("this",
 *     name="global-endpoint",
 *     role_arn=replication["arn"],
 *     event_buses=[
 *         {
 *             "event_bus_arn": primary["arn"],
 *         },
 *         {
 *             "event_bus_arn": secondary["arn"],
 *         },
 *     ],
 *     replication_config={
 *         "state": "DISABLED",
 *     },
 *     routing_config={
 *         "failover_config": {
 *             "primary": {
 *                 "health_check": primary_aws_route53_health_check["arn"],
 *             },
 *             "secondary": {
 *                 "route": "us-east-2",
 *             },
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @this = new Aws.CloudWatch.EventEndpoint("this", new()
 *     {
 *         Name = "global-endpoint",
 *         RoleArn = replication.Arn,
 *         EventBuses = new[]
 *         {
 *             new Aws.CloudWatch.Inputs.EventEndpointEventBusArgs
 *             {
 *                 EventBusArn = primary.Arn,
 *             },
 *             new Aws.CloudWatch.Inputs.EventEndpointEventBusArgs
 *             {
 *                 EventBusArn = secondary.Arn,
 *             },
 *         },
 *         ReplicationConfig = new Aws.CloudWatch.Inputs.EventEndpointReplicationConfigArgs
 *         {
 *             State = "DISABLED",
 *         },
 *         RoutingConfig = new Aws.CloudWatch.Inputs.EventEndpointRoutingConfigArgs
 *         {
 *             FailoverConfig = new Aws.CloudWatch.Inputs.EventEndpointRoutingConfigFailoverConfigArgs
 *             {
 *                 Primary = new Aws.CloudWatch.Inputs.EventEndpointRoutingConfigFailoverConfigPrimaryArgs
 *                 {
 *                     HealthCheck = primaryAwsRoute53HealthCheck.Arn,
 *                 },
 *                 Secondary = new Aws.CloudWatch.Inputs.EventEndpointRoutingConfigFailoverConfigSecondaryArgs
 *                 {
 *                     Route = "us-east-2",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudwatch.NewEventEndpoint(ctx, "this", &cloudwatch.EventEndpointArgs{
 * 			Name:    pulumi.String("global-endpoint"),
 * 			RoleArn: pulumi.Any(replication.Arn),
 * 			EventBuses: cloudwatch.EventEndpointEventBusArray{
 * 				&cloudwatch.EventEndpointEventBusArgs{
 * 					EventBusArn: pulumi.Any(primary.Arn),
 * 				},
 * 				&cloudwatch.EventEndpointEventBusArgs{
 * 					EventBusArn: pulumi.Any(secondary.Arn),
 * 				},
 * 			},
 * 			ReplicationConfig: &cloudwatch.EventEndpointReplicationConfigArgs{
 * 				State: pulumi.String("DISABLED"),
 * 			},
 * 			RoutingConfig: &cloudwatch.EventEndpointRoutingConfigArgs{
 * 				FailoverConfig: &cloudwatch.EventEndpointRoutingConfigFailoverConfigArgs{
 * 					Primary: &cloudwatch.EventEndpointRoutingConfigFailoverConfigPrimaryArgs{
 * 						HealthCheck: pulumi.Any(primaryAwsRoute53HealthCheck.Arn),
 * 					},
 * 					Secondary: &cloudwatch.EventEndpointRoutingConfigFailoverConfigSecondaryArgs{
 * 						Route: pulumi.String("us-east-2"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.cloudwatch.EventEndpoint;
 * import com.pulumi.aws.cloudwatch.EventEndpointArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointEventBusArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointReplicationConfigArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointRoutingConfigArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointRoutingConfigFailoverConfigArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointRoutingConfigFailoverConfigPrimaryArgs;
 * import com.pulumi.aws.cloudwatch.inputs.EventEndpointRoutingConfigFailoverConfigSecondaryArgs;
 * 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 this_ = new EventEndpoint("this", EventEndpointArgs.builder()
 *             .name("global-endpoint")
 *             .roleArn(replication.arn())
 *             .eventBuses(
 *                 EventEndpointEventBusArgs.builder()
 *                     .eventBusArn(primary.arn())
 *                     .build(),
 *                 EventEndpointEventBusArgs.builder()
 *                     .eventBusArn(secondary.arn())
 *                     .build())
 *             .replicationConfig(EventEndpointReplicationConfigArgs.builder()
 *                 .state("DISABLED")
 *                 .build())
 *             .routingConfig(EventEndpointRoutingConfigArgs.builder()
 *                 .failoverConfig(EventEndpointRoutingConfigFailoverConfigArgs.builder()
 *                     .primary(EventEndpointRoutingConfigFailoverConfigPrimaryArgs.builder()
 *                         .healthCheck(primaryAwsRoute53HealthCheck.arn())
 *                         .build())
 *                     .secondary(EventEndpointRoutingConfigFailoverConfigSecondaryArgs.builder()
 *                         .route("us-east-2")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   this:
 *     type: aws:cloudwatch:EventEndpoint
 *     properties:
 *       name: global-endpoint
 *       roleArn: ${replication.arn}
 *       eventBuses:
 *         - eventBusArn: ${primary.arn}
 *         - eventBusArn: ${secondary.arn}
 *       replicationConfig:
 *         state: DISABLED
 *       routingConfig:
 *         failoverConfig:
 *           primary:
 *             healthCheck: ${primaryAwsRoute53HealthCheck.arn}
 *           secondary:
 *             route: us-east-2
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import EventBridge Global Endpoints using the `name`. For example:
 * ```sh
 * $ pulumi import aws:cloudwatch/eventEndpoint:EventEndpoint imported_endpoint example-endpoint
 * ```
 * @property description A description of the global endpoint.
 * @property eventBuses The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
 * @property name The name of the global endpoint.
 * @property replicationConfig Parameters used for replication. Documented below.
 * @property roleArn The ARN of the IAM role used for replication between event buses.
 * @property routingConfig Parameters used for routing, including the health check and secondary Region. Documented below.
 */
public data class EventEndpointArgs(
    public val description: Output? = null,
    public val eventBuses: Output>? = null,
    public val name: Output? = null,
    public val replicationConfig: Output? = null,
    public val roleArn: Output? = null,
    public val routingConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.cloudwatch.EventEndpointArgs =
        com.pulumi.aws.cloudwatch.EventEndpointArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .eventBuses(
                eventBuses?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .replicationConfig(replicationConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .roleArn(roleArn?.applyValue({ args0 -> args0 }))
            .routingConfig(routingConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [EventEndpointArgs].
 */
@PulumiTagMarker
public class EventEndpointArgsBuilder internal constructor() {
    private var description: Output? = null

    private var eventBuses: Output>? = null

    private var name: Output? = null

    private var replicationConfig: Output? = null

    private var roleArn: Output? = null

    private var routingConfig: Output? = null

    /**
     * @param value A description of the global endpoint.
     */
    @JvmName("lsywsquijeoatyrm")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("gcsiotjnhqdslwpo")
    public suspend fun eventBuses(`value`: Output>) {
        this.eventBuses = value
    }

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

    /**
     * @param values The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("cdakggpamjlphdjo")
    public suspend fun eventBuses(values: List>) {
        this.eventBuses = Output.all(values)
    }

    /**
     * @param value The name of the global endpoint.
     */
    @JvmName("wqrysqwdkbragncr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Parameters used for replication. Documented below.
     */
    @JvmName("iudmvwcodbluhigm")
    public suspend fun replicationConfig(`value`: Output) {
        this.replicationConfig = value
    }

    /**
     * @param value The ARN of the IAM role used for replication between event buses.
     */
    @JvmName("nxvelhbcmngufnhh")
    public suspend fun roleArn(`value`: Output) {
        this.roleArn = value
    }

    /**
     * @param value Parameters used for routing, including the health check and secondary Region. Documented below.
     */
    @JvmName("tqkobfxwxtyepygu")
    public suspend fun routingConfig(`value`: Output) {
        this.routingConfig = value
    }

    /**
     * @param value A description of the global endpoint.
     */
    @JvmName("fmhljrugkgfnpjeb")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("gnqnwekhxaoeciww")
    public suspend fun eventBuses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventBuses = mapped
    }

    /**
     * @param argument The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("dnubfqomgxijhnet")
    public suspend fun eventBuses(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EventEndpointEventBusArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.eventBuses = mapped
    }

    /**
     * @param argument The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("ouxwfgvasrfblyyl")
    public suspend fun eventBuses(vararg argument: suspend EventEndpointEventBusArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EventEndpointEventBusArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.eventBuses = mapped
    }

    /**
     * @param argument The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("scgkmycnjtxuspnc")
    public suspend fun eventBuses(argument: suspend EventEndpointEventBusArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(EventEndpointEventBusArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.eventBuses = mapped
    }

    /**
     * @param values The event buses to use. The names of the event buses must be identical in each Region. Exactly two event buses are required. Documented below.
     */
    @JvmName("vtxcgvdjckxpvpks")
    public suspend fun eventBuses(vararg values: EventEndpointEventBusArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.eventBuses = mapped
    }

    /**
     * @param value The name of the global endpoint.
     */
    @JvmName("qnkfcehyeyralifr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Parameters used for replication. Documented below.
     */
    @JvmName("pthaatyendrfttmq")
    public suspend fun replicationConfig(`value`: EventEndpointReplicationConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicationConfig = mapped
    }

    /**
     * @param argument Parameters used for replication. Documented below.
     */
    @JvmName("ghnwuktjswfwqhqp")
    public suspend fun replicationConfig(argument: suspend EventEndpointReplicationConfigArgsBuilder.() -> Unit) {
        val toBeMapped = EventEndpointReplicationConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.replicationConfig = mapped
    }

    /**
     * @param value The ARN of the IAM role used for replication between event buses.
     */
    @JvmName("erpgevrdaaipuivj")
    public suspend fun roleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleArn = mapped
    }

    /**
     * @param value Parameters used for routing, including the health check and secondary Region. Documented below.
     */
    @JvmName("amjwuymfvqqpyyta")
    public suspend fun routingConfig(`value`: EventEndpointRoutingConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routingConfig = mapped
    }

    /**
     * @param argument Parameters used for routing, including the health check and secondary Region. Documented below.
     */
    @JvmName("otuqxnwokjlsjjch")
    public suspend fun routingConfig(argument: suspend EventEndpointRoutingConfigArgsBuilder.() -> Unit) {
        val toBeMapped = EventEndpointRoutingConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.routingConfig = mapped
    }

    internal fun build(): EventEndpointArgs = EventEndpointArgs(
        description = description,
        eventBuses = eventBuses,
        name = name,
        replicationConfig = replicationConfig,
        roleArn = roleArn,
        routingConfig = routingConfig,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy