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

com.pulumi.azurenative.eventgrid.kotlin.TopicArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.eventgrid.kotlin

import com.pulumi.azurenative.eventgrid.TopicArgs.builder
import com.pulumi.azurenative.eventgrid.kotlin.enums.DataResidencyBoundary
import com.pulumi.azurenative.eventgrid.kotlin.enums.InputSchema
import com.pulumi.azurenative.eventgrid.kotlin.enums.PublicNetworkAccess
import com.pulumi.azurenative.eventgrid.kotlin.inputs.IdentityInfoArgs
import com.pulumi.azurenative.eventgrid.kotlin.inputs.IdentityInfoArgsBuilder
import com.pulumi.azurenative.eventgrid.kotlin.inputs.InboundIpRuleArgs
import com.pulumi.azurenative.eventgrid.kotlin.inputs.InboundIpRuleArgsBuilder
import com.pulumi.azurenative.eventgrid.kotlin.inputs.JsonInputSchemaMappingArgs
import com.pulumi.azurenative.eventgrid.kotlin.inputs.JsonInputSchemaMappingArgsBuilder
import com.pulumi.core.Either
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * EventGrid Topic
 * Azure REST API version: 2022-06-15. Prior API version in Azure Native 1.x: 2020-06-01.
 * Other available API versions: 2020-04-01-preview, 2023-06-01-preview, 2023-12-15-preview, 2024-06-01-preview.
 * ## Example Usage
 * ### Topics_CreateOrUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var topic = new AzureNative.EventGrid.Topic("topic", new()
 *     {
 *         InboundIpRules = new[]
 *         {
 *             new AzureNative.EventGrid.Inputs.InboundIpRuleArgs
 *             {
 *                 Action = AzureNative.EventGrid.IpActionType.Allow,
 *                 IpMask = "12.18.30.15",
 *             },
 *             new AzureNative.EventGrid.Inputs.InboundIpRuleArgs
 *             {
 *                 Action = AzureNative.EventGrid.IpActionType.Allow,
 *                 IpMask = "12.18.176.1",
 *             },
 *         },
 *         Location = "westus2",
 *         PublicNetworkAccess = AzureNative.EventGrid.PublicNetworkAccess.Enabled,
 *         ResourceGroupName = "examplerg",
 *         Tags =
 *         {
 *             { "tag1", "value1" },
 *             { "tag2", "value2" },
 *         },
 *         TopicName = "exampletopic1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	eventgrid "github.com/pulumi/pulumi-azure-native-sdk/eventgrid/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := eventgrid.NewTopic(ctx, "topic", &eventgrid.TopicArgs{
 * 			InboundIpRules: eventgrid.InboundIpRuleArray{
 * 				&eventgrid.InboundIpRuleArgs{
 * 					Action: pulumi.String(eventgrid.IpActionTypeAllow),
 * 					IpMask: pulumi.String("12.18.30.15"),
 * 				},
 * 				&eventgrid.InboundIpRuleArgs{
 * 					Action: pulumi.String(eventgrid.IpActionTypeAllow),
 * 					IpMask: pulumi.String("12.18.176.1"),
 * 				},
 * 			},
 * 			Location:            pulumi.String("westus2"),
 * 			PublicNetworkAccess: pulumi.String(eventgrid.PublicNetworkAccessEnabled),
 * 			ResourceGroupName:   pulumi.String("examplerg"),
 * 			Tags: pulumi.StringMap{
 * 				"tag1": pulumi.String("value1"),
 * 				"tag2": pulumi.String("value2"),
 * 			},
 * 			TopicName: pulumi.String("exampletopic1"),
 * 		})
 * 		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.azurenative.eventgrid.Topic;
 * import com.pulumi.azurenative.eventgrid.TopicArgs;
 * import com.pulumi.azurenative.eventgrid.inputs.InboundIpRuleArgs;
 * 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 topic = new Topic("topic", TopicArgs.builder()
 *             .inboundIpRules(
 *                 InboundIpRuleArgs.builder()
 *                     .action("Allow")
 *                     .ipMask("12.18.30.15")
 *                     .build(),
 *                 InboundIpRuleArgs.builder()
 *                     .action("Allow")
 *                     .ipMask("12.18.176.1")
 *                     .build())
 *             .location("westus2")
 *             .publicNetworkAccess("Enabled")
 *             .resourceGroupName("examplerg")
 *             .tags(Map.ofEntries(
 *                 Map.entry("tag1", "value1"),
 *                 Map.entry("tag2", "value2")
 *             ))
 *             .topicName("exampletopic1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:eventgrid:Topic exampletopic1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}
 * ```
 * @property dataResidencyBoundary Data Residency Boundary of the resource.
 * @property disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.
 * @property identity Identity information for the resource.
 * @property inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
 * @property inputSchema This determines the format that Event Grid should expect for incoming events published to the topic.
 * @property inputSchemaMapping This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
 * @property location Location of the resource.
 * @property publicNetworkAccess This determines if traffic is allowed over public network. By default it is enabled.
 * You can further restrict to specific IPs by configuring 
 * @property resourceGroupName The name of the resource group within the user's subscription.
 * @property tags Tags of the resource.
 * @property topicName Name of the topic.
 */
public data class TopicArgs(
    public val dataResidencyBoundary: Output>? = null,
    public val disableLocalAuth: Output? = null,
    public val identity: Output? = null,
    public val inboundIpRules: Output>? = null,
    public val inputSchema: Output>? = null,
    public val inputSchemaMapping: Output? = null,
    public val location: Output? = null,
    public val publicNetworkAccess: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
    public val topicName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.eventgrid.TopicArgs =
        com.pulumi.azurenative.eventgrid.TopicArgs.builder()
            .dataResidencyBoundary(
                dataResidencyBoundary?.applyValue({ args0 ->
                    args0.transform({ args0 ->
                        args0
                    }, { args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .disableLocalAuth(disableLocalAuth?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .inboundIpRules(
                inboundIpRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .inputSchema(
                inputSchema?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .inputSchemaMapping(
                inputSchemaMapping?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .publicNetworkAccess(
                publicNetworkAccess?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .topicName(topicName?.applyValue({ args0 -> args0 })).build()
}

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

    private var disableLocalAuth: Output? = null

    private var identity: Output? = null

    private var inboundIpRules: Output>? = null

    private var inputSchema: Output>? = null

    private var inputSchemaMapping: Output? = null

    private var location: Output? = null

    private var publicNetworkAccess: Output>? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    private var topicName: Output? = null

    /**
     * @param value Data Residency Boundary of the resource.
     */
    @JvmName("csqmltsuibpjdcgo")
    public suspend fun dataResidencyBoundary(`value`: Output>) {
        this.dataResidencyBoundary = value
    }

    /**
     * @param value This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.
     */
    @JvmName("oborrwhgmwvqaecb")
    public suspend fun disableLocalAuth(`value`: Output) {
        this.disableLocalAuth = value
    }

    /**
     * @param value Identity information for the resource.
     */
    @JvmName("yonnmibfggiobiyu")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("jamtpfcoibspekaf")
    public suspend fun inboundIpRules(`value`: Output>) {
        this.inboundIpRules = value
    }

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

    /**
     * @param values This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("rnphsirbmssyxxam")
    public suspend fun inboundIpRules(values: List>) {
        this.inboundIpRules = Output.all(values)
    }

    /**
     * @param value This determines the format that Event Grid should expect for incoming events published to the topic.
     */
    @JvmName("ijuygjmvyljheaod")
    public suspend fun inputSchema(`value`: Output>) {
        this.inputSchema = value
    }

    /**
     * @param value This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
     */
    @JvmName("hmxrsptfvgmysmlq")
    public suspend fun inputSchemaMapping(`value`: Output) {
        this.inputSchemaMapping = value
    }

    /**
     * @param value Location of the resource.
     */
    @JvmName("bfbtbmfsecjxewmg")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value This determines if traffic is allowed over public network. By default it is enabled.
     * You can further restrict to specific IPs by configuring 
     */
    @JvmName("ynpegungkqaokwje")
    public suspend fun publicNetworkAccess(`value`: Output>) {
        this.publicNetworkAccess = value
    }

    /**
     * @param value The name of the resource group within the user's subscription.
     */
    @JvmName("epowlnmooymortvr")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Tags of the resource.
     */
    @JvmName("xpgxayugtevnurhn")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Name of the topic.
     */
    @JvmName("xmkbhxvhaqbxrosr")
    public suspend fun topicName(`value`: Output) {
        this.topicName = value
    }

    /**
     * @param value Data Residency Boundary of the resource.
     */
    @JvmName("qpfneycaujiefalp")
    public suspend fun dataResidencyBoundary(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataResidencyBoundary = mapped
    }

    /**
     * @param value Data Residency Boundary of the resource.
     */
    @JvmName("rxsvwjrkwodykatw")
    public fun dataResidencyBoundary(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dataResidencyBoundary = mapped
    }

    /**
     * @param value Data Residency Boundary of the resource.
     */
    @JvmName("gldfwnxnnnvhhjcu")
    public fun dataResidencyBoundary(`value`: DataResidencyBoundary) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dataResidencyBoundary = mapped
    }

    /**
     * @param value This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic.
     */
    @JvmName("ybicqdknvhktjdiv")
    public suspend fun disableLocalAuth(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableLocalAuth = mapped
    }

    /**
     * @param value Identity information for the resource.
     */
    @JvmName("ahqsehhicemxhhxf")
    public suspend fun identity(`value`: IdentityInfoArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument Identity information for the resource.
     */
    @JvmName("ycxqyrkhluuiysjc")
    public suspend fun identity(argument: suspend IdentityInfoArgsBuilder.() -> Unit) {
        val toBeMapped = IdentityInfoArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("mfqkvqmsoowsoppt")
    public suspend fun inboundIpRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inboundIpRules = mapped
    }

    /**
     * @param argument This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("mejhkbnyijhhsthl")
    public suspend fun inboundIpRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InboundIpRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param argument This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("lqdguwtjnyffwoaw")
    public suspend fun inboundIpRules(vararg argument: suspend InboundIpRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InboundIpRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param argument This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("crwsilwrsawbuivd")
    public suspend fun inboundIpRules(argument: suspend InboundIpRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InboundIpRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param values This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.
     */
    @JvmName("utdkychkdroqeogu")
    public suspend fun inboundIpRules(vararg values: InboundIpRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inboundIpRules = mapped
    }

    /**
     * @param value This determines the format that Event Grid should expect for incoming events published to the topic.
     */
    @JvmName("mqbxeolsgvbwtabq")
    public suspend fun inputSchema(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputSchema = mapped
    }

    /**
     * @param value This determines the format that Event Grid should expect for incoming events published to the topic.
     */
    @JvmName("xcjmevxetffgjcau")
    public fun inputSchema(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inputSchema = mapped
    }

    /**
     * @param value This determines the format that Event Grid should expect for incoming events published to the topic.
     */
    @JvmName("nlnqhpbdsygeioaf")
    public fun inputSchema(`value`: InputSchema) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inputSchema = mapped
    }

    /**
     * @param value This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
     */
    @JvmName("tctxlhwycudisfrt")
    public suspend fun inputSchemaMapping(`value`: JsonInputSchemaMappingArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputSchemaMapping = mapped
    }

    /**
     * @param argument This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
     */
    @JvmName("gtltyittwvlcdwqi")
    public suspend fun inputSchemaMapping(argument: suspend JsonInputSchemaMappingArgsBuilder.() -> Unit) {
        val toBeMapped = JsonInputSchemaMappingArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.inputSchemaMapping = mapped
    }

    /**
     * @param value Location of the resource.
     */
    @JvmName("knualwsbxgxjunlt")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value This determines if traffic is allowed over public network. By default it is enabled.
     * You can further restrict to specific IPs by configuring 
     */
    @JvmName("qdabbiutdwxlbmdv")
    public suspend fun publicNetworkAccess(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccess = mapped
    }

    /**
     * @param value This determines if traffic is allowed over public network. By default it is enabled.
     * You can further restrict to specific IPs by configuring 
     */
    @JvmName("bqghhpmdqrhtnwqx")
    public fun publicNetworkAccess(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.publicNetworkAccess = mapped
    }

    /**
     * @param value This determines if traffic is allowed over public network. By default it is enabled.
     * You can further restrict to specific IPs by configuring 
     */
    @JvmName("plitnsgiysmfdtho")
    public fun publicNetworkAccess(`value`: PublicNetworkAccess) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.publicNetworkAccess = mapped
    }

    /**
     * @param value The name of the resource group within the user's subscription.
     */
    @JvmName("bgprphtkskvowckn")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Tags of the resource.
     */
    @JvmName("tnkleolcuorvnmym")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Tags of the resource.
     */
    @JvmName("fpygcdpvtcqddopt")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Name of the topic.
     */
    @JvmName("oqchowhitrumubwk")
    public suspend fun topicName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.topicName = mapped
    }

    internal fun build(): TopicArgs = TopicArgs(
        dataResidencyBoundary = dataResidencyBoundary,
        disableLocalAuth = disableLocalAuth,
        identity = identity,
        inboundIpRules = inboundIpRules,
        inputSchema = inputSchema,
        inputSchemaMapping = inputSchemaMapping,
        location = location,
        publicNetworkAccess = publicNetworkAccess,
        resourceGroupName = resourceGroupName,
        tags = tags,
        topicName = topicName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy