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

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

package com.pulumi.azure.media.kotlin

import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointAccessControl
import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointCrossSiteAccessPolicy
import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointSkus
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointAccessControl.Companion.toKotlin as streamingEndpointAccessControlToKotlin
import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointCrossSiteAccessPolicy.Companion.toKotlin as streamingEndpointCrossSiteAccessPolicyToKotlin
import com.pulumi.azure.media.kotlin.outputs.StreamingEndpointSkus.Companion.toKotlin as streamingEndpointSkusToKotlin

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

    public var args: StreamingEndpointArgs = StreamingEndpointArgs()

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

/**
 * Manages a Streaming Endpoint.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "media-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestoracc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleServiceAccount = new azure.media.ServiceAccount("example", {
 *     name: "examplemediaacc",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     storageAccounts: [{
 *         id: exampleAccount.id,
 *         isPrimary: true,
 *     }],
 * });
 * const exampleStreamingEndpoint = new azure.media.StreamingEndpoint("example", {
 *     name: "endpoint1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     mediaServicesAccountName: exampleServiceAccount.name,
 *     scaleUnits: 2,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="media-resources",
 *     location="West Europe")
 * example_account = azure.storage.Account("example",
 *     name="examplestoracc",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="GRS")
 * example_service_account = azure.media.ServiceAccount("example",
 *     name="examplemediaacc",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     storage_accounts=[azure.media.ServiceAccountStorageAccountArgs(
 *         id=example_account.id,
 *         is_primary=True,
 *     )])
 * example_streaming_endpoint = azure.media.StreamingEndpoint("example",
 *     name="endpoint1",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     media_services_account_name=example_service_account.name,
 *     scale_units=2)
 * ```
 * ```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 = "media-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplestoracc",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "GRS",
 *     });
 *     var exampleServiceAccount = new Azure.Media.ServiceAccount("example", new()
 *     {
 *         Name = "examplemediaacc",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         StorageAccounts = new[]
 *         {
 *             new Azure.Media.Inputs.ServiceAccountStorageAccountArgs
 *             {
 *                 Id = exampleAccount.Id,
 *                 IsPrimary = true,
 *             },
 *         },
 *     });
 *     var exampleStreamingEndpoint = new Azure.Media.StreamingEndpoint("example", new()
 *     {
 *         Name = "endpoint1",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         MediaServicesAccountName = exampleServiceAccount.Name,
 *         ScaleUnits = 2,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"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("media-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplestoracc"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("GRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleServiceAccount, err := media.NewServiceAccount(ctx, "example", &media.ServiceAccountArgs{
 * 			Name:              pulumi.String("examplemediaacc"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			StorageAccounts: media.ServiceAccountStorageAccountArray{
 * 				&media.ServiceAccountStorageAccountArgs{
 * 					Id:        exampleAccount.ID(),
 * 					IsPrimary: pulumi.Bool(true),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = media.NewStreamingEndpoint(ctx, "example", &media.StreamingEndpointArgs{
 * 			Name:                     pulumi.String("endpoint1"),
 * 			ResourceGroupName:        example.Name,
 * 			Location:                 example.Location,
 * 			MediaServicesAccountName: exampleServiceAccount.Name,
 * 			ScaleUnits:               pulumi.Int(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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.media.ServiceAccount;
 * import com.pulumi.azure.media.ServiceAccountArgs;
 * import com.pulumi.azure.media.inputs.ServiceAccountStorageAccountArgs;
 * import com.pulumi.azure.media.StreamingEndpoint;
 * import com.pulumi.azure.media.StreamingEndpointArgs;
 * 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("media-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplestoracc")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *         var exampleServiceAccount = new ServiceAccount("exampleServiceAccount", ServiceAccountArgs.builder()
 *             .name("examplemediaacc")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .storageAccounts(ServiceAccountStorageAccountArgs.builder()
 *                 .id(exampleAccount.id())
 *                 .isPrimary(true)
 *                 .build())
 *             .build());
 *         var exampleStreamingEndpoint = new StreamingEndpoint("exampleStreamingEndpoint", StreamingEndpointArgs.builder()
 *             .name("endpoint1")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .mediaServicesAccountName(exampleServiceAccount.name())
 *             .scaleUnits(2)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: media-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplestoracc
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 *   exampleServiceAccount:
 *     type: azure:media:ServiceAccount
 *     name: example
 *     properties:
 *       name: examplemediaacc
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       storageAccounts:
 *         - id: ${exampleAccount.id}
 *           isPrimary: true
 *   exampleStreamingEndpoint:
 *     type: azure:media:StreamingEndpoint
 *     name: example
 *     properties:
 *       name: endpoint1
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       mediaServicesAccountName: ${exampleServiceAccount.name}
 *       scaleUnits: 2
 * ```
 * 
 * ### With Access Control
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "media-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestoracc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleServiceAccount = new azure.media.ServiceAccount("example", {
 *     name: "examplemediaacc",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     storageAccounts: [{
 *         id: exampleAccount.id,
 *         isPrimary: true,
 *     }],
 * });
 * const exampleStreamingEndpoint = new azure.media.StreamingEndpoint("example", {
 *     name: "endpoint1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     mediaServicesAccountName: exampleServiceAccount.name,
 *     scaleUnits: 2,
 *     accessControl: {
 *         ipAllows: [
 *             {
 *                 name: "AllowedIP",
 *                 address: "192.168.1.1",
 *             },
 *             {
 *                 name: "AnotherIp",
 *                 address: "192.168.1.2",
 *             },
 *         ],
 *         akamaiSignatureHeaderAuthenticationKeys: [
 *             {
 *                 identifier: "id1",
 *                 expiration: "2030-12-31T16:00:00Z",
 *                 base64Key: "dGVzdGlkMQ==",
 *             },
 *             {
 *                 identifier: "id2",
 *                 expiration: "2032-01-28T16:00:00Z",
 *                 base64Key: "dGVzdGlkMQ==",
 *             },
 *         ],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="media-resources",
 *     location="West Europe")
 * example_account = azure.storage.Account("example",
 *     name="examplestoracc",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="GRS")
 * example_service_account = azure.media.ServiceAccount("example",
 *     name="examplemediaacc",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     storage_accounts=[azure.media.ServiceAccountStorageAccountArgs(
 *         id=example_account.id,
 *         is_primary=True,
 *     )])
 * example_streaming_endpoint = azure.media.StreamingEndpoint("example",
 *     name="endpoint1",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     media_services_account_name=example_service_account.name,
 *     scale_units=2,
 *     access_control=azure.media.StreamingEndpointAccessControlArgs(
 *         ip_allows=[
 *             azure.media.StreamingEndpointAccessControlIpAllowArgs(
 *                 name="AllowedIP",
 *                 address="192.168.1.1",
 *             ),
 *             azure.media.StreamingEndpointAccessControlIpAllowArgs(
 *                 name="AnotherIp",
 *                 address="192.168.1.2",
 *             ),
 *         ],
 *         akamai_signature_header_authentication_keys=[
 *             azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs(
 *                 identifier="id1",
 *                 expiration="2030-12-31T16:00:00Z",
 *                 base64_key="dGVzdGlkMQ==",
 *             ),
 *             azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs(
 *                 identifier="id2",
 *                 expiration="2032-01-28T16:00:00Z",
 *                 base64_key="dGVzdGlkMQ==",
 *             ),
 *         ],
 *     ))
 * ```
 * ```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 = "media-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplestoracc",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "GRS",
 *     });
 *     var exampleServiceAccount = new Azure.Media.ServiceAccount("example", new()
 *     {
 *         Name = "examplemediaacc",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         StorageAccounts = new[]
 *         {
 *             new Azure.Media.Inputs.ServiceAccountStorageAccountArgs
 *             {
 *                 Id = exampleAccount.Id,
 *                 IsPrimary = true,
 *             },
 *         },
 *     });
 *     var exampleStreamingEndpoint = new Azure.Media.StreamingEndpoint("example", new()
 *     {
 *         Name = "endpoint1",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         MediaServicesAccountName = exampleServiceAccount.Name,
 *         ScaleUnits = 2,
 *         AccessControl = new Azure.Media.Inputs.StreamingEndpointAccessControlArgs
 *         {
 *             IpAllows = new[]
 *             {
 *                 new Azure.Media.Inputs.StreamingEndpointAccessControlIpAllowArgs
 *                 {
 *                     Name = "AllowedIP",
 *                     Address = "192.168.1.1",
 *                 },
 *                 new Azure.Media.Inputs.StreamingEndpointAccessControlIpAllowArgs
 *                 {
 *                     Name = "AnotherIp",
 *                     Address = "192.168.1.2",
 *                 },
 *             },
 *             AkamaiSignatureHeaderAuthenticationKeys = new[]
 *             {
 *                 new Azure.Media.Inputs.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs
 *                 {
 *                     Identifier = "id1",
 *                     Expiration = "2030-12-31T16:00:00Z",
 *                     Base64Key = "dGVzdGlkMQ==",
 *                 },
 *                 new Azure.Media.Inputs.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs
 *                 {
 *                     Identifier = "id2",
 *                     Expiration = "2032-01-28T16:00:00Z",
 *                     Base64Key = "dGVzdGlkMQ==",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"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("media-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplestoracc"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("GRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleServiceAccount, err := media.NewServiceAccount(ctx, "example", &media.ServiceAccountArgs{
 * 			Name:              pulumi.String("examplemediaacc"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			StorageAccounts: media.ServiceAccountStorageAccountArray{
 * 				&media.ServiceAccountStorageAccountArgs{
 * 					Id:        exampleAccount.ID(),
 * 					IsPrimary: pulumi.Bool(true),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = media.NewStreamingEndpoint(ctx, "example", &media.StreamingEndpointArgs{
 * 			Name:                     pulumi.String("endpoint1"),
 * 			ResourceGroupName:        example.Name,
 * 			Location:                 example.Location,
 * 			MediaServicesAccountName: exampleServiceAccount.Name,
 * 			ScaleUnits:               pulumi.Int(2),
 * 			AccessControl: &media.StreamingEndpointAccessControlArgs{
 * 				IpAllows: media.StreamingEndpointAccessControlIpAllowArray{
 * 					&media.StreamingEndpointAccessControlIpAllowArgs{
 * 						Name:    pulumi.String("AllowedIP"),
 * 						Address: pulumi.String("192.168.1.1"),
 * 					},
 * 					&media.StreamingEndpointAccessControlIpAllowArgs{
 * 						Name:    pulumi.String("AnotherIp"),
 * 						Address: pulumi.String("192.168.1.2"),
 * 					},
 * 				},
 * 				AkamaiSignatureHeaderAuthenticationKeys: media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArray{
 * 					&media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs{
 * 						Identifier: pulumi.String("id1"),
 * 						Expiration: pulumi.String("2030-12-31T16:00:00Z"),
 * 						Base64Key:  pulumi.String("dGVzdGlkMQ=="),
 * 					},
 * 					&media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs{
 * 						Identifier: pulumi.String("id2"),
 * 						Expiration: pulumi.String("2032-01-28T16:00:00Z"),
 * 						Base64Key:  pulumi.String("dGVzdGlkMQ=="),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.media.ServiceAccount;
 * import com.pulumi.azure.media.ServiceAccountArgs;
 * import com.pulumi.azure.media.inputs.ServiceAccountStorageAccountArgs;
 * import com.pulumi.azure.media.StreamingEndpoint;
 * import com.pulumi.azure.media.StreamingEndpointArgs;
 * import com.pulumi.azure.media.inputs.StreamingEndpointAccessControlArgs;
 * 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("media-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplestoracc")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *         var exampleServiceAccount = new ServiceAccount("exampleServiceAccount", ServiceAccountArgs.builder()
 *             .name("examplemediaacc")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .storageAccounts(ServiceAccountStorageAccountArgs.builder()
 *                 .id(exampleAccount.id())
 *                 .isPrimary(true)
 *                 .build())
 *             .build());
 *         var exampleStreamingEndpoint = new StreamingEndpoint("exampleStreamingEndpoint", StreamingEndpointArgs.builder()
 *             .name("endpoint1")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .mediaServicesAccountName(exampleServiceAccount.name())
 *             .scaleUnits(2)
 *             .accessControl(StreamingEndpointAccessControlArgs.builder()
 *                 .ipAllows(
 *                     StreamingEndpointAccessControlIpAllowArgs.builder()
 *                         .name("AllowedIP")
 *                         .address("192.168.1.1")
 *                         .build(),
 *                     StreamingEndpointAccessControlIpAllowArgs.builder()
 *                         .name("AnotherIp")
 *                         .address("192.168.1.2")
 *                         .build())
 *                 .akamaiSignatureHeaderAuthenticationKeys(
 *                     StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs.builder()
 *                         .identifier("id1")
 *                         .expiration("2030-12-31T16:00:00Z")
 *                         .base64Key("dGVzdGlkMQ==")
 *                         .build(),
 *                     StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs.builder()
 *                         .identifier("id2")
 *                         .expiration("2032-01-28T16:00:00Z")
 *                         .base64Key("dGVzdGlkMQ==")
 *                         .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: media-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplestoracc
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 *   exampleServiceAccount:
 *     type: azure:media:ServiceAccount
 *     name: example
 *     properties:
 *       name: examplemediaacc
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       storageAccounts:
 *         - id: ${exampleAccount.id}
 *           isPrimary: true
 *   exampleStreamingEndpoint:
 *     type: azure:media:StreamingEndpoint
 *     name: example
 *     properties:
 *       name: endpoint1
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       mediaServicesAccountName: ${exampleServiceAccount.name}
 *       scaleUnits: 2
 *       accessControl:
 *         ipAllows:
 *           - name: AllowedIP
 *             address: 192.168.1.1
 *           - name: AnotherIp
 *             address: 192.168.1.2
 *         akamaiSignatureHeaderAuthenticationKeys:
 *           - identifier: id1
 *             expiration: 2030-12-31T16:00:00Z
 *             base64Key: dGVzdGlkMQ==
 *           - identifier: id2
 *             expiration: 2032-01-28T16:00:00Z
 *             base64Key: dGVzdGlkMQ==
 * ```
 * 
 * ## Import
 * Streaming Endpoints can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:media/streamingEndpoint:StreamingEndpoint example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/service1/streamingEndpoints/endpoint1
 * ```
 */
public class StreamingEndpoint internal constructor(
    override val javaResource: com.pulumi.azure.media.StreamingEndpoint,
) : KotlinCustomResource(javaResource, StreamingEndpointMapper) {
    /**
     * A `access_control` block as defined below.
     */
    public val accessControl: Output?
        get() = javaResource.accessControl().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> streamingEndpointAccessControlToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The flag indicates if the resource should be automatically started on creation.
     */
    public val autoStartEnabled: Output
        get() = javaResource.autoStartEnabled().applyValue({ args0 -> args0 })

    /**
     * The CDN enabled flag.
     */
    public val cdnEnabled: Output?
        get() = javaResource.cdnEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The CDN profile name.
     */
    public val cdnProfile: Output
        get() = javaResource.cdnProfile().applyValue({ args0 -> args0 })

    /**
     * The CDN provider name. Supported value are `StandardVerizon`,`PremiumVerizon` and `StandardAkamai`
     */
    public val cdnProvider: Output
        get() = javaResource.cdnProvider().applyValue({ args0 -> args0 })

    /**
     * A `cross_site_access_policy` block as defined below.
     */
    public val crossSiteAccessPolicy: Output?
        get() = javaResource.crossSiteAccessPolicy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> streamingEndpointCrossSiteAccessPolicyToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The custom host names of the streaming endpoint.
     */
    public val customHostNames: Output>?
        get() = javaResource.customHostNames().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The streaming endpoint description.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The host name of the Streaming Endpoint.
     */
    public val hostName: Output
        get() = javaResource.hostName().applyValue({ args0 -> args0 })

    /**
     * The Azure Region where the Streaming Endpoint should exist. Changing this forces a new Streaming Endpoint to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Max cache age in seconds.
     */
    public val maxCacheAgeSeconds: Output?
        get() = javaResource.maxCacheAgeSeconds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Media Services account name. Changing this forces a new Streaming Endpoint to be created.
     */
    public val mediaServicesAccountName: Output
        get() = javaResource.mediaServicesAccountName().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Streaming Endpoint maximum length is `24`. Changing this forces a new Streaming Endpoint to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the Resource Group where the Streaming Endpoint should exist. Changing this forces a new Streaming Endpoint to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * The number of scale units. To create a Standard Streaming Endpoint set `0`. For Premium Streaming Endpoint valid values are between `1` and `10`.
     */
    public val scaleUnits: Output
        get() = javaResource.scaleUnits().applyValue({ args0 -> args0 })

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

    /**
     * A mapping of tags which should be assigned to the Streaming Endpoint.
     */
    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 StreamingEndpointMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.media.StreamingEndpoint::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy