1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. database
  5. SecretBackendStaticRole
HashiCorp Vault v6.3.0 published on Thursday, Aug 8, 2024 by Pulumi

vault.database.SecretBackendStaticRole

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.3.0 published on Thursday, Aug 8, 2024 by Pulumi

    Creates a Database Secret Backend static role in Vault. Database secret backend static roles can be used to manage 1-to-1 mapping of a Vault Role to a user in a database for the database.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const db = new vault.Mount("db", {
        path: "postgres",
        type: "database",
    });
    const postgres = new vault.database.SecretBackendConnection("postgres", {
        backend: db.path,
        name: "postgres",
        allowedRoles: ["*"],
        postgresql: {
            connectionUrl: "postgres://username:password@host:port/database",
        },
    });
    // configure a static role with period-based rotations
    const periodRole = new vault.database.SecretBackendStaticRole("period_role", {
        backend: db.path,
        name: "my-period-role",
        dbName: postgres.name,
        username: "example",
        rotationPeriod: 3600,
        rotationStatements: ["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"],
    });
    // configure a static role with schedule-based rotations
    const scheduleRole = new vault.database.SecretBackendStaticRole("schedule_role", {
        backend: db.path,
        name: "my-schedule-role",
        dbName: postgres.name,
        username: "example",
        rotationSchedule: "0 0 * * SAT",
        rotationWindow: 172800,
        rotationStatements: ["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"],
    });
    
    import pulumi
    import pulumi_vault as vault
    
    db = vault.Mount("db",
        path="postgres",
        type="database")
    postgres = vault.database.SecretBackendConnection("postgres",
        backend=db.path,
        name="postgres",
        allowed_roles=["*"],
        postgresql=vault.database.SecretBackendConnectionPostgresqlArgs(
            connection_url="postgres://username:password@host:port/database",
        ))
    # configure a static role with period-based rotations
    period_role = vault.database.SecretBackendStaticRole("period_role",
        backend=db.path,
        name="my-period-role",
        db_name=postgres.name,
        username="example",
        rotation_period=3600,
        rotation_statements=["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"])
    # configure a static role with schedule-based rotations
    schedule_role = vault.database.SecretBackendStaticRole("schedule_role",
        backend=db.path,
        name="my-schedule-role",
        db_name=postgres.name,
        username="example",
        rotation_schedule="0 0 * * SAT",
        rotation_window=172800,
        rotation_statements=["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/database"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		db, err := vault.NewMount(ctx, "db", &vault.MountArgs{
    			Path: pulumi.String("postgres"),
    			Type: pulumi.String("database"),
    		})
    		if err != nil {
    			return err
    		}
    		postgres, err := database.NewSecretBackendConnection(ctx, "postgres", &database.SecretBackendConnectionArgs{
    			Backend: db.Path,
    			Name:    pulumi.String("postgres"),
    			AllowedRoles: pulumi.StringArray{
    				pulumi.String("*"),
    			},
    			Postgresql: &database.SecretBackendConnectionPostgresqlArgs{
    				ConnectionUrl: pulumi.String("postgres://username:password@host:port/database"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// configure a static role with period-based rotations
    		_, err = database.NewSecretBackendStaticRole(ctx, "period_role", &database.SecretBackendStaticRoleArgs{
    			Backend:        db.Path,
    			Name:           pulumi.String("my-period-role"),
    			DbName:         postgres.Name,
    			Username:       pulumi.String("example"),
    			RotationPeriod: pulumi.Int(3600),
    			RotationStatements: pulumi.StringArray{
    				pulumi.String("ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// configure a static role with schedule-based rotations
    		_, err = database.NewSecretBackendStaticRole(ctx, "schedule_role", &database.SecretBackendStaticRoleArgs{
    			Backend:          db.Path,
    			Name:             pulumi.String("my-schedule-role"),
    			DbName:           postgres.Name,
    			Username:         pulumi.String("example"),
    			RotationSchedule: pulumi.String("0 0 * * SAT"),
    			RotationWindow:   pulumi.Int(172800),
    			RotationStatements: pulumi.StringArray{
    				pulumi.String("ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var db = new Vault.Mount("db", new()
        {
            Path = "postgres",
            Type = "database",
        });
    
        var postgres = new Vault.Database.SecretBackendConnection("postgres", new()
        {
            Backend = db.Path,
            Name = "postgres",
            AllowedRoles = new[]
            {
                "*",
            },
            Postgresql = new Vault.Database.Inputs.SecretBackendConnectionPostgresqlArgs
            {
                ConnectionUrl = "postgres://username:password@host:port/database",
            },
        });
    
        // configure a static role with period-based rotations
        var periodRole = new Vault.Database.SecretBackendStaticRole("period_role", new()
        {
            Backend = db.Path,
            Name = "my-period-role",
            DbName = postgres.Name,
            Username = "example",
            RotationPeriod = 3600,
            RotationStatements = new[]
            {
                "ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';",
            },
        });
    
        // configure a static role with schedule-based rotations
        var scheduleRole = new Vault.Database.SecretBackendStaticRole("schedule_role", new()
        {
            Backend = db.Path,
            Name = "my-schedule-role",
            DbName = postgres.Name,
            Username = "example",
            RotationSchedule = "0 0 * * SAT",
            RotationWindow = 172800,
            RotationStatements = new[]
            {
                "ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.Mount;
    import com.pulumi.vault.MountArgs;
    import com.pulumi.vault.database.SecretBackendConnection;
    import com.pulumi.vault.database.SecretBackendConnectionArgs;
    import com.pulumi.vault.database.inputs.SecretBackendConnectionPostgresqlArgs;
    import com.pulumi.vault.database.SecretBackendStaticRole;
    import com.pulumi.vault.database.SecretBackendStaticRoleArgs;
    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 db = new Mount("db", MountArgs.builder()
                .path("postgres")
                .type("database")
                .build());
    
            var postgres = new SecretBackendConnection("postgres", SecretBackendConnectionArgs.builder()
                .backend(db.path())
                .name("postgres")
                .allowedRoles("*")
                .postgresql(SecretBackendConnectionPostgresqlArgs.builder()
                    .connectionUrl("postgres://username:password@host:port/database")
                    .build())
                .build());
    
            // configure a static role with period-based rotations
            var periodRole = new SecretBackendStaticRole("periodRole", SecretBackendStaticRoleArgs.builder()
                .backend(db.path())
                .name("my-period-role")
                .dbName(postgres.name())
                .username("example")
                .rotationPeriod("3600")
                .rotationStatements("ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';")
                .build());
    
            // configure a static role with schedule-based rotations
            var scheduleRole = new SecretBackendStaticRole("scheduleRole", SecretBackendStaticRoleArgs.builder()
                .backend(db.path())
                .name("my-schedule-role")
                .dbName(postgres.name())
                .username("example")
                .rotationSchedule("0 0 * * SAT")
                .rotationWindow("172800")
                .rotationStatements("ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';")
                .build());
    
        }
    }
    
    resources:
      db:
        type: vault:Mount
        properties:
          path: postgres
          type: database
      postgres:
        type: vault:database:SecretBackendConnection
        properties:
          backend: ${db.path}
          name: postgres
          allowedRoles:
            - '*'
          postgresql:
            connectionUrl: postgres://username:password@host:port/database
      # configure a static role with period-based rotations
      periodRole:
        type: vault:database:SecretBackendStaticRole
        name: period_role
        properties:
          backend: ${db.path}
          name: my-period-role
          dbName: ${postgres.name}
          username: example
          rotationPeriod: '3600'
          rotationStatements:
            - ALTER USER "{{name}}" WITH PASSWORD '{{password}}';
      # configure a static role with schedule-based rotations
      scheduleRole:
        type: vault:database:SecretBackendStaticRole
        name: schedule_role
        properties:
          backend: ${db.path}
          name: my-schedule-role
          dbName: ${postgres.name}
          username: example
          rotationSchedule: 0 0 * * SAT
          rotationWindow: '172800'
          rotationStatements:
            - ALTER USER "{{name}}" WITH PASSWORD '{{password}}';
    

    Create SecretBackendStaticRole Resource

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

    Constructor syntax

    new SecretBackendStaticRole(name: string, args: SecretBackendStaticRoleArgs, opts?: CustomResourceOptions);
    @overload
    def SecretBackendStaticRole(resource_name: str,
                                args: SecretBackendStaticRoleArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretBackendStaticRole(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                backend: Optional[str] = None,
                                db_name: Optional[str] = None,
                                username: Optional[str] = None,
                                name: Optional[str] = None,
                                namespace: Optional[str] = None,
                                rotation_period: Optional[int] = None,
                                rotation_schedule: Optional[str] = None,
                                rotation_statements: Optional[Sequence[str]] = None,
                                rotation_window: Optional[int] = None)
    func NewSecretBackendStaticRole(ctx *Context, name string, args SecretBackendStaticRoleArgs, opts ...ResourceOption) (*SecretBackendStaticRole, error)
    public SecretBackendStaticRole(string name, SecretBackendStaticRoleArgs args, CustomResourceOptions? opts = null)
    public SecretBackendStaticRole(String name, SecretBackendStaticRoleArgs args)
    public SecretBackendStaticRole(String name, SecretBackendStaticRoleArgs args, CustomResourceOptions options)
    
    type: vault:database:SecretBackendStaticRole
    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 SecretBackendStaticRoleArgs
    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 SecretBackendStaticRoleArgs
    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 SecretBackendStaticRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretBackendStaticRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretBackendStaticRoleArgs
    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 vaultSecretBackendStaticRoleResource = new Vault.Database.SecretBackendStaticRole("vaultSecretBackendStaticRoleResource", new()
    {
        Backend = "string",
        DbName = "string",
        Username = "string",
        Name = "string",
        Namespace = "string",
        RotationPeriod = 0,
        RotationSchedule = "string",
        RotationStatements = new[]
        {
            "string",
        },
        RotationWindow = 0,
    });
    
    example, err := database.NewSecretBackendStaticRole(ctx, "vaultSecretBackendStaticRoleResource", &database.SecretBackendStaticRoleArgs{
    	Backend:          pulumi.String("string"),
    	DbName:           pulumi.String("string"),
    	Username:         pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	Namespace:        pulumi.String("string"),
    	RotationPeriod:   pulumi.Int(0),
    	RotationSchedule: pulumi.String("string"),
    	RotationStatements: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RotationWindow: pulumi.Int(0),
    })
    
    var vaultSecretBackendStaticRoleResource = new SecretBackendStaticRole("vaultSecretBackendStaticRoleResource", SecretBackendStaticRoleArgs.builder()
        .backend("string")
        .dbName("string")
        .username("string")
        .name("string")
        .namespace("string")
        .rotationPeriod(0)
        .rotationSchedule("string")
        .rotationStatements("string")
        .rotationWindow(0)
        .build());
    
    vault_secret_backend_static_role_resource = vault.database.SecretBackendStaticRole("vaultSecretBackendStaticRoleResource",
        backend="string",
        db_name="string",
        username="string",
        name="string",
        namespace="string",
        rotation_period=0,
        rotation_schedule="string",
        rotation_statements=["string"],
        rotation_window=0)
    
    const vaultSecretBackendStaticRoleResource = new vault.database.SecretBackendStaticRole("vaultSecretBackendStaticRoleResource", {
        backend: "string",
        dbName: "string",
        username: "string",
        name: "string",
        namespace: "string",
        rotationPeriod: 0,
        rotationSchedule: "string",
        rotationStatements: ["string"],
        rotationWindow: 0,
    });
    
    type: vault:database:SecretBackendStaticRole
    properties:
        backend: string
        dbName: string
        name: string
        namespace: string
        rotationPeriod: 0
        rotationSchedule: string
        rotationStatements:
            - string
        rotationWindow: 0
        username: string
    

    SecretBackendStaticRole 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 SecretBackendStaticRole resource accepts the following input properties:

    Backend string
    The unique name of the Vault mount to configure.
    DbName string
    The unique name of the database connection to use for the static role.
    Username string
    The database username that this static role corresponds to.
    Name string
    A unique name to give the static role.
    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.
    RotationPeriod int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    RotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    RotationStatements List<string>
    Database statements to execute to rotate the password for the configured database user.
    RotationWindow int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    Backend string
    The unique name of the Vault mount to configure.
    DbName string
    The unique name of the database connection to use for the static role.
    Username string
    The database username that this static role corresponds to.
    Name string
    A unique name to give the static role.
    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.
    RotationPeriod int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    RotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    RotationStatements []string
    Database statements to execute to rotate the password for the configured database user.
    RotationWindow int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    backend String
    The unique name of the Vault mount to configure.
    dbName String
    The unique name of the database connection to use for the static role.
    username String
    The database username that this static role corresponds to.
    name String
    A unique name to give the static role.
    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.
    rotationPeriod Integer
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule String

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements List<String>
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow Integer
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    backend string
    The unique name of the Vault mount to configure.
    dbName string
    The unique name of the database connection to use for the static role.
    username string
    The database username that this static role corresponds to.
    name string
    A unique name to give the static role.
    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.
    rotationPeriod number
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements string[]
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow number
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    backend str
    The unique name of the Vault mount to configure.
    db_name str
    The unique name of the database connection to use for the static role.
    username str
    The database username that this static role corresponds to.
    name str
    A unique name to give the static role.
    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.
    rotation_period int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotation_schedule str

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotation_statements Sequence[str]
    Database statements to execute to rotate the password for the configured database user.
    rotation_window int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    backend String
    The unique name of the Vault mount to configure.
    dbName String
    The unique name of the database connection to use for the static role.
    username String
    The database username that this static role corresponds to.
    name String
    A unique name to give the static role.
    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.
    rotationPeriod Number
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule String

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements List<String>
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow Number
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecretBackendStaticRole 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 SecretBackendStaticRole Resource

    Get an existing SecretBackendStaticRole 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?: SecretBackendStaticRoleState, opts?: CustomResourceOptions): SecretBackendStaticRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backend: Optional[str] = None,
            db_name: Optional[str] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            rotation_period: Optional[int] = None,
            rotation_schedule: Optional[str] = None,
            rotation_statements: Optional[Sequence[str]] = None,
            rotation_window: Optional[int] = None,
            username: Optional[str] = None) -> SecretBackendStaticRole
    func GetSecretBackendStaticRole(ctx *Context, name string, id IDInput, state *SecretBackendStaticRoleState, opts ...ResourceOption) (*SecretBackendStaticRole, error)
    public static SecretBackendStaticRole Get(string name, Input<string> id, SecretBackendStaticRoleState? state, CustomResourceOptions? opts = null)
    public static SecretBackendStaticRole get(String name, Output<String> id, SecretBackendStaticRoleState 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:
    Backend string
    The unique name of the Vault mount to configure.
    DbName string
    The unique name of the database connection to use for the static role.
    Name string
    A unique name to give the static role.
    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.
    RotationPeriod int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    RotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    RotationStatements List<string>
    Database statements to execute to rotate the password for the configured database user.
    RotationWindow int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    Username string
    The database username that this static role corresponds to.
    Backend string
    The unique name of the Vault mount to configure.
    DbName string
    The unique name of the database connection to use for the static role.
    Name string
    A unique name to give the static role.
    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.
    RotationPeriod int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    RotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    RotationStatements []string
    Database statements to execute to rotate the password for the configured database user.
    RotationWindow int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    Username string
    The database username that this static role corresponds to.
    backend String
    The unique name of the Vault mount to configure.
    dbName String
    The unique name of the database connection to use for the static role.
    name String
    A unique name to give the static role.
    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.
    rotationPeriod Integer
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule String

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements List<String>
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow Integer
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    username String
    The database username that this static role corresponds to.
    backend string
    The unique name of the Vault mount to configure.
    dbName string
    The unique name of the database connection to use for the static role.
    name string
    A unique name to give the static role.
    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.
    rotationPeriod number
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule string

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements string[]
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow number
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    username string
    The database username that this static role corresponds to.
    backend str
    The unique name of the Vault mount to configure.
    db_name str
    The unique name of the database connection to use for the static role.
    name str
    A unique name to give the static role.
    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.
    rotation_period int
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotation_schedule str

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotation_statements Sequence[str]
    Database statements to execute to rotate the password for the configured database user.
    rotation_window int
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    username str
    The database username that this static role corresponds to.
    backend String
    The unique name of the Vault mount to configure.
    dbName String
    The unique name of the database connection to use for the static role.
    name String
    A unique name to give the static role.
    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.
    rotationPeriod Number
    The amount of time Vault should wait before rotating the password, in seconds. Mutually exclusive with rotation_schedule.
    rotationSchedule String

    A cron-style string that will define the schedule on which rotations should occur. Mutually exclusive with rotation_period.

    Warning: The rotation_period and rotation_schedule fields are mutually exclusive. One of them must be set but not both.

    rotationStatements List<String>
    Database statements to execute to rotate the password for the configured database user.
    rotationWindow Number
    The amount of time, in seconds, in which rotations are allowed to occur starting from a given rotation_schedule.
    username String
    The database username that this static role corresponds to.

    Import

    Database secret backend static roles can be imported using the backend, /static-roles/, and the name e.g.

    $ pulumi import vault:database/secretBackendStaticRole:SecretBackendStaticRole example postgres/static-roles/my-role
    

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

    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.3.0 published on Thursday, Aug 8, 2024 by Pulumi