getSecret

Use this data source to access information about an existing Key Vault Secret.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.keyvault.KeyvaultFunctions;
import com.pulumi.azure.keyvault.inputs.GetSecretArgs;
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 example = KeyvaultFunctions.getSecret(GetSecretArgs.builder()
.name("secret-sauce")
.keyVaultId(data.azurerm_key_vault().existing().id())
.build());
ctx.export("secretValue", example.applyValue(getSecretResult -> getSecretResult.value()));
}
}

Return

A collection of values returned by getSecret.

Parameters

argument

A collection of arguments for invoking getSecret.


suspend fun getSecret(keyVaultId: String, name: String, version: String? = null): GetSecretResult

Return

A collection of values returned by getSecret.

See also

Parameters

keyVaultId

Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault Data Source / Resource.

name

Specifies the name of the Key Vault Secret.

version

Specifies the version of the Key Vault Secret. Defaults to the current version of the Key Vault Secret. NOTE: The vault must be in the same subscription as the provider. If the vault is in another subscription, you must create an aliased provider for that subscription.


suspend fun getSecret(argument: suspend GetSecretPlainArgsBuilder.() -> Unit): GetSecretResult

Return

A collection of values returned by getSecret.

See also

Parameters

argument

Builder for com.pulumi.azure.keyvault.kotlin.inputs.GetSecretPlainArgs.