get Secret
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
A collection of arguments for invoking getSecret.
Return
A collection of values returned by getSecret.
See also
Parameters
Specifies the ID of the Key Vault instance to fetch secret names from, available on the azure.keyvault.KeyVault
Data Source / Resource.
Specifies the name of the Key Vault Secret.
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.
Return
A collection of values returned by getSecret.
See also
Parameters
Builder for com.pulumi.azure.keyvault.kotlin.inputs.GetSecretPlainArgs.