DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi
digitalocean.getDatabaseCa
Explore with Pulumi AI
Provides the CA certificate for a DigitalOcean database.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const ca = digitalocean.getDatabaseCa({
clusterId: "aaa-bbb-ccc-ddd",
});
export const caOutput = ca.then(ca => ca.certificate);
import pulumi
import pulumi_digitalocean as digitalocean
ca = digitalocean.get_database_ca(cluster_id="aaa-bbb-ccc-ddd")
pulumi.export("caOutput", ca.certificate)
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ca, err := digitalocean.GetDatabaseCa(ctx, &digitalocean.GetDatabaseCaArgs{
ClusterId: "aaa-bbb-ccc-ddd",
}, nil)
if err != nil {
return err
}
ctx.Export("caOutput", ca.Certificate)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var ca = DigitalOcean.GetDatabaseCa.Invoke(new()
{
ClusterId = "aaa-bbb-ccc-ddd",
});
return new Dictionary<string, object?>
{
["caOutput"] = ca.Apply(getDatabaseCaResult => getDatabaseCaResult.Certificate),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetDatabaseCaArgs;
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 ca = DigitaloceanFunctions.getDatabaseCa(GetDatabaseCaArgs.builder()
.clusterId("aaa-bbb-ccc-ddd")
.build());
ctx.export("caOutput", ca.applyValue(getDatabaseCaResult -> getDatabaseCaResult.certificate()));
}
}
variables:
ca:
fn::invoke:
Function: digitalocean:getDatabaseCa
Arguments:
clusterId: aaa-bbb-ccc-ddd
outputs:
caOutput: ${ca.certificate}
Using getDatabaseCa
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 getDatabaseCa(args: GetDatabaseCaArgs, opts?: InvokeOptions): Promise<GetDatabaseCaResult>
function getDatabaseCaOutput(args: GetDatabaseCaOutputArgs, opts?: InvokeOptions): Output<GetDatabaseCaResult>
def get_database_ca(cluster_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseCaResult
def get_database_ca_output(cluster_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseCaResult]
func GetDatabaseCa(ctx *Context, args *GetDatabaseCaArgs, opts ...InvokeOption) (*GetDatabaseCaResult, error)
func GetDatabaseCaOutput(ctx *Context, args *GetDatabaseCaOutputArgs, opts ...InvokeOption) GetDatabaseCaResultOutput
> Note: This function is named GetDatabaseCa
in the Go SDK.
public static class GetDatabaseCa
{
public static Task<GetDatabaseCaResult> InvokeAsync(GetDatabaseCaArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseCaResult> Invoke(GetDatabaseCaInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabaseCaResult> getDatabaseCa(GetDatabaseCaArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: digitalocean:index/getDatabaseCa:getDatabaseCa
arguments:
# arguments dictionary
The following arguments are supported:
- Cluster
Id string - The ID of the source database cluster.
- Cluster
Id string - The ID of the source database cluster.
- cluster
Id String - The ID of the source database cluster.
- cluster
Id string - The ID of the source database cluster.
- cluster_
id str - The ID of the source database cluster.
- cluster
Id String - The ID of the source database cluster.
getDatabaseCa Result
The following output properties are available:
- Certificate string
- The CA certificate used to secure database connections decoded to a string.
- Cluster
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Certificate string
- The CA certificate used to secure database connections decoded to a string.
- Cluster
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- certificate String
- The CA certificate used to secure database connections decoded to a string.
- cluster
Id String - id String
- The provider-assigned unique ID for this managed resource.
- certificate string
- The CA certificate used to secure database connections decoded to a string.
- cluster
Id string - id string
- The provider-assigned unique ID for this managed resource.
- certificate str
- The CA certificate used to secure database connections decoded to a string.
- cluster_
id str - id str
- The provider-assigned unique ID for this managed resource.
- certificate String
- The CA certificate used to secure database connections decoded to a string.
- cluster
Id String - id String
- The provider-assigned unique ID for this managed resource.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.