Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azurenative.media.kotlin.ContentKeyPolicyArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.media.kotlin
import com.pulumi.azurenative.media.ContentKeyPolicyArgs.builder
import com.pulumi.azurenative.media.kotlin.inputs.ContentKeyPolicyOptionArgs
import com.pulumi.azurenative.media.kotlin.inputs.ContentKeyPolicyOptionArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* A Content Key Policy resource.
* Azure REST API version: 2023-01-01. Prior API version in Azure Native 1.x: 2020-05-01.
* ## Example Usage
* ### Creates a Content Key Policy with ClearKey option and Token Restriction
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var contentKeyPolicy = new AzureNative.Media.ContentKeyPolicy("contentKeyPolicy", new()
* {
* AccountName = "contosomedia",
* ContentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction",
* Description = "ArmPolicyDescription",
* Options = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicyOptionArgs
* {
* Configuration = new AzureNative.Media.Inputs.ContentKeyPolicyClearKeyConfigurationArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
* },
* Name = "ClearKeyOption",
* Restriction = new AzureNative.Media.Inputs.ContentKeyPolicyTokenRestrictionArgs
* {
* Audience = "urn:audience",
* Issuer = "urn:issuer",
* OdataType = "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey = new AzureNative.Media.Inputs.ContentKeyPolicySymmetricTokenKeyArgs
* {
* KeyValue = "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* RestrictionTokenType = AzureNative.Media.ContentKeyPolicyRestrictionTokenType.Swt,
* },
* },
* },
* ResourceGroupName = "contosorg",
* });
* });
* ```
* ```go
* package main
* import (
* media "github.com/pulumi/pulumi-azure-native-sdk/media/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := media.NewContentKeyPolicy(ctx, "contentKeyPolicy", &media.ContentKeyPolicyArgs{
* AccountName: pulumi.String("contosomedia"),
* ContentKeyPolicyName: pulumi.String("PolicyWithClearKeyOptionAndSwtTokenRestriction"),
* Description: pulumi.String("ArmPolicyDescription"),
* Options: media.ContentKeyPolicyOptionArray{
* &media.ContentKeyPolicyOptionArgs{
* Configuration: media.ContentKeyPolicyClearKeyConfiguration{
* OdataType: "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
* },
* Name: pulumi.String("ClearKeyOption"),
* Restriction: media.ContentKeyPolicyTokenRestriction{
* Audience: "urn:audience",
* Issuer: "urn:issuer",
* OdataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey: media.ContentKeyPolicySymmetricTokenKey{
* KeyValue: "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* RestrictionTokenType: media.ContentKeyPolicyRestrictionTokenTypeSwt,
* },
* },
* },
* ResourceGroupName: pulumi.String("contosorg"),
* })
* 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.media.ContentKeyPolicy;
* import com.pulumi.azurenative.media.ContentKeyPolicyArgs;
* import com.pulumi.azurenative.media.inputs.ContentKeyPolicyOptionArgs;
* 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 contentKeyPolicy = new ContentKeyPolicy("contentKeyPolicy", ContentKeyPolicyArgs.builder()
* .accountName("contosomedia")
* .contentKeyPolicyName("PolicyWithClearKeyOptionAndSwtTokenRestriction")
* .description("ArmPolicyDescription")
* .options(ContentKeyPolicyOptionArgs.builder()
* .configuration(ContentKeyPolicyClearKeyConfigurationArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")
* .build())
* .name("ClearKeyOption")
* .restriction(ContentKeyPolicyOpenRestrictionArgs.builder()
* .audience("urn:audience")
* .issuer("urn:issuer")
* .odataType("#Microsoft.Media.ContentKeyPolicyTokenRestriction")
* .primaryVerificationKey(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .restrictionTokenType("Swt")
* .build())
* .build())
* .resourceGroupName("contosorg")
* .build());
* }
* }
* ```
* ### Creates a Content Key Policy with PlayReady option and Open Restriction
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var contentKeyPolicy = new AzureNative.Media.ContentKeyPolicy("contentKeyPolicy", new()
* {
* AccountName = "contosomedia",
* ContentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction",
* Description = "ArmPolicyDescription",
* Options = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicyOptionArgs
* {
* Configuration = new AzureNative.Media.Inputs.ContentKeyPolicyPlayReadyConfigurationArgs
* {
* Licenses = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicyPlayReadyLicenseArgs
* {
* AllowTestDevices = true,
* BeginDate = "2017-10-16T18:22:53.46Z",
* ContentKeyLocation = new AzureNative.Media.Inputs.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeaderArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader",
* },
* ContentType = AzureNative.Media.ContentKeyPolicyPlayReadyContentType.UltraVioletDownload,
* LicenseType = AzureNative.Media.ContentKeyPolicyPlayReadyLicenseType.Persistent,
* PlayRight = new AzureNative.Media.Inputs.ContentKeyPolicyPlayReadyPlayRightArgs
* {
* AllowPassingVideoContentToUnknownOutput = AzureNative.Media.ContentKeyPolicyPlayReadyUnknownOutputPassingOption.NotAllowed,
* DigitalVideoOnlyContentRestriction = false,
* ImageConstraintForAnalogComponentVideoRestriction = true,
* ImageConstraintForAnalogComputerMonitorRestriction = false,
* ScmsRestriction = 2,
* },
* SecurityLevel = AzureNative.Media.SecurityLevel.SL150,
* },
* },
* OdataType = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
* },
* Name = "ArmPolicyOptionName",
* Restriction = new AzureNative.Media.Inputs.ContentKeyPolicyOpenRestrictionArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
* },
* },
* },
* ResourceGroupName = "contosorg",
* });
* });
* ```
* ```go
* package main
* import (
* media "github.com/pulumi/pulumi-azure-native-sdk/media/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := media.NewContentKeyPolicy(ctx, "contentKeyPolicy", &media.ContentKeyPolicyArgs{
* AccountName: pulumi.String("contosomedia"),
* ContentKeyPolicyName: pulumi.String("PolicyWithPlayReadyOptionAndOpenRestriction"),
* Description: pulumi.String("ArmPolicyDescription"),
* Options: media.ContentKeyPolicyOptionArray{
* &media.ContentKeyPolicyOptionArgs{
* Configuration: media.ContentKeyPolicyPlayReadyConfiguration{
* Licenses: []media.ContentKeyPolicyPlayReadyLicense{
* {
* AllowTestDevices: true,
* BeginDate: "2017-10-16T18:22:53.46Z",
* ContentKeyLocation: {
* OdataType: "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader",
* },
* ContentType: media.ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload,
* LicenseType: media.ContentKeyPolicyPlayReadyLicenseTypePersistent,
* PlayRight: {
* AllowPassingVideoContentToUnknownOutput: media.ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed,
* DigitalVideoOnlyContentRestriction: false,
* ImageConstraintForAnalogComponentVideoRestriction: true,
* ImageConstraintForAnalogComputerMonitorRestriction: false,
* ScmsRestriction: 2,
* },
* SecurityLevel: media.SecurityLevelSL150,
* },
* },
* OdataType: "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration",
* },
* Name: pulumi.String("ArmPolicyOptionName"),
* Restriction: media.ContentKeyPolicyOpenRestriction{
* OdataType: "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
* },
* },
* },
* ResourceGroupName: pulumi.String("contosorg"),
* })
* 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.media.ContentKeyPolicy;
* import com.pulumi.azurenative.media.ContentKeyPolicyArgs;
* import com.pulumi.azurenative.media.inputs.ContentKeyPolicyOptionArgs;
* 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 contentKeyPolicy = new ContentKeyPolicy("contentKeyPolicy", ContentKeyPolicyArgs.builder()
* .accountName("contosomedia")
* .contentKeyPolicyName("PolicyWithPlayReadyOptionAndOpenRestriction")
* .description("ArmPolicyDescription")
* .options(ContentKeyPolicyOptionArgs.builder()
* .configuration(ContentKeyPolicyClearKeyConfigurationArgs.builder()
* .licenses(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .odataType("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration")
* .build())
* .name("ArmPolicyOptionName")
* .restriction(ContentKeyPolicyOpenRestrictionArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyOpenRestriction")
* .build())
* .build())
* .resourceGroupName("contosorg")
* .build());
* }
* }
* ```
* ### Creates a Content Key Policy with Widevine option and Token Restriction
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var contentKeyPolicy = new AzureNative.Media.ContentKeyPolicy("contentKeyPolicy", new()
* {
* AccountName = "contosomedia",
* ContentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction",
* Description = "ArmPolicyDescription",
* Options = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicyOptionArgs
* {
* Configuration = new AzureNative.Media.Inputs.ContentKeyPolicyWidevineConfigurationArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
* WidevineTemplate = "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}",
* },
* Name = "widevineoption",
* Restriction = new AzureNative.Media.Inputs.ContentKeyPolicyTokenRestrictionArgs
* {
* AlternateVerificationKeys = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicySymmetricTokenKeyArgs
* {
* KeyValue = "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* },
* Audience = "urn:audience",
* Issuer = "urn:issuer",
* OdataType = "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey = new AzureNative.Media.Inputs.ContentKeyPolicyRsaTokenKeyArgs
* {
* Exponent = "AQAB",
* Modulus = "AQAD",
* OdataType = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
* },
* RestrictionTokenType = AzureNative.Media.ContentKeyPolicyRestrictionTokenType.Jwt,
* },
* },
* },
* ResourceGroupName = "contosorg",
* });
* });
* ```
* ```go
* package main
* import (
* media "github.com/pulumi/pulumi-azure-native-sdk/media/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := media.NewContentKeyPolicy(ctx, "contentKeyPolicy", &media.ContentKeyPolicyArgs{
* AccountName: pulumi.String("contosomedia"),
* ContentKeyPolicyName: pulumi.String("PolicyWithWidevineOptionAndJwtTokenRestriction"),
* Description: pulumi.String("ArmPolicyDescription"),
* Options: media.ContentKeyPolicyOptionArray{
* &media.ContentKeyPolicyOptionArgs{
* Configuration: media.ContentKeyPolicyWidevineConfiguration{
* OdataType: "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
* WidevineTemplate: "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}",
* },
* Name: pulumi.String("widevineoption"),
* Restriction: media.ContentKeyPolicyTokenRestriction{
* AlternateVerificationKeys: []interface{}{
* media.ContentKeyPolicySymmetricTokenKey{
* KeyValue: "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* },
* Audience: "urn:audience",
* Issuer: "urn:issuer",
* OdataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey: media.ContentKeyPolicyRsaTokenKey{
* Exponent: "AQAB",
* Modulus: "AQAD",
* OdataType: "#Microsoft.Media.ContentKeyPolicyRsaTokenKey",
* },
* RestrictionTokenType: media.ContentKeyPolicyRestrictionTokenTypeJwt,
* },
* },
* },
* ResourceGroupName: pulumi.String("contosorg"),
* })
* 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.media.ContentKeyPolicy;
* import com.pulumi.azurenative.media.ContentKeyPolicyArgs;
* import com.pulumi.azurenative.media.inputs.ContentKeyPolicyOptionArgs;
* 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 contentKeyPolicy = new ContentKeyPolicy("contentKeyPolicy", ContentKeyPolicyArgs.builder()
* .accountName("contosomedia")
* .contentKeyPolicyName("PolicyWithWidevineOptionAndJwtTokenRestriction")
* .description("ArmPolicyDescription")
* .options(ContentKeyPolicyOptionArgs.builder()
* .configuration(ContentKeyPolicyClearKeyConfigurationArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")
* .widevineTemplate("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}")
* .build())
* .name("widevineoption")
* .restriction(ContentKeyPolicyOpenRestrictionArgs.builder()
* .alternateVerificationKeys(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .audience("urn:audience")
* .issuer("urn:issuer")
* .odataType("#Microsoft.Media.ContentKeyPolicyTokenRestriction")
* .primaryVerificationKey(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .restrictionTokenType("Jwt")
* .build())
* .build())
* .resourceGroupName("contosorg")
* .build());
* }
* }
* ```
* ### Creates a Content Key Policy with multiple options
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var contentKeyPolicy = new AzureNative.Media.ContentKeyPolicy("contentKeyPolicy", new()
* {
* AccountName = "contosomedia",
* ContentKeyPolicyName = "PolicyCreatedWithMultipleOptions",
* Description = "ArmPolicyDescription",
* Options = new[]
* {
* new AzureNative.Media.Inputs.ContentKeyPolicyOptionArgs
* {
* Configuration = new AzureNative.Media.Inputs.ContentKeyPolicyClearKeyConfigurationArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
* },
* Name = "ClearKeyOption",
* Restriction = new AzureNative.Media.Inputs.ContentKeyPolicyTokenRestrictionArgs
* {
* Audience = "urn:audience",
* Issuer = "urn:issuer",
* OdataType = "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey = new AzureNative.Media.Inputs.ContentKeyPolicySymmetricTokenKeyArgs
* {
* KeyValue = "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* RestrictionTokenType = AzureNative.Media.ContentKeyPolicyRestrictionTokenType.Swt,
* },
* },
* new AzureNative.Media.Inputs.ContentKeyPolicyOptionArgs
* {
* Configuration = new AzureNative.Media.Inputs.ContentKeyPolicyWidevineConfigurationArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
* WidevineTemplate = "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}",
* },
* Name = "widevineoption",
* Restriction = new AzureNative.Media.Inputs.ContentKeyPolicyOpenRestrictionArgs
* {
* OdataType = "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
* },
* },
* },
* ResourceGroupName = "contosorg",
* });
* });
* ```
* ```go
* package main
* import (
* media "github.com/pulumi/pulumi-azure-native-sdk/media/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := media.NewContentKeyPolicy(ctx, "contentKeyPolicy", &media.ContentKeyPolicyArgs{
* AccountName: pulumi.String("contosomedia"),
* ContentKeyPolicyName: pulumi.String("PolicyCreatedWithMultipleOptions"),
* Description: pulumi.String("ArmPolicyDescription"),
* Options: media.ContentKeyPolicyOptionArray{
* &media.ContentKeyPolicyOptionArgs{
* Configuration: media.ContentKeyPolicyClearKeyConfiguration{
* OdataType: "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration",
* },
* Name: pulumi.String("ClearKeyOption"),
* Restriction: media.ContentKeyPolicyTokenRestriction{
* Audience: "urn:audience",
* Issuer: "urn:issuer",
* OdataType: "#Microsoft.Media.ContentKeyPolicyTokenRestriction",
* PrimaryVerificationKey: media.ContentKeyPolicySymmetricTokenKey{
* KeyValue: "AAAAAAAAAAAAAAAAAAAAAA==",
* OdataType: "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey",
* },
* RestrictionTokenType: media.ContentKeyPolicyRestrictionTokenTypeSwt,
* },
* },
* &media.ContentKeyPolicyOptionArgs{
* Configuration: media.ContentKeyPolicyWidevineConfiguration{
* OdataType: "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration",
* WidevineTemplate: "{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}",
* },
* Name: pulumi.String("widevineoption"),
* Restriction: media.ContentKeyPolicyOpenRestriction{
* OdataType: "#Microsoft.Media.ContentKeyPolicyOpenRestriction",
* },
* },
* },
* ResourceGroupName: pulumi.String("contosorg"),
* })
* 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.media.ContentKeyPolicy;
* import com.pulumi.azurenative.media.ContentKeyPolicyArgs;
* import com.pulumi.azurenative.media.inputs.ContentKeyPolicyOptionArgs;
* 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 contentKeyPolicy = new ContentKeyPolicy("contentKeyPolicy", ContentKeyPolicyArgs.builder()
* .accountName("contosomedia")
* .contentKeyPolicyName("PolicyCreatedWithMultipleOptions")
* .description("ArmPolicyDescription")
* .options(
* ContentKeyPolicyOptionArgs.builder()
* .configuration(ContentKeyPolicyClearKeyConfigurationArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration")
* .build())
* .name("ClearKeyOption")
* .restriction(ContentKeyPolicyOpenRestrictionArgs.builder()
* .audience("urn:audience")
* .issuer("urn:issuer")
* .odataType("#Microsoft.Media.ContentKeyPolicyTokenRestriction")
* .primaryVerificationKey(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .restrictionTokenType("Swt")
* .build())
* .build(),
* ContentKeyPolicyOptionArgs.builder()
* .configuration(ContentKeyPolicyClearKeyConfigurationArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration")
* .widevineTemplate("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}")
* .build())
* .name("widevineoption")
* .restriction(ContentKeyPolicyOpenRestrictionArgs.builder()
* .odataType("#Microsoft.Media.ContentKeyPolicyOpenRestriction")
* .build())
* .build())
* .resourceGroupName("contosorg")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:media:ContentKeyPolicy PolicyCreatedWithMultipleOptions /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}
* ```
* @property accountName The Media Services account name.
* @property contentKeyPolicyName The Content Key Policy name.
* @property description A description for the Policy.
* @property options The Key Policy options.
* @property resourceGroupName The name of the resource group within the Azure subscription.
*/
public data class ContentKeyPolicyArgs(
public val accountName: Output? = null,
public val contentKeyPolicyName: Output? = null,
public val description: Output? = null,
public val options: Output>? = null,
public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.media.ContentKeyPolicyArgs =
com.pulumi.azurenative.media.ContentKeyPolicyArgs.builder()
.accountName(accountName?.applyValue({ args0 -> args0 }))
.contentKeyPolicyName(contentKeyPolicyName?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.options(
options?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ContentKeyPolicyArgs].
*/
@PulumiTagMarker
public class ContentKeyPolicyArgsBuilder internal constructor() {
private var accountName: Output? = null
private var contentKeyPolicyName: Output? = null
private var description: Output? = null
private var options: Output>? = null
private var resourceGroupName: Output? = null
/**
* @param value The Media Services account name.
*/
@JvmName("ahykrorkqqrdrxdc")
public suspend fun accountName(`value`: Output) {
this.accountName = value
}
/**
* @param value The Content Key Policy name.
*/
@JvmName("pscilvswuplmiyuj")
public suspend fun contentKeyPolicyName(`value`: Output) {
this.contentKeyPolicyName = value
}
/**
* @param value A description for the Policy.
*/
@JvmName("soktweapqraaymwg")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The Key Policy options.
*/
@JvmName("edqaodpyksexgswt")
public suspend fun options(`value`: Output>) {
this.options = value
}
@JvmName("kfsimeyldbxmkiux")
public suspend fun options(vararg values: Output) {
this.options = Output.all(values.asList())
}
/**
* @param values The Key Policy options.
*/
@JvmName("isbsuxhbuttcdeib")
public suspend fun options(values: List>) {
this.options = Output.all(values)
}
/**
* @param value The name of the resource group within the Azure subscription.
*/
@JvmName("gphclpfpfhxragmx")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The Media Services account name.
*/
@JvmName("eqikuyvgdvjscepy")
public suspend fun accountName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accountName = mapped
}
/**
* @param value The Content Key Policy name.
*/
@JvmName("gilbjnodytjyioea")
public suspend fun contentKeyPolicyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.contentKeyPolicyName = mapped
}
/**
* @param value A description for the Policy.
*/
@JvmName("vdeyqxgipjkluxnq")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value The Key Policy options.
*/
@JvmName("fweqyudfnhorlkwb")
public suspend fun options(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.options = mapped
}
/**
* @param argument The Key Policy options.
*/
@JvmName("lbbsqjdbgultycrk")
public suspend fun options(argument: List Unit>) {
val toBeMapped = argument.toList().map {
ContentKeyPolicyOptionArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.options = mapped
}
/**
* @param argument The Key Policy options.
*/
@JvmName("qkfltkdfccukxgbv")
public suspend fun options(vararg argument: suspend ContentKeyPolicyOptionArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
ContentKeyPolicyOptionArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.options = mapped
}
/**
* @param argument The Key Policy options.
*/
@JvmName("wtjaeetatydmbwwl")
public suspend fun options(argument: suspend ContentKeyPolicyOptionArgsBuilder.() -> Unit) {
val toBeMapped = listOf(ContentKeyPolicyOptionArgsBuilder().applySuspend { argument() }.build())
val mapped = of(toBeMapped)
this.options = mapped
}
/**
* @param values The Key Policy options.
*/
@JvmName("rcefbtggefvvjcob")
public suspend fun options(vararg values: ContentKeyPolicyOptionArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.options = mapped
}
/**
* @param value The name of the resource group within the Azure subscription.
*/
@JvmName("vtsetokoihifupvl")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
internal fun build(): ContentKeyPolicyArgs = ContentKeyPolicyArgs(
accountName = accountName,
contentKeyPolicyName = contentKeyPolicyName,
description = description,
options = options,
resourceGroupName = resourceGroupName,
)
}