CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse
cockroach.getConnectionString
Explore with Pulumi AI
Generic connection string for a cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cockroach from "@pulumi/cockroach";
const config = new pulumi.Config();
const clusterId = config.require("clusterId");
const sqlUserName = config.require("sqlUserName");
const sqlUserPassword = config.require("sqlUserPassword");
const database = config.require("database");
const os = config.require("os");
const cockroach = cockroach.getConnectionString({
id: clusterId,
sqlUser: sqlUserName,
password: sqlUserPassword,
database: database,
os: os,
});
import pulumi
import pulumi_cockroach as cockroach
config = pulumi.Config()
cluster_id = config.require("clusterId")
sql_user_name = config.require("sqlUserName")
sql_user_password = config.require("sqlUserPassword")
database = config.require("database")
os = config.require("os")
cockroach = cockroach.get_connection_string(id=cluster_id,
sql_user=sql_user_name,
password=sql_user_password,
database=database,
os=os)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
"github.com/pulumiverse/pulumi-cockroach/sdk/go/cockroach"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
clusterId := cfg.Require("clusterId")
sqlUserName := cfg.Require("sqlUserName")
sqlUserPassword := cfg.Require("sqlUserPassword")
database := cfg.Require("database")
os := cfg.Require("os")
_, err := cockroach.GetConnectionString(ctx, &cockroach.GetConnectionStringArgs{
Id: clusterId,
SqlUser: pulumi.StringRef(sqlUserName),
Password: pulumi.StringRef(sqlUserPassword),
Database: pulumi.StringRef(database),
Os: pulumi.StringRef(os),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cockroach = Pulumi.Cockroach;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var clusterId = config.Require("clusterId");
var sqlUserName = config.Require("sqlUserName");
var sqlUserPassword = config.Require("sqlUserPassword");
var database = config.Require("database");
var os = config.Require("os");
var cockroach = Cockroach.GetConnectionString.Invoke(new()
{
Id = clusterId,
SqlUser = sqlUserName,
Password = sqlUserPassword,
Database = database,
Os = os,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cockroach.CockroachFunctions;
import com.pulumi.cockroach.inputs.GetConnectionStringArgs;
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 config = ctx.config();
final var clusterId = config.get("clusterId");
final var sqlUserName = config.get("sqlUserName");
final var sqlUserPassword = config.get("sqlUserPassword");
final var database = config.get("database");
final var os = config.get("os");
final var cockroach = CockroachFunctions.getConnectionString(GetConnectionStringArgs.builder()
.id(clusterId)
.sqlUser(sqlUserName)
.password(sqlUserPassword)
.database(database)
.os(os)
.build());
}
}
configuration:
clusterId:
type: string
sqlUserName:
type: string
sqlUserPassword:
type: string
database:
type: string
os:
type: string
variables:
cockroach:
fn::invoke:
Function: cockroach:getConnectionString
Arguments:
id: ${clusterId}
sqlUser: ${sqlUserName}
password: ${sqlUserPassword}
database: ${database}
os: ${os}
Using getConnectionString
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 getConnectionString(args: GetConnectionStringArgs, opts?: InvokeOptions): Promise<GetConnectionStringResult>
function getConnectionStringOutput(args: GetConnectionStringOutputArgs, opts?: InvokeOptions): Output<GetConnectionStringResult>
def get_connection_string(database: Optional[str] = None,
id: Optional[str] = None,
os: Optional[str] = None,
password: Optional[str] = None,
sql_user: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetConnectionStringResult
def get_connection_string_output(database: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
os: Optional[pulumi.Input[str]] = None,
password: Optional[pulumi.Input[str]] = None,
sql_user: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetConnectionStringResult]
func GetConnectionString(ctx *Context, args *GetConnectionStringArgs, opts ...InvokeOption) (*GetConnectionStringResult, error)
func GetConnectionStringOutput(ctx *Context, args *GetConnectionStringOutputArgs, opts ...InvokeOption) GetConnectionStringResultOutput
> Note: This function is named GetConnectionString
in the Go SDK.
public static class GetConnectionString
{
public static Task<GetConnectionStringResult> InvokeAsync(GetConnectionStringArgs args, InvokeOptions? opts = null)
public static Output<GetConnectionStringResult> Invoke(GetConnectionStringInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetConnectionStringResult> getConnectionString(GetConnectionStringArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: cockroach:index/getConnectionString:getConnectionString
arguments:
# arguments dictionary
The following arguments are supported:
getConnectionString Result
The following output properties are available:
- Connection
Params Pulumiverse.Cockroach. Outputs. Get Connection String Connection Params - Connection
String string - Database string
- Id string
- Os string
- Password string
- Sql
User string
- Connection
Params GetConnection String Connection Params - Connection
String string - Database string
- Id string
- Os string
- Password string
- Sql
User string
- connection
Params GetConnection String Connection Params - connection
String String - database String
- id String
- os String
- password String
- sql
User String
- connection
Params GetConnection String Connection Params - connection
String string - database string
- id string
- os string
- password string
- sql
User string
- connection_
params GetConnection String Connection Params - connection_
string str - database str
- id str
- os str
- password str
- sql_
user str
- connection
Params Property Map - connection
String String - database String
- id String
- os String
- password String
- sql
User String
Supporting Types
GetConnectionStringConnectionParams
Package Details
- Repository
- cockroach pulumiverse/pulumi-cockroach
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cockroach
Terraform Provider.