get Secret Version
Get the value and metadata from a Secret Manager secret version. For more information see the official documentation datasource.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.SecretmanagerFunctions;
import com.pulumi.gcp.secretmanager.inputs.GetSecretVersionArgs;
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 basic = SecretmanagerFunctions.getSecretVersion(GetSecretVersionArgs.builder()
.secret("my-secret")
.build());
}
}
Content copied to clipboard
Return
A collection of values returned by getSecretVersion.
Parameters
argument
A collection of arguments for invoking getSecretVersion.
suspend fun getSecretVersion(project: String? = null, secret: String, version: String? = null): GetSecretVersionResult
Return
A collection of values returned by getSecretVersion.
Parameters
project
The project to get the secret version for. If it is not provided, the provider project is used.
secret
The secret to get the secret version for.
version
The version of the secret to get. If it is not provided, the latest version is retrieved.
See also
suspend fun getSecretVersion(argument: suspend GetSecretVersionPlainArgsBuilder.() -> Unit): GetSecretVersionResult
Return
A collection of values returned by getSecretVersion.
Parameters
argument
Builder for com.pulumi.gcp.secretmanager.kotlin.inputs.GetSecretVersionPlainArgs.