1. Packages
  2. Packages
  3. Juju Provider
  4. API Docs
  5. SecretBackend
Viewing docs for juju 2.2.1
published on Monday, Jul 27, 2026 by juju
Viewing docs for juju 2.2.1
published on Monday, Jul 27, 2026 by juju

    A resource that represents a Juju secret backend.

    Secret backends store secret content. To learn more about secret backends, please visit: https://canonical.com/juju/docs/juju-cli/3.6/howto/manage-secret-backends/

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as juju from "@pulumi/juju";
    
    const myvault = new juju.SecretBackend("myvault", {
        name: "myvault",
        backendType: "vault",
        configWo: {
            endpoint: "https://vault.example.com:8200",
            token: "s.exampletoken",
        },
        configWoVersion: 1,
        tokenRotateInterval: "24h",
    });
    
    import pulumi
    import pulumi_juju as juju
    
    myvault = juju.SecretBackend("myvault",
        name="myvault",
        backend_type="vault",
        config_wo={
            "endpoint": "https://vault.example.com:8200",
            "token": "s.exampletoken",
        },
        config_wo_version=1,
        token_rotate_interval="24h")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/juju/v2/juju"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := juju.NewSecretBackend(ctx, "myvault", &juju.SecretBackendArgs{
    			Name:        pulumi.String("myvault"),
    			BackendType: pulumi.String("vault"),
    			ConfigWo: pulumi.StringMap{
    				"endpoint": pulumi.String("https://vault.example.com:8200"),
    				"token":    pulumi.String("s.exampletoken"),
    			},
    			ConfigWoVersion:     pulumi.Float64(1),
    			TokenRotateInterval: pulumi.String("24h"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Juju = Pulumi.Juju;
    
    return await Deployment.RunAsync(() => 
    {
        var myvault = new Juju.SecretBackend("myvault", new()
        {
            Name = "myvault",
            BackendType = "vault",
            ConfigWo = 
            {
                { "endpoint", "https://vault.example.com:8200" },
                { "token", "s.exampletoken" },
            },
            ConfigWoVersion = 1,
            TokenRotateInterval = "24h",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.juju.SecretBackend;
    import com.pulumi.juju.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 myvault = new SecretBackend("myvault", SecretBackendArgs.builder()
                .name("myvault")
                .backendType("vault")
                .configWo(Map.ofEntries(
                    Map.entry("endpoint", "https://vault.example.com:8200"),
                    Map.entry("token", "s.exampletoken")
                ))
                .configWoVersion(1.0)
                .tokenRotateInterval("24h")
                .build());
    
        }
    }
    
    resources:
      myvault:
        type: juju:SecretBackend
        properties:
          name: myvault
          backendType: vault
          configWo:
            endpoint: https://vault.example.com:8200
            token: s.exampletoken
          configWoVersion: 1
          tokenRotateInterval: 24h
    
    Example coming soon!
    

    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: SecretBackendArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretBackend(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      backend_type: Optional[str] = None,
                      config_wo: Optional[Mapping[str, str]] = None,
                      config_wo_version: Optional[float] = None,
                      name: Optional[str] = None,
                      token_rotate_interval: Optional[str] = None)
    func NewSecretBackend(ctx *Context, name string, args SecretBackendArgs, opts ...ResourceOption) (*SecretBackend, error)
    public SecretBackend(string name, SecretBackendArgs args, CustomResourceOptions? opts = null)
    public SecretBackend(String name, SecretBackendArgs args)
    public SecretBackend(String name, SecretBackendArgs args, CustomResourceOptions options)
    
    type: juju:SecretBackend
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "juju_secret_backend" "name" {
        # resource properties
    }

    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.

    Constructor example

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

    var secretBackendResource = new Juju.SecretBackend("secretBackendResource", new()
    {
        BackendType = "string",
        ConfigWo = 
        {
            { "string", "string" },
        },
        ConfigWoVersion = 0,
        Name = "string",
        TokenRotateInterval = "string",
    });
    
    example, err := juju.NewSecretBackend(ctx, "secretBackendResource", &juju.SecretBackendArgs{
    	BackendType: pulumi.String("string"),
    	ConfigWo: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ConfigWoVersion:     pulumi.Float64(0),
    	Name:                pulumi.String("string"),
    	TokenRotateInterval: pulumi.String("string"),
    })
    
    resource "juju_secret_backend" "secretBackendResource" {
      lifecycle {
        create_before_destroy = true
      }
      backend_type = "string"
      config_wo = {
        "string" = "string"
      }
      config_wo_version     = 0
      name                  = "string"
      token_rotate_interval = "string"
    }
    
    var secretBackendResource = new SecretBackend("secretBackendResource", SecretBackendArgs.builder()
        .backendType("string")
        .configWo(Map.of("string", "string"))
        .configWoVersion(0.0)
        .name("string")
        .tokenRotateInterval("string")
        .build());
    
    secret_backend_resource = juju.SecretBackend("secretBackendResource",
        backend_type="string",
        config_wo={
            "string": "string",
        },
        config_wo_version=float(0),
        name="string",
        token_rotate_interval="string")
    
    const secretBackendResource = new juju.SecretBackend("secretBackendResource", {
        backendType: "string",
        configWo: {
            string: "string",
        },
        configWoVersion: 0,
        name: "string",
        tokenRotateInterval: "string",
    });
    
    type: juju:SecretBackend
    properties:
        backendType: string
        configWo:
            string: string
        configWoVersion: 0
        name: string
        tokenRotateInterval: 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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SecretBackend resource accepts the following input properties:

    BackendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    ConfigWo Dictionary<string, string>
    ConfigWoVersion double
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    Name string
    The name of the secret backend.
    TokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    BackendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    ConfigWo map[string]string
    ConfigWoVersion float64
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    Name string
    The name of the secret backend.
    TokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backend_type string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    config_wo map(string)
    config_wo_version number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name string
    The name of the secret backend.
    token_rotate_interval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType String
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo Map<String,String>
    configWoVersion Double
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name String
    The name of the secret backend.
    tokenRotateInterval String
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo {[key: string]: string}
    configWoVersion number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name string
    The name of the secret backend.
    tokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backend_type str
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    config_wo Mapping[str, str]
    config_wo_version float
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name str
    The name of the secret backend.
    token_rotate_interval str
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType String
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo Map<String>
    configWoVersion Number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name String
    The name of the secret backend.
    tokenRotateInterval String
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').

    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 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,
            backend_type: Optional[str] = None,
            config_wo: Optional[Mapping[str, str]] = None,
            config_wo_version: Optional[float] = None,
            name: Optional[str] = None,
            token_rotate_interval: 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)
    resources:  _:    type: juju:SecretBackend    get:      id: ${id}
    import {
      to = juju_secret_backend.example
      id = "${id}"
    }
    
    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:
    BackendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    ConfigWo Dictionary<string, string>
    ConfigWoVersion double
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    Name string
    The name of the secret backend.
    TokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    BackendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    ConfigWo map[string]string
    ConfigWoVersion float64
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    Name string
    The name of the secret backend.
    TokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backend_type string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    config_wo map(string)
    config_wo_version number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name string
    The name of the secret backend.
    token_rotate_interval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType String
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo Map<String,String>
    configWoVersion Double
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name String
    The name of the secret backend.
    tokenRotateInterval String
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType string
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo {[key: string]: string}
    configWoVersion number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name string
    The name of the secret backend.
    tokenRotateInterval string
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backend_type str
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    config_wo Mapping[str, str]
    config_wo_version float
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name str
    The name of the secret backend.
    token_rotate_interval str
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').
    backendType String
    The type of the secret backend (e.g., 'vault', 'kubernetes').
    configWo Map<String>
    configWoVersion Number
    The version of config_wo. Increment this value to trigger an update of the write-only backend configuration.
    name String
    The name of the secret backend.
    tokenRotateInterval String
    The interval at which the backend's access credential/token should be rotated. Must be a duration string parsable by Go's time.ParseDuration (e.g., '10m', '1h', '24h').

    Import

    The pulumi import command can be used, for example:

    Secret backends can be imported using their name.

    $ pulumi import juju:index/secretBackend:SecretBackend my_backend my-backend-name
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    juju juju/terraform-provider-juju
    License
    Notes
    This Pulumi package is based on the juju Terraform Provider.
    Viewing docs for juju 2.2.1
    published on Monday, Jul 27, 2026 by juju

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial