ManagedStorageAccountSasTokenDefinitionArgs

data class ManagedStorageAccountSasTokenDefinitionArgs(val managedStorageAccountId: Output<String>? = null, val name: Output<String>? = null, val sasTemplateUri: Output<String>? = null, val sasType: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val validityPeriod: Output<String>? = null) : ConvertibleToJava<ManagedStorageAccountSasTokenDefinitionArgs>

Manages a Key Vault Managed Storage Account SAS Definition.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
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.storage.StorageFunctions;
import com.pulumi.azure.storage.inputs.GetAccountSASArgs;
import com.pulumi.azure.storage.inputs.GetAccountSASResourceTypesArgs;
import com.pulumi.azure.storage.inputs.GetAccountSASServicesArgs;
import com.pulumi.azure.storage.inputs.GetAccountSASPermissionsArgs;
import com.pulumi.azure.keyvault.KeyVault;
import com.pulumi.azure.keyvault.KeyVaultArgs;
import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
import com.pulumi.azure.keyvault.ManagedStorageAccount;
import com.pulumi.azure.keyvault.ManagedStorageAccountArgs;
import com.pulumi.azure.keyvault.ManagedStorageAccountSasTokenDefinition;
import com.pulumi.azure.keyvault.ManagedStorageAccountSasTokenDefinitionArgs;
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) {
final var exampleClientConfig = CoreFunctions.getClientConfig();
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
final var exampleAccountSAS = StorageFunctions.getAccountSAS(GetAccountSASArgs.builder()
.connectionString(exampleAccount.primaryConnectionString())
.httpsOnly(true)
.resourceTypes(GetAccountSASResourceTypesArgs.builder()
.service(true)
.container(false)
.object(false)
.build())
.services(GetAccountSASServicesArgs.builder()
.blob(true)
.queue(false)
.table(false)
.file(false)
.build())
.start("2021-04-30T00:00:00Z")
.expiry("2023-04-30T00:00:00Z")
.permissions(GetAccountSASPermissionsArgs.builder()
.read(true)
.write(true)
.delete(false)
.list(false)
.add(true)
.create(true)
.update(false)
.process(false)
.tag(false)
.filter(false)
.build())
.build());
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.tenantId(exampleClientConfig.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.skuName("standard")
.accessPolicies(KeyVaultAccessPolicyArgs.builder()
.tenantId(exampleClientConfig.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.objectId(exampleClientConfig.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
.secretPermissions(
"Get",
"Delete")
.storagePermissions(
"Get",
"List",
"Set",
"SetSAS",
"GetSAS",
"DeleteSAS",
"Update",
"RegenerateKey")
.build())
.build());
var exampleManagedStorageAccount = new ManagedStorageAccount("exampleManagedStorageAccount", ManagedStorageAccountArgs.builder()
.keyVaultId(exampleKeyVault.id())
.storageAccountId(exampleAccount.id())
.storageAccountKey("key1")
.regenerateKeyAutomatically(false)
.regenerationPeriod("P1D")
.build());
var exampleManagedStorageAccountSasTokenDefinition = new ManagedStorageAccountSasTokenDefinition("exampleManagedStorageAccountSasTokenDefinition", ManagedStorageAccountSasTokenDefinitionArgs.builder()
.validityPeriod("P1D")
.managedStorageAccountId(exampleManagedStorageAccount.id())
.sasTemplateUri(exampleAccountSAS.applyValue(getAccountSASResult -> getAccountSASResult).applyValue(exampleAccountSAS -> exampleAccountSAS.applyValue(getAccountSASResult -> getAccountSASResult.sas())))
.sasType("account")
.build());
}
}

Import

Key Vaults can be imported using the resource id, e.g.

$ pulumi import azure:keyvault/managedStorageAccountSasTokenDefinition:ManagedStorageAccountSasTokenDefinition example https://example-keyvault.vault.azure.net/storage/exampleStorageAcc01/sas/exampleSasDefinition01

Constructors

fun ManagedStorageAccountSasTokenDefinitionArgs(managedStorageAccountId: Output<String>? = null, name: Output<String>? = null, sasTemplateUri: Output<String>? = null, sasType: Output<String>? = null, tags: Output<Map<String, String>>? = null, validityPeriod: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ManagedStorageAccountSasTokenDefinitionArgs

Properties

Link copied to clipboard
val managedStorageAccountId: Output<String>? = null

The ID of the Managed Storage Account.

Link copied to clipboard
val name: Output<String>? = null

The name which should be used for this SAS Definition.

Link copied to clipboard
val sasTemplateUri: Output<String>? = null

The SAS definition token template signed with an arbitrary key. Tokens created according to the SAS definition will have the same properties as the template, but regenerated with a new validity period.

Link copied to clipboard
val sasType: Output<String>? = null

The type of SAS token the SAS definition will create. Possible values are account and service.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags which should be assigned to the SAS Definition. Changing this forces a new resource to be created.

Link copied to clipboard
val validityPeriod: Output<String>? = null

Validity period of SAS token. Value needs to be in ISO 8601 duration format.