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.batch.kotlin.Account.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.batch.kotlin
import com.pulumi.azure.batch.kotlin.outputs.AccountEncryption
import com.pulumi.azure.batch.kotlin.outputs.AccountIdentity
import com.pulumi.azure.batch.kotlin.outputs.AccountKeyVaultReference
import com.pulumi.azure.batch.kotlin.outputs.AccountNetworkProfile
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
import com.pulumi.azure.batch.kotlin.outputs.AccountEncryption.Companion.toKotlin as accountEncryptionToKotlin
import com.pulumi.azure.batch.kotlin.outputs.AccountIdentity.Companion.toKotlin as accountIdentityToKotlin
import com.pulumi.azure.batch.kotlin.outputs.AccountKeyVaultReference.Companion.toKotlin as accountKeyVaultReferenceToKotlin
import com.pulumi.azure.batch.kotlin.outputs.AccountNetworkProfile.Companion.toKotlin as accountNetworkProfileToKotlin
/**
* Builder for [Account].
*/
@PulumiTagMarker
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.batch.Account(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Account(builtJavaResource)
}
}
/**
* Manages an Azure Batch account.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "testbatch",
* location: "West Europe",
* });
* const exampleAccount = new azure.storage.Account("example", {
* name: "teststorage",
* resourceGroupName: example.name,
* location: example.location,
* accountTier: "Standard",
* accountReplicationType: "LRS",
* });
* const exampleAccount2 = new azure.batch.Account("example", {
* name: "testbatchaccount",
* resourceGroupName: example.name,
* location: example.location,
* poolAllocationMode: "BatchService",
* storageAccountId: exampleAccount.id,
* storageAccountAuthenticationMode: "StorageKeys",
* tags: {
* env: "test",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="testbatch",
* location="West Europe")
* example_account = azure.storage.Account("example",
* name="teststorage",
* resource_group_name=example.name,
* location=example.location,
* account_tier="Standard",
* account_replication_type="LRS")
* example_account2 = azure.batch.Account("example",
* name="testbatchaccount",
* resource_group_name=example.name,
* location=example.location,
* pool_allocation_mode="BatchService",
* storage_account_id=example_account.id,
* storage_account_authentication_mode="StorageKeys",
* tags={
* "env": "test",
* })
* ```
* ```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 = "testbatch",
* Location = "West Europe",
* });
* var exampleAccount = new Azure.Storage.Account("example", new()
* {
* Name = "teststorage",
* ResourceGroupName = example.Name,
* Location = example.Location,
* AccountTier = "Standard",
* AccountReplicationType = "LRS",
* });
* var exampleAccount2 = new Azure.Batch.Account("example", new()
* {
* Name = "testbatchaccount",
* ResourceGroupName = example.Name,
* Location = example.Location,
* PoolAllocationMode = "BatchService",
* StorageAccountId = exampleAccount.Id,
* StorageAccountAuthenticationMode = "StorageKeys",
* Tags =
* {
* { "env", "test" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "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("testbatch"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
* Name: pulumi.String("teststorage"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* AccountTier: pulumi.String("Standard"),
* AccountReplicationType: pulumi.String("LRS"),
* })
* if err != nil {
* return err
* }
* _, err = batch.NewAccount(ctx, "example", &batch.AccountArgs{
* Name: pulumi.String("testbatchaccount"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* PoolAllocationMode: pulumi.String("BatchService"),
* StorageAccountId: exampleAccount.ID(),
* StorageAccountAuthenticationMode: pulumi.String("StorageKeys"),
* Tags: pulumi.StringMap{
* "env": pulumi.String("test"),
* },
* })
* 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.batch.Account;
* import com.pulumi.azure.batch.AccountArgs;
* 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("testbatch")
* .location("West Europe")
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("teststorage")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .build());
* var exampleAccount2 = new Account("exampleAccount2", AccountArgs.builder()
* .name("testbatchaccount")
* .resourceGroupName(example.name())
* .location(example.location())
* .poolAllocationMode("BatchService")
* .storageAccountId(exampleAccount.id())
* .storageAccountAuthenticationMode("StorageKeys")
* .tags(Map.of("env", "test"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: testbatch
* location: West Europe
* exampleAccount:
* type: azure:storage:Account
* name: example
* properties:
* name: teststorage
* resourceGroupName: ${example.name}
* location: ${example.location}
* accountTier: Standard
* accountReplicationType: LRS
* exampleAccount2:
* type: azure:batch:Account
* name: example
* properties:
* name: testbatchaccount
* resourceGroupName: ${example.name}
* location: ${example.location}
* poolAllocationMode: BatchService
* storageAccountId: ${exampleAccount.id}
* storageAccountAuthenticationMode: StorageKeys
* tags:
* env: test
* ```
*
* ## Import
* Batch Account can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:batch/account:Account example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Batch/batchAccounts/account1
* ```
*/
public class Account internal constructor(
override val javaResource: com.pulumi.azure.batch.Account,
) : KotlinCustomResource(javaResource, AccountMapper) {
/**
* The account endpoint used to interact with the Batch service.
*/
public val accountEndpoint: Output
get() = javaResource.accountEndpoint().applyValue({ args0 -> args0 })
/**
* Specifies the allowed authentication mode for the Batch account. Possible values include `AAD`, `SharedKey` or `TaskAuthenticationToken`.
*/
public val allowedAuthenticationModes: Output>
get() = javaResource.allowedAuthenticationModes().applyValue({ args0 ->
args0.map({ args0 ->
args0
})
})
/**
* Specifies if customer managed key encryption should be used to encrypt batch account data. One `encryption` block as defined below.
*/
public val encryption: Output?
get() = javaResource.encryption().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
accountEncryptionToKotlin(args0)
})
}).orElse(null)
})
/**
* 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_vault_reference` block, as defined below, that describes the Azure KeyVault reference to use when deploying the Azure Batch account using the `UserSubscription` pool allocation mode.
*/
public val keyVaultReference: Output?
get() = javaResource.keyVaultReference().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> accountKeyVaultReferenceToKotlin(args0) })
}).orElse(null)
})
/**
* 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 Batch 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 })
/**
* A `network_profile` block as defined below.
*/
public val networkProfile: Output?
get() = javaResource.networkProfile().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> accountNetworkProfileToKotlin(args0) })
}).orElse(null)
})
/**
* Specifies the mode to use for pool allocation. Possible values are `BatchService` or `UserSubscription`. Defaults to `BatchService`.
*/
public val poolAllocationMode: Output?
get() = javaResource.poolAllocationMode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Batch account primary access key.
*/
public val primaryAccessKey: Output
get() = javaResource.primaryAccessKey().applyValue({ args0 -> args0 })
/**
* Whether public network access is allowed for this server. Defaults to `true`.
* > **NOTE:** When using `UserSubscription` mode, an Azure KeyVault reference has to be specified. See `key_vault_reference` below.
* > **NOTE:** When using `UserSubscription` mode, the `Microsoft Azure Batch` service principal has to have `Contributor` role on your subscription scope, as documented [here](https://docs.microsoft.com/azure/batch/batch-account-create-portal#additional-configuration-for-user-subscription-mode).
*/
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 Batch account. Changing this forces a new resource to be created.
* > **NOTE:** To work around [a bug in the Azure API](https://github.com/Azure/azure-rest-api-specs/issues/5574) this property is currently treated as case-insensitive. A future version of this provider will require that the casing is correct.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The Batch account secondary access key.
*/
public val secondaryAccessKey: Output
get() = javaResource.secondaryAccessKey().applyValue({ args0 -> args0 })
/**
* Specifies the storage account authentication mode. Possible values include `StorageKeys`, `BatchAccountManagedIdentity`.
* > **NOTE:** When using `BatchAccountManagedIdentity` mod, the `identity.type` must set to `UserAssigned` or `SystemAssigned`.
*/
public val storageAccountAuthenticationMode: Output?
get() = javaResource.storageAccountAuthenticationMode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the storage account to use for the Batch account. If not specified, Azure Batch will manage the storage.
* > **NOTE:** When using `storage_account_id`, the `storage_account_authentication_mode` must be specified as well.
*/
public val storageAccountId: Output?
get() = javaResource.storageAccountId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the user assigned identity for the storage account.
*/
public val storageAccountNodeIdentity: Output?
get() = javaResource.storageAccountNodeIdentity().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A mapping of tags to assign 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.batch.Account::class == javaResource::class
override fun map(javaResource: Resource): Account = Account(
javaResource as
com.pulumi.azure.batch.Account,
)
}
/**
* @see [Account].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Account].
*/
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.
*/
public fun account(name: String): Account {
val builder = AccountResourceBuilder()
builder.name(name)
return builder.build()
}