SecretBackendConnection

class SecretBackendConnection : KotlinCustomResource

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: [
"dev",
"prod",
],
postgresql: {
connectionUrl: "postgres://username:password@host:port/database",
},
});
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=[
"dev",
"prod",
],
postgresql=vault.database.SecretBackendConnectionPostgresqlArgs(
connection_url="postgres://username:password@host:port/database",
))
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[]
{
"dev",
"prod",
},
Postgresql = new Vault.Database.Inputs.SecretBackendConnectionPostgresqlArgs
{
ConnectionUrl = "postgres://username:password@host:port/database",
},
});
});
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
}
_, err = database.NewSecretBackendConnection(ctx, "postgres", &database.SecretBackendConnectionArgs{
Backend: db.Path,
Name: pulumi.String("postgres"),
AllowedRoles: pulumi.StringArray{
pulumi.String("dev"),
pulumi.String("prod"),
},
Postgresql: &database.SecretBackendConnectionPostgresqlArgs{
ConnectionUrl: pulumi.String("postgres://username:password@host:port/database"),
},
})
if err != nil {
return err
}
return nil
})
}
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 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(
"dev",
"prod")
.postgresql(SecretBackendConnectionPostgresqlArgs.builder()
.connectionUrl("postgres://username:password@host:port/database")
.build())
.build());
}
}
resources:
db:
type: vault:Mount
properties:
path: postgres
type: database
postgres:
type: vault:database:SecretBackendConnection
properties:
backend: ${db.path}
name: postgres
allowedRoles:
- dev
- prod
postgresql:
connectionUrl: postgres://username:password@host:port/database

Import

Database secret backend connections can be imported using the backend, /config/, and the name e.g.

$ pulumi import vault:database/secretBackendConnection:SecretBackendConnection example postgres/config/postgres

Properties

Link copied to clipboard
val allowedRoles: Output<List<String>>?

A list of roles that are allowed to use this connection.

Link copied to clipboard
val backend: Output<String>

The unique name of the Vault mount to configure.

Link copied to clipboard

A nested block containing configuration options for Cassandra connections.

Link copied to clipboard

A nested block containing configuration options for Couchbase connections.

Link copied to clipboard
val data: Output<Map<String, Any>>?

A map of sensitive data to pass to the endpoint. Useful for templated connection strings.

Link copied to clipboard

A nested block containing configuration options for Elasticsearch connections.

Link copied to clipboard

A nested block containing configuration options for SAP HanaDB connections.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

A nested block containing configuration options for InfluxDB connections.

Link copied to clipboard

A nested block containing configuration options for MongoDB connections.

Link copied to clipboard

A nested block containing configuration options for MongoDB Atlas connections.

Link copied to clipboard

A nested block containing configuration options for MSSQL connections.

Link copied to clipboard

A nested block containing configuration options for MySQL connections.

Link copied to clipboard

A nested block containing configuration options for Aurora MySQL connections.

Link copied to clipboard

A nested block containing configuration options for legacy MySQL connections.

Link copied to clipboard

A nested block containing configuration options for RDS MySQL connections.

Link copied to clipboard
val name: Output<String>

A unique name to give the database connection.

Link copied to clipboard
val namespace: Output<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.

Link copied to clipboard

A nested block containing configuration options for Oracle connections.

Link copied to clipboard
val pluginName: Output<String>

Specifies the name of the plugin to use.

Link copied to clipboard

A nested block containing configuration options for PostgreSQL connections.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A nested block containing configuration options for Redis connections.

Link copied to clipboard

A nested block containing configuration options for Redis ElastiCache connections. Exactly one of the nested blocks of configuration options must be supplied.

Link copied to clipboard

Connection parameters for the redshift-database-plugin plugin.

Link copied to clipboard

A list of database statements to be executed to rotate the root user's credentials.

Link copied to clipboard

A nested block containing configuration options for Snowflake connections.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

Whether the connection should be verified on initial configuration or not.