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.azure.mediaservices.kotlin.Account.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.mediaservices.kotlin
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountEncryption
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountIdentity
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountKeyDeliveryAccessControl
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountStorageAccount
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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountEncryption.Companion.toKotlin as accountEncryptionToKotlin
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountIdentity.Companion.toKotlin as accountIdentityToKotlin
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountKeyDeliveryAccessControl.Companion.toKotlin as accountKeyDeliveryAccessControlToKotlin
import com.pulumi.azure.mediaservices.kotlin.outputs.AccountStorageAccount.Companion.toKotlin as accountStorageAccountToKotlin
/**
* Builder for [Account].
*/
@PulumiTagMarker
@Deprecated(
message = """
azure.mediaservices.Account has been deprecated in favor of azure.media.ServiceAccount
""",
)
public class AccountResourceBuilder internal constructor() {
public var name: String? = null
public var args: AccountArgs = AccountArgs()
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 AccountArgsBuilder.() -> Unit) {
val builder = AccountArgsBuilder()
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(): Account {
val builtJavaResource = com.pulumi.azure.mediaservices.Account(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Account(builtJavaResource)
}
}
/**
* Manages a Media Services Account.
* ## 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,
* }],
* });
* ```
* ```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=[{
* "id": example_account.id,
* "is_primary": True,
* }])
* ```
* ```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,
* },
* },
* });
* });
* ```
* ```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
* }
* _, 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
* }
* 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 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());
* }
* }
* ```
* ```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
* ```
*
* ## Import
* Media Services Accounts can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:mediaservices/account:Account account /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Media/mediaServices/account1
* ```
*/
@Deprecated(
message = """
azure.mediaservices.Account has been deprecated in favor of azure.media.ServiceAccount
""",
)
public class Account internal constructor(
override val javaResource: com.pulumi.azure.mediaservices.Account,
) : KotlinCustomResource(javaResource, AccountMapper) {
/**
* An `encryption` block as defined below.
*/
public val encryption: Output
get() = javaResource.encryption().applyValue({ args0 ->
args0.let({ args0 ->
accountEncryptionToKotlin(args0)
})
})
/**
* An `identity` block as defined below.
*/
public val identity: Output?
get() = javaResource.identity().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
accountIdentityToKotlin(args0)
})
}).orElse(null)
})
/**
* A `key_delivery_access_control` block as defined below.
*/
public val keyDeliveryAccessControl: Output
get() = javaResource.keyDeliveryAccessControl().applyValue({ args0 ->
args0.let({ args0 ->
accountKeyDeliveryAccessControlToKotlin(args0)
})
})
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* Specifies the name of the Media Services Account. Only lowercase Alphanumeric characters allowed. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Whether public network access is allowed for this server. Defaults to `true`.
*/
public val publicNetworkAccessEnabled: Output?
get() = javaResource.publicNetworkAccessEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the resource group in which to create the Media Services Account. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* One or more `storage_account` blocks as defined below.
*/
public val storageAccounts: Output>
get() = javaResource.storageAccounts().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> accountStorageAccountToKotlin(args0) })
})
})
/**
* Specifies the storage authentication type. Possible value is `ManagedIdentity` or `System`.
*/
public val storageAuthenticationType: Output
get() = javaResource.storageAuthenticationType().applyValue({ args0 -> args0 })
/**
* A mapping of tags assigned to the resource.
*/
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 AccountMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.mediaservices.Account::class == javaResource::class
override fun map(javaResource: Resource): Account = Account(
javaResource as
com.pulumi.azure.mediaservices.Account,
)
}
/**
* @see [Account].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Account].
*/
@Deprecated(
message = """
azure.mediaservices.Account has been deprecated in favor of azure.media.ServiceAccount
""",
)
public suspend fun account(name: String, block: suspend AccountResourceBuilder.() -> Unit): Account {
val builder = AccountResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Account].
* @param name The _unique_ name of the resulting resource.
*/
@Deprecated(
message = """
azure.mediaservices.Account has been deprecated in favor of azure.media.ServiceAccount
""",
)
public fun account(name: String): Account {
val builder = AccountResourceBuilder()
builder.name(name)
return builder.build()
}