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

com.pulumi.azure.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: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.eventgrid.kotlin

import com.pulumi.azure.eventgrid.TopicArgs.builder
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicIdentityArgs
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicIdentityArgsBuilder
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInboundIpRuleArgs
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInboundIpRuleArgsBuilder
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInputMappingDefaultValuesArgs
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInputMappingDefaultValuesArgsBuilder
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInputMappingFieldsArgs
import com.pulumi.azure.eventgrid.kotlin.inputs.TopicInputMappingFieldsArgsBuilder
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

/**
 * Manages an EventGrid Topic
 * > **Note:** at this time EventGrid Topic's are only available in a limited number of regions.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleTopic = new azure.eventgrid.Topic("example", {
 *     name: "my-eventgrid-topic",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_topic = azure.eventgrid.Topic("example",
 *     name="my-eventgrid-topic",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     tags={
 *         "environment": "Production",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleTopic = new Azure.EventGrid.Topic("example", new()
 *     {
 *         Name = "my-eventgrid-topic",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Tags =
 *         {
 *             { "environment", "Production" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = eventgrid.NewTopic(ctx, "example", &eventgrid.TopicArgs{
 * 			Name:              pulumi.String("my-eventgrid-topic"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("Production"),
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.eventgrid.Topic;
 * import com.pulumi.azure.eventgrid.TopicArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
 *             .name("my-eventgrid-topic")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tags(Map.of("environment", "Production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleTopic:
 *     type: azure:eventgrid:Topic
 *     name: example
 *     properties:
 *       name: my-eventgrid-topic
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       tags:
 *         environment: Production
 * ```
 * 
 * ## Import
 * EventGrid Topic's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:eventgrid/topic:Topic topic1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventGrid/topics/topic1
 * ```
 * @property identity An `identity` block as defined below.
 * @property inboundIpRules One or more `inbound_ip_rule` blocks as defined below.
 * @property inputMappingDefaultValues A `input_mapping_default_values` block as defined below. Changing this forces a new resource to be created.
 * @property inputMappingFields A `input_mapping_fields` block as defined below. Changing this forces a new resource to be created.
 * @property inputSchema Specifies the schema in which incoming events will be published to this domain. Allowed values are `CloudEventSchemaV1_0`, `CustomEventSchema`, or `EventGridSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
 * @property localAuthEnabled Whether local authentication methods is enabled for the EventGrid Topic. Defaults to `true`.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specifies the name of the EventGrid Topic resource. Changing this forces a new resource to be created.
 * @property publicNetworkAccessEnabled Whether or not public network access is allowed for this server. Defaults to `true`.
 * @property resourceGroupName The name of the resource group in which the EventGrid Topic exists. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class TopicArgs(
    public val identity: Output? = null,
    public val inboundIpRules: Output>? = null,
    public val inputMappingDefaultValues: Output? = null,
    public val inputMappingFields: Output? = null,
    public val inputSchema: Output? = null,
    public val localAuthEnabled: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val publicNetworkAccessEnabled: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.eventgrid.TopicArgs =
        com.pulumi.azure.eventgrid.TopicArgs.builder()
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .inboundIpRules(
                inboundIpRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .inputMappingDefaultValues(
                inputMappingDefaultValues?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .inputMappingFields(
                inputMappingFields?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .inputSchema(inputSchema?.applyValue({ args0 -> args0 }))
            .localAuthEnabled(localAuthEnabled?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

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

    private var inboundIpRules: Output>? = null

    private var inputMappingDefaultValues: Output? = null

    private var inputMappingFields: Output? = null

    private var inputSchema: Output? = null

    private var localAuthEnabled: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var publicNetworkAccessEnabled: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("tftosuubmmotvheh")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("nnmmrekpksiucsji")
    public suspend fun inboundIpRules(`value`: Output>) {
        this.inboundIpRules = value
    }

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

    /**
     * @param values One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("hwrixktjrwpdrrie")
    public suspend fun inboundIpRules(values: List>) {
        this.inboundIpRules = Output.all(values)
    }

    /**
     * @param value A `input_mapping_default_values` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("vrmtwghwhctpctxn")
    public suspend
    fun inputMappingDefaultValues(`value`: Output) {
        this.inputMappingDefaultValues = value
    }

    /**
     * @param value A `input_mapping_fields` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("nuypafrmnihviiun")
    public suspend fun inputMappingFields(`value`: Output) {
        this.inputMappingFields = value
    }

    /**
     * @param value Specifies the schema in which incoming events will be published to this domain. Allowed values are `CloudEventSchemaV1_0`, `CustomEventSchema`, or `EventGridSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
     */
    @JvmName("ldxjdbkrveoxytja")
    public suspend fun inputSchema(`value`: Output) {
        this.inputSchema = value
    }

    /**
     * @param value Whether local authentication methods is enabled for the EventGrid Topic. Defaults to `true`.
     */
    @JvmName("nplygqiwdgjurhxn")
    public suspend fun localAuthEnabled(`value`: Output) {
        this.localAuthEnabled = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("gigrelwjwtuhwnxp")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the EventGrid Topic resource. Changing this forces a new resource to be created.
     */
    @JvmName("uubufxofbxlaeels")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Whether or not public network access is allowed for this server. Defaults to `true`.
     */
    @JvmName("sjvcjuvlpofbsxog")
    public suspend fun publicNetworkAccessEnabled(`value`: Output) {
        this.publicNetworkAccessEnabled = value
    }

    /**
     * @param value The name of the resource group in which the EventGrid Topic exists. Changing this forces a new resource to be created.
     */
    @JvmName("yabafcotrsmacyoi")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("grlgroqrdbjmifrb")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("lrsvrlfqygasuqql")
    public suspend fun identity(`value`: TopicIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below.
     */
    @JvmName("uuynxlpnlcyxcbyg")
    public suspend fun identity(argument: suspend TopicIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = TopicIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("xjvavebuixhipvak")
    public suspend fun inboundIpRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inboundIpRules = mapped
    }

    /**
     * @param argument One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("qsaylkawbgdirjlx")
    public suspend
    fun inboundIpRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TopicInboundIpRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param argument One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("cfrhuyekumxpdsox")
    public suspend fun inboundIpRules(
        vararg
        argument: suspend TopicInboundIpRuleArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            TopicInboundIpRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param argument One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("kkbgllhdlnxfxvxr")
    public suspend fun inboundIpRules(argument: suspend TopicInboundIpRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TopicInboundIpRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.inboundIpRules = mapped
    }

    /**
     * @param values One or more `inbound_ip_rule` blocks as defined below.
     */
    @JvmName("xgrihawxycrmewqs")
    public suspend fun inboundIpRules(vararg values: TopicInboundIpRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.inboundIpRules = mapped
    }

    /**
     * @param value A `input_mapping_default_values` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("nmqxtodaienxssvg")
    public suspend fun inputMappingDefaultValues(`value`: TopicInputMappingDefaultValuesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputMappingDefaultValues = mapped
    }

    /**
     * @param argument A `input_mapping_default_values` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("tyblipxpqrxbfdsy")
    public suspend
    fun inputMappingDefaultValues(argument: suspend TopicInputMappingDefaultValuesArgsBuilder.() -> Unit) {
        val toBeMapped = TopicInputMappingDefaultValuesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.inputMappingDefaultValues = mapped
    }

    /**
     * @param value A `input_mapping_fields` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("hyipfkqrlhrcudik")
    public suspend fun inputMappingFields(`value`: TopicInputMappingFieldsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputMappingFields = mapped
    }

    /**
     * @param argument A `input_mapping_fields` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("qoatyscmithpcfpe")
    public suspend
    fun inputMappingFields(argument: suspend TopicInputMappingFieldsArgsBuilder.() -> Unit) {
        val toBeMapped = TopicInputMappingFieldsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.inputMappingFields = mapped
    }

    /**
     * @param value Specifies the schema in which incoming events will be published to this domain. Allowed values are `CloudEventSchemaV1_0`, `CustomEventSchema`, or `EventGridSchema`. Defaults to `EventGridSchema`. Changing this forces a new resource to be created.
     */
    @JvmName("eyuvrrawqhcajvio")
    public suspend fun inputSchema(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.inputSchema = mapped
    }

    /**
     * @param value Whether local authentication methods is enabled for the EventGrid Topic. Defaults to `true`.
     */
    @JvmName("pxpiwhiuiwbehbfx")
    public suspend fun localAuthEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.localAuthEnabled = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("gbkcsrxegbfnrtol")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the EventGrid Topic resource. Changing this forces a new resource to be created.
     */
    @JvmName("cyoeeahxgiswdsjm")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Whether or not public network access is allowed for this server. Defaults to `true`.
     */
    @JvmName("fpbrdxgthtofoofk")
    public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccessEnabled = mapped
    }

    /**
     * @param value The name of the resource group in which the EventGrid Topic exists. Changing this forces a new resource to be created.
     */
    @JvmName("mclwlppsqukygubt")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

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

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

    internal fun build(): TopicArgs = TopicArgs(
        identity = identity,
        inboundIpRules = inboundIpRules,
        inputMappingDefaultValues = inputMappingDefaultValues,
        inputMappingFields = inputMappingFields,
        inputSchema = inputSchema,
        localAuthEnabled = localAuthEnabled,
        location = location,
        name = name,
        publicNetworkAccessEnabled = publicNetworkAccessEnabled,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy