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

com.pulumi.awsnative.rds.kotlin.EventSubscriptionArgs.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: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.rds.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.rds.EventSubscriptionArgs.builder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The ``AWS::RDS::EventSubscription`` resource allows you to receive notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service (Amazon SNS). For more information, see [Using Amazon RDS Event Notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) in the *Amazon RDS User Guide*.
 * @property enabled Specifies whether to activate the subscription. If the event notification subscription isn't activated, the subscription is created but not active.
 * @property eventCategories A list of event categories for a particular source type (``SourceType``) that you want to subscribe to. You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html) or the [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html). You can also see this list by using the ``DescribeEventCategories`` operation.
 * @property snsTopicArn The Amazon Resource Name (ARN) of the SNS topic created for event notification. SNS automatically creates the ARN when you create a topic and subscribe to it.
 *   RDS doesn't support FIFO (first in, first out) topics. For more information, see [Message ordering and deduplication (FIFO topics)](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html) in the *Amazon Simple Notification Service Developer Guide*.
 * @property sourceIds The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens.
 *  Constraints:
 *   +  If a ``SourceIds`` value is supplied, ``SourceType`` must also be provided.
 *   +  If the source type is a DB instance, a ``DBInstanceIdentifier`` value must be supplied.
 *   +  If the source type is a DB cluster, a ``DBClusterIdentifier`` value must be supplied.
 *   +  If the source type is a DB parameter group, a ``DBParameterGroupName`` value must be supplied.
 *   +  If the source type is a DB security group, a ``DBSecurityGroupName`` value must be supplied.
 *   +  If the source type is a DB snapshot, a ``DBSnapshotIdentifier`` value must be supplied.
 *   +  If the source type is a DB cluster snapshot, a ``DBClusterSnapshotIdentifier`` value must be supplied.
 * @property sourceType The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, set this parameter to ``db-instance``. If this value isn't specified, all events are returned.
 *  Valid values: ``db-instance`` | ``db-cluster`` | ``db-parameter-group`` | ``db-security-group`` | ``db-snapshot`` | ``db-cluster-snapshot``
 * @property subscriptionName The name of the subscription.
 *  Constraints: The name must be less than 255 characters.
 * @property tags An optional array of key-value pairs to apply to this subscription.
 */
public data class EventSubscriptionArgs(
    public val enabled: Output? = null,
    public val eventCategories: Output>? = null,
    public val snsTopicArn: Output? = null,
    public val sourceIds: Output>? = null,
    public val sourceType: Output? = null,
    public val subscriptionName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.rds.EventSubscriptionArgs =
        com.pulumi.awsnative.rds.EventSubscriptionArgs.builder()
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .eventCategories(eventCategories?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .snsTopicArn(snsTopicArn?.applyValue({ args0 -> args0 }))
            .sourceIds(sourceIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .sourceType(sourceType?.applyValue({ args0 -> args0 }))
            .subscriptionName(subscriptionName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [EventSubscriptionArgs].
 */
@PulumiTagMarker
public class EventSubscriptionArgsBuilder internal constructor() {
    private var enabled: Output? = null

    private var eventCategories: Output>? = null

    private var snsTopicArn: Output? = null

    private var sourceIds: Output>? = null

    private var sourceType: Output? = null

    private var subscriptionName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies whether to activate the subscription. If the event notification subscription isn't activated, the subscription is created but not active.
     */
    @JvmName("yqpcxgxmidynatkm")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value A list of event categories for a particular source type (``SourceType``) that you want to subscribe to. You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html) or the [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html). You can also see this list by using the ``DescribeEventCategories`` operation.
     */
    @JvmName("brpkrbcmchiidemg")
    public suspend fun eventCategories(`value`: Output>) {
        this.eventCategories = value
    }

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

    /**
     * @param values A list of event categories for a particular source type (``SourceType``) that you want to subscribe to. You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html) or the [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html). You can also see this list by using the ``DescribeEventCategories`` operation.
     */
    @JvmName("abmsvfkcgknnufjb")
    public suspend fun eventCategories(values: List>) {
        this.eventCategories = Output.all(values)
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the SNS topic created for event notification. SNS automatically creates the ARN when you create a topic and subscribe to it.
     *   RDS doesn't support FIFO (first in, first out) topics. For more information, see [Message ordering and deduplication (FIFO topics)](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html) in the *Amazon Simple Notification Service Developer Guide*.
     */
    @JvmName("xmdxqvbuocxtqbli")
    public suspend fun snsTopicArn(`value`: Output) {
        this.snsTopicArn = value
    }

    /**
     * @param value The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens.
     *  Constraints:
     *   +  If a ``SourceIds`` value is supplied, ``SourceType`` must also be provided.
     *   +  If the source type is a DB instance, a ``DBInstanceIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster, a ``DBClusterIdentifier`` value must be supplied.
     *   +  If the source type is a DB parameter group, a ``DBParameterGroupName`` value must be supplied.
     *   +  If the source type is a DB security group, a ``DBSecurityGroupName`` value must be supplied.
     *   +  If the source type is a DB snapshot, a ``DBSnapshotIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster snapshot, a ``DBClusterSnapshotIdentifier`` value must be supplied.
     */
    @JvmName("ydkjdyplcbbqfkdn")
    public suspend fun sourceIds(`value`: Output>) {
        this.sourceIds = value
    }

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

    /**
     * @param values The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens.
     *  Constraints:
     *   +  If a ``SourceIds`` value is supplied, ``SourceType`` must also be provided.
     *   +  If the source type is a DB instance, a ``DBInstanceIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster, a ``DBClusterIdentifier`` value must be supplied.
     *   +  If the source type is a DB parameter group, a ``DBParameterGroupName`` value must be supplied.
     *   +  If the source type is a DB security group, a ``DBSecurityGroupName`` value must be supplied.
     *   +  If the source type is a DB snapshot, a ``DBSnapshotIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster snapshot, a ``DBClusterSnapshotIdentifier`` value must be supplied.
     */
    @JvmName("lroowhbrigaqqrwr")
    public suspend fun sourceIds(values: List>) {
        this.sourceIds = Output.all(values)
    }

    /**
     * @param value The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, set this parameter to ``db-instance``. If this value isn't specified, all events are returned.
     *  Valid values: ``db-instance`` | ``db-cluster`` | ``db-parameter-group`` | ``db-security-group`` | ``db-snapshot`` | ``db-cluster-snapshot``
     */
    @JvmName("wokllcydxfidkhby")
    public suspend fun sourceType(`value`: Output) {
        this.sourceType = value
    }

    /**
     * @param value The name of the subscription.
     *  Constraints: The name must be less than 255 characters.
     */
    @JvmName("gfblsahelqfocxcg")
    public suspend fun subscriptionName(`value`: Output) {
        this.subscriptionName = value
    }

    /**
     * @param value An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("phrciqhcejpmnjvx")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("ouwxedqhrsyyhjet")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value Specifies whether to activate the subscription. If the event notification subscription isn't activated, the subscription is created but not active.
     */
    @JvmName("hkwcoukalubtwgmy")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value A list of event categories for a particular source type (``SourceType``) that you want to subscribe to. You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html) or the [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html). You can also see this list by using the ``DescribeEventCategories`` operation.
     */
    @JvmName("busfonexvqupbirk")
    public suspend fun eventCategories(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventCategories = mapped
    }

    /**
     * @param values A list of event categories for a particular source type (``SourceType``) that you want to subscribe to. You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html) or the [Amazon Aurora User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html). You can also see this list by using the ``DescribeEventCategories`` operation.
     */
    @JvmName("rixyomnehyxyqqje")
    public suspend fun eventCategories(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.eventCategories = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the SNS topic created for event notification. SNS automatically creates the ARN when you create a topic and subscribe to it.
     *   RDS doesn't support FIFO (first in, first out) topics. For more information, see [Message ordering and deduplication (FIFO topics)](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html) in the *Amazon Simple Notification Service Developer Guide*.
     */
    @JvmName("xqdguwmeidwjwmui")
    public suspend fun snsTopicArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.snsTopicArn = mapped
    }

    /**
     * @param value The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens.
     *  Constraints:
     *   +  If a ``SourceIds`` value is supplied, ``SourceType`` must also be provided.
     *   +  If the source type is a DB instance, a ``DBInstanceIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster, a ``DBClusterIdentifier`` value must be supplied.
     *   +  If the source type is a DB parameter group, a ``DBParameterGroupName`` value must be supplied.
     *   +  If the source type is a DB security group, a ``DBSecurityGroupName`` value must be supplied.
     *   +  If the source type is a DB snapshot, a ``DBSnapshotIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster snapshot, a ``DBClusterSnapshotIdentifier`` value must be supplied.
     */
    @JvmName("ueiuvoyfftrxgsym")
    public suspend fun sourceIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceIds = mapped
    }

    /**
     * @param values The list of identifiers of the event sources for which events are returned. If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens. It can't end with a hyphen or contain two consecutive hyphens.
     *  Constraints:
     *   +  If a ``SourceIds`` value is supplied, ``SourceType`` must also be provided.
     *   +  If the source type is a DB instance, a ``DBInstanceIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster, a ``DBClusterIdentifier`` value must be supplied.
     *   +  If the source type is a DB parameter group, a ``DBParameterGroupName`` value must be supplied.
     *   +  If the source type is a DB security group, a ``DBSecurityGroupName`` value must be supplied.
     *   +  If the source type is a DB snapshot, a ``DBSnapshotIdentifier`` value must be supplied.
     *   +  If the source type is a DB cluster snapshot, a ``DBClusterSnapshotIdentifier`` value must be supplied.
     */
    @JvmName("ussehnegvjjphfqf")
    public suspend fun sourceIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceIds = mapped
    }

    /**
     * @param value The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, set this parameter to ``db-instance``. If this value isn't specified, all events are returned.
     *  Valid values: ``db-instance`` | ``db-cluster`` | ``db-parameter-group`` | ``db-security-group`` | ``db-snapshot`` | ``db-cluster-snapshot``
     */
    @JvmName("ljufqynpsbakwplf")
    public suspend fun sourceType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceType = mapped
    }

    /**
     * @param value The name of the subscription.
     *  Constraints: The name must be less than 255 characters.
     */
    @JvmName("brmeigwvjgvbxpym")
    public suspend fun subscriptionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptionName = mapped
    }

    /**
     * @param value An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("ylopconkwhlmrygd")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("pvtkdsxhbomgwvvh")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("uyeafrkehxvnjgvw")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("juuismfccbccuofu")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values An optional array of key-value pairs to apply to this subscription.
     */
    @JvmName("xyboeaysfcbwerxy")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): EventSubscriptionArgs = EventSubscriptionArgs(
        enabled = enabled,
        eventCategories = eventCategories,
        snsTopicArn = snsTopicArn,
        sourceIds = sourceIds,
        sourceType = sourceType,
        subscriptionName = subscriptionName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy