1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. gcp
  5. SecretBackend
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

vault.gcp.SecretBackend

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as vault from "@pulumi/vault";
    
    const gcp = new vault.gcp.SecretBackend("gcp", {credentials: fs.readFileSync("credentials.json", "utf8")});
    
    import pulumi
    import pulumi_vault as vault
    
    gcp = vault.gcp.SecretBackend("gcp", credentials=(lambda path: open(path).read())("credentials.json"))
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/gcp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcp.NewSecretBackend(ctx, "gcp", &gcp.SecretBackendArgs{
    			Credentials: readFileOrPanic("credentials.json"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var gcp = new Vault.Gcp.SecretBackend("gcp", new()
        {
            Credentials = File.ReadAllText("credentials.json"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.gcp.SecretBackend;
    import com.pulumi.vault.gcp.SecretBackendArgs;
    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) {
            var gcp = new SecretBackend("gcp", SecretBackendArgs.builder()        
                .credentials(Files.readString(Paths.get("credentials.json")))
                .build());
    
        }
    }
    
    resources:
      gcp:
        type: vault:gcp:SecretBackend
        properties:
          credentials:
            fn::readFile: credentials.json
    

    Create SecretBackend Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SecretBackend(name: string, args?: SecretBackendArgs, opts?: CustomResourceOptions);
    @overload
    def SecretBackend(resource_name: str,
                      args: Optional[SecretBackendArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretBackend(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      credentials: Optional[str] = None,
                      default_lease_ttl_seconds: Optional[int] = None,
                      description: Optional[str] = None,
                      disable_remount: Optional[bool] = None,
                      local: Optional[bool] = None,
                      max_lease_ttl_seconds: Optional[int] = None,
                      namespace: Optional[str] = None,
                      path: Optional[str] = None)
    func NewSecretBackend(ctx *Context, name string, args *SecretBackendArgs, opts ...ResourceOption) (*SecretBackend, error)
    public SecretBackend(string name, SecretBackendArgs? args = null, CustomResourceOptions? opts = null)
    public SecretBackend(String name, SecretBackendArgs args)
    public SecretBackend(String name, SecretBackendArgs args, CustomResourceOptions options)
    
    type: vault:gcp:SecretBackend
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SecretBackendArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SecretBackendArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SecretBackendArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretBackendArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretBackendArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var examplesecretBackendResourceResourceFromGcpsecretBackend = new Vault.Gcp.SecretBackend("examplesecretBackendResourceResourceFromGcpsecretBackend", new()
    {
        Credentials = "string",
        DefaultLeaseTtlSeconds = 0,
        Description = "string",
        DisableRemount = false,
        Local = false,
        MaxLeaseTtlSeconds = 0,
        Namespace = "string",
        Path = "string",
    });
    
    example, err := gcp.NewSecretBackend(ctx, "examplesecretBackendResourceResourceFromGcpsecretBackend", &gcp.SecretBackendArgs{
    	Credentials:            pulumi.String("string"),
    	DefaultLeaseTtlSeconds: pulumi.Int(0),
    	Description:            pulumi.String("string"),
    	DisableRemount:         pulumi.Bool(false),
    	Local:                  pulumi.Bool(false),
    	MaxLeaseTtlSeconds:     pulumi.Int(0),
    	Namespace:              pulumi.String("string"),
    	Path:                   pulumi.String("string"),
    })
    
    var examplesecretBackendResourceResourceFromGcpsecretBackend = new SecretBackend("examplesecretBackendResourceResourceFromGcpsecretBackend", SecretBackendArgs.builder()        
        .credentials("string")
        .defaultLeaseTtlSeconds(0)
        .description("string")
        .disableRemount(false)
        .local(false)
        .maxLeaseTtlSeconds(0)
        .namespace("string")
        .path("string")
        .build());
    
    examplesecret_backend_resource_resource_from_gcpsecret_backend = vault.gcp.SecretBackend("examplesecretBackendResourceResourceFromGcpsecretBackend",
        credentials="string",
        default_lease_ttl_seconds=0,
        description="string",
        disable_remount=False,
        local=False,
        max_lease_ttl_seconds=0,
        namespace="string",
        path="string")
    
    const examplesecretBackendResourceResourceFromGcpsecretBackend = new vault.gcp.SecretBackend("examplesecretBackendResourceResourceFromGcpsecretBackend", {
        credentials: "string",
        defaultLeaseTtlSeconds: 0,
        description: "string",
        disableRemount: false,
        local: false,
        maxLeaseTtlSeconds: 0,
        namespace: "string",
        path: "string",
    });
    
    type: vault:gcp:SecretBackend
    properties:
        credentials: string
        defaultLeaseTtlSeconds: 0
        description: string
        disableRemount: false
        local: false
        maxLeaseTtlSeconds: 0
        namespace: string
        path: string
    

    SecretBackend Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The SecretBackend resource accepts the following input properties:

    Credentials string
    JSON-encoded credentials to use to connect to GCP
    DefaultLeaseTtlSeconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    Description string
    A human-friendly description for this backend.
    DisableRemount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    Local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    MaxLeaseTtlSeconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    Credentials string
    JSON-encoded credentials to use to connect to GCP
    DefaultLeaseTtlSeconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    Description string
    A human-friendly description for this backend.
    DisableRemount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    Local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    MaxLeaseTtlSeconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials String
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds Integer
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description String
    A human-friendly description for this backend.
    disableRemount Boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local Boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds Integer
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path String
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials string
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds number
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description string
    A human-friendly description for this backend.
    disableRemount boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds number
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials str
    JSON-encoded credentials to use to connect to GCP
    default_lease_ttl_seconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description str
    A human-friendly description for this backend.
    disable_remount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    max_lease_ttl_seconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace str
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path str
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials String
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds Number
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description String
    A human-friendly description for this backend.
    disableRemount Boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local Boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds Number
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path String
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecretBackend resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing SecretBackend Resource

    Get an existing SecretBackend resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SecretBackendState, opts?: CustomResourceOptions): SecretBackend
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            credentials: Optional[str] = None,
            default_lease_ttl_seconds: Optional[int] = None,
            description: Optional[str] = None,
            disable_remount: Optional[bool] = None,
            local: Optional[bool] = None,
            max_lease_ttl_seconds: Optional[int] = None,
            namespace: Optional[str] = None,
            path: Optional[str] = None) -> SecretBackend
    func GetSecretBackend(ctx *Context, name string, id IDInput, state *SecretBackendState, opts ...ResourceOption) (*SecretBackend, error)
    public static SecretBackend Get(string name, Input<string> id, SecretBackendState? state, CustomResourceOptions? opts = null)
    public static SecretBackend get(String name, Output<String> id, SecretBackendState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Credentials string
    JSON-encoded credentials to use to connect to GCP
    DefaultLeaseTtlSeconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    Description string
    A human-friendly description for this backend.
    DisableRemount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    Local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    MaxLeaseTtlSeconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    Credentials string
    JSON-encoded credentials to use to connect to GCP
    DefaultLeaseTtlSeconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    Description string
    A human-friendly description for this backend.
    DisableRemount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    Local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    MaxLeaseTtlSeconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials String
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds Integer
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description String
    A human-friendly description for this backend.
    disableRemount Boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local Boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds Integer
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path String
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials string
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds number
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description string
    A human-friendly description for this backend.
    disableRemount boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds number
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path string
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials str
    JSON-encoded credentials to use to connect to GCP
    default_lease_ttl_seconds int
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description str
    A human-friendly description for this backend.
    disable_remount bool
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local bool
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    max_lease_ttl_seconds int
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace str
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path str
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.
    credentials String
    JSON-encoded credentials to use to connect to GCP
    defaultLeaseTtlSeconds Number
    The default TTL for credentials issued by this backend. Defaults to '0'.
    description String
    A human-friendly description for this backend.
    disableRemount Boolean
    If set, opts out of mount migration on path updates. See here for more info on Mount Migration
    local Boolean
    Boolean flag that can be explicitly set to true to enforce local mount in HA environment
    maxLeaseTtlSeconds Number
    The maximum TTL that can be requested for credentials issued by this backend. Defaults to '0'.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    path String
    The unique path this backend should be mounted at. Must not begin or end with a /. Defaults to gcp.

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo
    HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi