getSecretVersionAccess

Get the value from a Secret Manager secret version. This is similar to the gcp.secretmanager.SecretVersion datasource, but it only requires the Secret Manager Secret Accessor role. For more information see the official documentation and API.

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.GetSecretVersionAccessArgs;
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.getSecretVersionAccess(GetSecretVersionAccessArgs.builder()
.secret("my-secret")
.build());
}
}

Return

A collection of values returned by getSecretVersionAccess.

Parameters

argument

A collection of arguments for invoking getSecretVersionAccess.


suspend fun getSecretVersionAccess(project: String? = null, secret: String, version: String? = null): GetSecretVersionAccessResult

Return

A collection of values returned by getSecretVersionAccess.

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


Return

A collection of values returned by getSecretVersionAccess.

Parameters

argument

Builder for com.pulumi.gcp.secretmanager.kotlin.inputs.GetSecretVersionAccessPlainArgs.

See also