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

com.pulumi.azure.voice.kotlin.ServicesCommunicationsGateway.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.voice.kotlin

import com.pulumi.azure.voice.kotlin.outputs.ServicesCommunicationsGatewayServiceLocation
import com.pulumi.azure.voice.kotlin.outputs.ServicesCommunicationsGatewayServiceLocation.Companion.toKotlin
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 kotlin.collections.List
import kotlin.collections.Map

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

    public var args: ServicesCommunicationsGatewayArgs = ServicesCommunicationsGatewayArgs()

    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 ServicesCommunicationsGatewayArgsBuilder.() -> Unit) {
        val builder = ServicesCommunicationsGatewayArgsBuilder()
        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(): ServicesCommunicationsGateway {
        val builtJavaResource =
            com.pulumi.azure.voice.ServicesCommunicationsGateway(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ServicesCommunicationsGateway(builtJavaResource)
    }
}

/**
 * Manages a Voice Services Communications Gateways.
 * !> **NOTE:** You must have signed an Operator Connect agreement with Microsoft to use this resource. For more information, see [`Prerequisites`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#prerequisites).
 * !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details.
 * ## 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 exampleServicesCommunicationsGateway = new azure.voice.ServicesCommunicationsGateway("example", {
 *     name: "example-vcg",
 *     location: "West Europe",
 *     resourceGroupName: example.name,
 *     connectivity: "PublicAddress",
 *     codecs: "PCMA",
 *     e911Type: "DirectToEsrp",
 *     platforms: [
 *         "OperatorConnect",
 *         "TeamsPhoneMobile",
 *     ],
 *     serviceLocations: [
 *         {
 *             location: "eastus",
 *             allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"],
 *             allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"],
 *             esrpAddresses: ["198.51.100.3"],
 *             operatorAddresses: ["198.51.100.1"],
 *         },
 *         {
 *             location: "eastus2",
 *             allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"],
 *             allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"],
 *             esrpAddresses: ["198.51.100.4"],
 *             operatorAddresses: ["198.51.100.2"],
 *         },
 *     ],
 *     autoGeneratedDomainNameLabelScope: "SubscriptionReuse",
 *     apiBridge: JSON.stringify({}),
 *     emergencyDialStrings: [
 *         "911",
 *         "933",
 *     ],
 *     onPremMcpEnabled: false,
 *     tags: {
 *         key: "value",
 *     },
 *     microsoftTeamsVoicemailPilotNumber: "1",
 * });
 * ```
 * ```python
 * import pulumi
 * import json
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_services_communications_gateway = azure.voice.ServicesCommunicationsGateway("example",
 *     name="example-vcg",
 *     location="West Europe",
 *     resource_group_name=example.name,
 *     connectivity="PublicAddress",
 *     codecs="PCMA",
 *     e911_type="DirectToEsrp",
 *     platforms=[
 *         "OperatorConnect",
 *         "TeamsPhoneMobile",
 *     ],
 *     service_locations=[
 *         {
 *             "location": "eastus",
 *             "allowed_media_source_address_prefixes": ["10.1.2.0/24"],
 *             "allowed_signaling_source_address_prefixes": ["10.1.1.0/24"],
 *             "esrp_addresses": ["198.51.100.3"],
 *             "operator_addresses": ["198.51.100.1"],
 *         },
 *         {
 *             "location": "eastus2",
 *             "allowed_media_source_address_prefixes": ["10.2.2.0/24"],
 *             "allowed_signaling_source_address_prefixes": ["10.2.1.0/24"],
 *             "esrp_addresses": ["198.51.100.4"],
 *             "operator_addresses": ["198.51.100.2"],
 *         },
 *     ],
 *     auto_generated_domain_name_label_scope="SubscriptionReuse",
 *     api_bridge=json.dumps({}),
 *     emergency_dial_strings=[
 *         "911",
 *         "933",
 *     ],
 *     on_prem_mcp_enabled=False,
 *     tags={
 *         "key": "value",
 *     },
 *     microsoft_teams_voicemail_pilot_number="1")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using System.Text.Json;
 * 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 exampleServicesCommunicationsGateway = new Azure.Voice.ServicesCommunicationsGateway("example", new()
 *     {
 *         Name = "example-vcg",
 *         Location = "West Europe",
 *         ResourceGroupName = example.Name,
 *         Connectivity = "PublicAddress",
 *         Codecs = "PCMA",
 *         E911Type = "DirectToEsrp",
 *         Platforms = new[]
 *         {
 *             "OperatorConnect",
 *             "TeamsPhoneMobile",
 *         },
 *         ServiceLocations = new[]
 *         {
 *             new Azure.Voice.Inputs.ServicesCommunicationsGatewayServiceLocationArgs
 *             {
 *                 Location = "eastus",
 *                 AllowedMediaSourceAddressPrefixes = new[]
 *                 {
 *                     "10.1.2.0/24",
 *                 },
 *                 AllowedSignalingSourceAddressPrefixes = new[]
 *                 {
 *                     "10.1.1.0/24",
 *                 },
 *                 EsrpAddresses = new[]
 *                 {
 *                     "198.51.100.3",
 *                 },
 *                 OperatorAddresses = new[]
 *                 {
 *                     "198.51.100.1",
 *                 },
 *             },
 *             new Azure.Voice.Inputs.ServicesCommunicationsGatewayServiceLocationArgs
 *             {
 *                 Location = "eastus2",
 *                 AllowedMediaSourceAddressPrefixes = new[]
 *                 {
 *                     "10.2.2.0/24",
 *                 },
 *                 AllowedSignalingSourceAddressPrefixes = new[]
 *                 {
 *                     "10.2.1.0/24",
 *                 },
 *                 EsrpAddresses = new[]
 *                 {
 *                     "198.51.100.4",
 *                 },
 *                 OperatorAddresses = new[]
 *                 {
 *                     "198.51.100.2",
 *                 },
 *             },
 *         },
 *         AutoGeneratedDomainNameLabelScope = "SubscriptionReuse",
 *         ApiBridge = JsonSerializer.Serialize(new Dictionary
 *         {
 *         }),
 *         EmergencyDialStrings = new[]
 *         {
 *             "911",
 *             "933",
 *         },
 *         OnPremMcpEnabled = false,
 *         Tags =
 *         {
 *             { "key", "value" },
 *         },
 *         MicrosoftTeamsVoicemailPilotNumber = "1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"encoding/json"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/voice"
 * 	"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
 * 		}
 * 		tmpJSON0, err := json.Marshal(nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		json0 := string(tmpJSON0)
 * 		_, err = voice.NewServicesCommunicationsGateway(ctx, "example", &voice.ServicesCommunicationsGatewayArgs{
 * 			Name:              pulumi.String("example-vcg"),
 * 			Location:          pulumi.String("West Europe"),
 * 			ResourceGroupName: example.Name,
 * 			Connectivity:      pulumi.String("PublicAddress"),
 * 			Codecs:            pulumi.String("PCMA"),
 * 			E911Type:          pulumi.String("DirectToEsrp"),
 * 			Platforms: pulumi.StringArray{
 * 				pulumi.String("OperatorConnect"),
 * 				pulumi.String("TeamsPhoneMobile"),
 * 			},
 * 			ServiceLocations: voice.ServicesCommunicationsGatewayServiceLocationArray{
 * 				&voice.ServicesCommunicationsGatewayServiceLocationArgs{
 * 					Location: pulumi.String("eastus"),
 * 					AllowedMediaSourceAddressPrefixes: pulumi.StringArray{
 * 						pulumi.String("10.1.2.0/24"),
 * 					},
 * 					AllowedSignalingSourceAddressPrefixes: pulumi.StringArray{
 * 						pulumi.String("10.1.1.0/24"),
 * 					},
 * 					EsrpAddresses: pulumi.StringArray{
 * 						pulumi.String("198.51.100.3"),
 * 					},
 * 					OperatorAddresses: pulumi.StringArray{
 * 						pulumi.String("198.51.100.1"),
 * 					},
 * 				},
 * 				&voice.ServicesCommunicationsGatewayServiceLocationArgs{
 * 					Location: pulumi.String("eastus2"),
 * 					AllowedMediaSourceAddressPrefixes: pulumi.StringArray{
 * 						pulumi.String("10.2.2.0/24"),
 * 					},
 * 					AllowedSignalingSourceAddressPrefixes: pulumi.StringArray{
 * 						pulumi.String("10.2.1.0/24"),
 * 					},
 * 					EsrpAddresses: pulumi.StringArray{
 * 						pulumi.String("198.51.100.4"),
 * 					},
 * 					OperatorAddresses: pulumi.StringArray{
 * 						pulumi.String("198.51.100.2"),
 * 					},
 * 				},
 * 			},
 * 			AutoGeneratedDomainNameLabelScope: pulumi.String("SubscriptionReuse"),
 * 			ApiBridge:                         pulumi.String(json0),
 * 			EmergencyDialStrings: pulumi.StringArray{
 * 				pulumi.String("911"),
 * 				pulumi.String("933"),
 * 			},
 * 			OnPremMcpEnabled: pulumi.Bool(false),
 * 			Tags: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 			MicrosoftTeamsVoicemailPilotNumber: pulumi.String("1"),
 * 		})
 * 		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.voice.ServicesCommunicationsGateway;
 * import com.pulumi.azure.voice.ServicesCommunicationsGatewayArgs;
 * import com.pulumi.azure.voice.inputs.ServicesCommunicationsGatewayServiceLocationArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * 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 exampleServicesCommunicationsGateway = new ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", ServicesCommunicationsGatewayArgs.builder()
 *             .name("example-vcg")
 *             .location("West Europe")
 *             .resourceGroupName(example.name())
 *             .connectivity("PublicAddress")
 *             .codecs("PCMA")
 *             .e911Type("DirectToEsrp")
 *             .platforms(
 *                 "OperatorConnect",
 *                 "TeamsPhoneMobile")
 *             .serviceLocations(
 *                 ServicesCommunicationsGatewayServiceLocationArgs.builder()
 *                     .location("eastus")
 *                     .allowedMediaSourceAddressPrefixes("10.1.2.0/24")
 *                     .allowedSignalingSourceAddressPrefixes("10.1.1.0/24")
 *                     .esrpAddresses("198.51.100.3")
 *                     .operatorAddresses("198.51.100.1")
 *                     .build(),
 *                 ServicesCommunicationsGatewayServiceLocationArgs.builder()
 *                     .location("eastus2")
 *                     .allowedMediaSourceAddressPrefixes("10.2.2.0/24")
 *                     .allowedSignalingSourceAddressPrefixes("10.2.1.0/24")
 *                     .esrpAddresses("198.51.100.4")
 *                     .operatorAddresses("198.51.100.2")
 *                     .build())
 *             .autoGeneratedDomainNameLabelScope("SubscriptionReuse")
 *             .apiBridge(serializeJson(
 *                 jsonObject(
 *                 )))
 *             .emergencyDialStrings(
 *                 "911",
 *                 "933")
 *             .onPremMcpEnabled(false)
 *             .tags(Map.of("key", "value"))
 *             .microsoftTeamsVoicemailPilotNumber("1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleServicesCommunicationsGateway:
 *     type: azure:voice:ServicesCommunicationsGateway
 *     name: example
 *     properties:
 *       name: example-vcg
 *       location: West Europe
 *       resourceGroupName: ${example.name}
 *       connectivity: PublicAddress
 *       codecs: PCMA
 *       e911Type: DirectToEsrp
 *       platforms:
 *         - OperatorConnect
 *         - TeamsPhoneMobile
 *       serviceLocations:
 *         - location: eastus
 *           allowedMediaSourceAddressPrefixes:
 *             - 10.1.2.0/24
 *           allowedSignalingSourceAddressPrefixes:
 *             - 10.1.1.0/24
 *           esrpAddresses:
 *             - 198.51.100.3
 *           operatorAddresses:
 *             - 198.51.100.1
 *         - location: eastus2
 *           allowedMediaSourceAddressPrefixes:
 *             - 10.2.2.0/24
 *           allowedSignalingSourceAddressPrefixes:
 *             - 10.2.1.0/24
 *           esrpAddresses:
 *             - 198.51.100.4
 *           operatorAddresses:
 *             - 198.51.100.2
 *       autoGeneratedDomainNameLabelScope: SubscriptionReuse
 *       apiBridge:
 *         fn::toJSON: {}
 *       emergencyDialStrings:
 *         - '911'
 *         - '933'
 *       onPremMcpEnabled: false
 *       tags:
 *         key: value
 *       microsoftTeamsVoicemailPilotNumber: '1'
 * ```
 * 
 * ## Import
 * Voice Services Communications Gateways can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:voice/servicesCommunicationsGateway:ServicesCommunicationsGateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.VoiceServices/communicationsGateways/communicationsGateway1
 * ```
 */
public class ServicesCommunicationsGateway internal constructor(
    override val javaResource: com.pulumi.azure.voice.ServicesCommunicationsGateway,
) : KotlinCustomResource(javaResource, ServicesCommunicationsGatewayMapper) {
    /**
     * Details of API bridge functionality, if required.
     */
    public val apiBridge: Output?
        get() = javaResource.apiBridge().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specifies the scope at which the auto-generated domain name can be re-used. Possible values are `TenantReuse`, `SubscriptionReuse`, `ResourceGroupReuse` and `NoReuse` . Changing this forces a new resource to be created. Defaults to `TenantReuse`.
     */
    public val autoGeneratedDomainNameLabelScope: Output?
        get() = javaResource.autoGeneratedDomainNameLabelScope().applyValue({ args0 ->
            args0.map({ args0 -> args0 }).orElse(null)
        })

    /**
     * The voice codecs expected for communication with Teams. Possible values are `PCMA`, `PCMU`,`G722`,`G722_2`,`SILK_8` and `SILK_16`.
     */
    public val codecs: Output
        get() = javaResource.codecs().applyValue({ args0 -> args0 })

    /**
     * How to connect back to the operator network, e.g. MAPS. Possible values is `PublicAddress`. Changing this forces a new Voice Services Communications Gateways to be created.
     */
    public val connectivity: Output
        get() = javaResource.connectivity().applyValue({ args0 -> args0 })

    /**
     * How to handle 911 calls. Possible values are `Standard` and `DirectToEsrp`.
     */
    public val e911Type: Output
        get() = javaResource.e911Type().applyValue({ args0 -> args0 })

    /**
     * A list of dial strings used for emergency calling.
     */
    public val emergencyDialStrings: Output>?
        get() = javaResource.emergencyDialStrings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Specifies the Azure Region where the Voice Services Communications Gateways should exist. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * This number is used in Teams Phone Mobile scenarios for access to the voicemail IVR from the native dialer.
     */
    public val microsoftTeamsVoicemailPilotNumber: Output?
        get() = javaResource.microsoftTeamsVoicemailPilotNumber().applyValue({ args0 ->
            args0.map({ args0 -> args0 }).orElse(null)
        })

    /**
     * Specifies the name which should be used for this Voice Services Communications Gateways. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Whether an on-premises Mobile Control Point is in use.
     */
    public val onPremMcpEnabled: Output?
        get() = javaResource.onPremMcpEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Voice Services Communications GatewaysAvailable supports platform types. Possible values are `OperatorConnect`, `TeamsPhoneMobile`.
     */
    public val platforms: Output>
        get() = javaResource.platforms().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Specifies the name of the Resource Group where the Voice Services Communications Gateways should exist. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A `service_location` block as defined below.
     */
    public val serviceLocations: Output>
        get() = javaResource.serviceLocations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            })
        })

    /**
     * A mapping of tags which should be assigned to the Voice Services Communications Gateways.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object ServicesCommunicationsGatewayMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.voice.ServicesCommunicationsGateway::class == javaResource::class

    override fun map(javaResource: Resource): ServicesCommunicationsGateway =
        ServicesCommunicationsGateway(
            javaResource as
                com.pulumi.azure.voice.ServicesCommunicationsGateway,
        )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy