1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. secretmanager
  5. getRegionalSecretVersionAccess
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.secretmanager.getRegionalSecretVersionAccess

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const latest = gcp.secretmanager.getRegionalSecretVersionAccess({
        secret: "my-secret",
        location: "us-central1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    latest = gcp.secretmanager.get_regional_secret_version_access(secret="my-secret",
        location="us-central1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/secretmanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := secretmanager.GetRegionalSecretVersionAccess(ctx, &secretmanager.GetRegionalSecretVersionAccessArgs{
    			Secret:   "my-secret",
    			Location: pulumi.StringRef("us-central1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var latest = Gcp.SecretManager.GetRegionalSecretVersionAccess.Invoke(new()
        {
            Secret = "my-secret",
            Location = "us-central1",
        });
    
    });
    
    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.GetRegionalSecretVersionAccessArgs;
    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 latest = SecretmanagerFunctions.getRegionalSecretVersionAccess(GetRegionalSecretVersionAccessArgs.builder()
                .secret("my-secret")
                .location("us-central1")
                .build());
    
        }
    }
    
    variables:
      latest:
        fn::invoke:
          Function: gcp:secretmanager:getRegionalSecretVersionAccess
          Arguments:
            secret: my-secret
            location: us-central1
    

    Using getRegionalSecretVersionAccess

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRegionalSecretVersionAccess(args: GetRegionalSecretVersionAccessArgs, opts?: InvokeOptions): Promise<GetRegionalSecretVersionAccessResult>
    function getRegionalSecretVersionAccessOutput(args: GetRegionalSecretVersionAccessOutputArgs, opts?: InvokeOptions): Output<GetRegionalSecretVersionAccessResult>
    def get_regional_secret_version_access(is_secret_data_base64: Optional[bool] = None,
                                           location: Optional[str] = None,
                                           project: Optional[str] = None,
                                           secret: Optional[str] = None,
                                           version: Optional[str] = None,
                                           opts: Optional[InvokeOptions] = None) -> GetRegionalSecretVersionAccessResult
    def get_regional_secret_version_access_output(is_secret_data_base64: Optional[pulumi.Input[bool]] = None,
                                           location: Optional[pulumi.Input[str]] = None,
                                           project: Optional[pulumi.Input[str]] = None,
                                           secret: Optional[pulumi.Input[str]] = None,
                                           version: Optional[pulumi.Input[str]] = None,
                                           opts: Optional[InvokeOptions] = None) -> Output[GetRegionalSecretVersionAccessResult]
    func GetRegionalSecretVersionAccess(ctx *Context, args *GetRegionalSecretVersionAccessArgs, opts ...InvokeOption) (*GetRegionalSecretVersionAccessResult, error)
    func GetRegionalSecretVersionAccessOutput(ctx *Context, args *GetRegionalSecretVersionAccessOutputArgs, opts ...InvokeOption) GetRegionalSecretVersionAccessResultOutput

    > Note: This function is named GetRegionalSecretVersionAccess in the Go SDK.

    public static class GetRegionalSecretVersionAccess 
    {
        public static Task<GetRegionalSecretVersionAccessResult> InvokeAsync(GetRegionalSecretVersionAccessArgs args, InvokeOptions? opts = null)
        public static Output<GetRegionalSecretVersionAccessResult> Invoke(GetRegionalSecretVersionAccessInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegionalSecretVersionAccessResult> getRegionalSecretVersionAccess(GetRegionalSecretVersionAccessArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:secretmanager/getRegionalSecretVersionAccess:getRegionalSecretVersionAccess
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Secret string
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    IsSecretDataBase64 bool
    If set to 'true', the secret data is expected to be base64-encoded string.
    Location string
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    Project string
    The project to get the secret version for. If it is not provided, the provider project is used.
    Version string
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.
    Secret string
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    IsSecretDataBase64 bool
    If set to 'true', the secret data is expected to be base64-encoded string.
    Location string
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    Project string
    The project to get the secret version for. If it is not provided, the provider project is used.
    Version string
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.
    secret String
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    isSecretDataBase64 Boolean
    If set to 'true', the secret data is expected to be base64-encoded string.
    location String
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    project String
    The project to get the secret version for. If it is not provided, the provider project is used.
    version String
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.
    secret string
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    isSecretDataBase64 boolean
    If set to 'true', the secret data is expected to be base64-encoded string.
    location string
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    project string
    The project to get the secret version for. If it is not provided, the provider project is used.
    version string
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.
    secret str
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    is_secret_data_base64 bool
    If set to 'true', the secret data is expected to be base64-encoded string.
    location str
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    project str
    The project to get the secret version for. If it is not provided, the provider project is used.
    version str
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.
    secret String
    The regional secret to get the secret version for. This can be either the reference of the regional secret as in projects/{{project}}/locations/{{location}}/secrets/{{secret_id}} or only the name of the regional secret as in {{secret_id}}. If only the name of the regional secret is provided, the location must also be provided.
    isSecretDataBase64 Boolean
    If set to 'true', the secret data is expected to be base64-encoded string.
    location String
    Location of Secret Manager regional secret resource. It must be provided when the secret field provided consists of only the name of the regional secret.
    project String
    The project to get the secret version for. If it is not provided, the provider project is used.
    version String
    The version of the regional secret to get. If it is not provided, the latest version is retrieved.

    getRegionalSecretVersionAccess Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    Project string
    Secret string
    SecretData string
    The secret data. No larger than 64KiB.
    Version string
    IsSecretDataBase64 bool
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    Project string
    Secret string
    SecretData string
    The secret data. No larger than 64KiB.
    Version string
    IsSecretDataBase64 bool
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    project String
    secret String
    secretData String
    The secret data. No larger than 64KiB.
    version String
    isSecretDataBase64 Boolean
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    project string
    secret string
    secretData string
    The secret data. No larger than 64KiB.
    version string
    isSecretDataBase64 boolean
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    name str
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    project str
    secret str
    secret_data str
    The secret data. No larger than 64KiB.
    version str
    is_secret_data_base64 bool
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    The resource name of the regional SecretVersion. Format: projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}/versions/{{version}}
    project String
    secret String
    secretData String
    The secret data. No larger than 64KiB.
    version String
    isSecretDataBase64 Boolean

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi