Provides a DigitalOcean database logsink resource allowing you to forward logs from a managed database cluster to an external OpenSearch cluster or Elasticsearch endpoint.
This resource is compatible with both OpenSearch and Elasticsearch endpoints due to API compatibility. You can use this resource to connect to either service.
This resource supports the following DigitalOcean managed database engines:
- PostgreSQL
- MySQL
- Kafka
- Valkey
Note: MongoDB databases use a different log forwarding mechanism and require Datadog logsinks (not currently available in this provider).
Example Usage
Basic OpenSearch configuration
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
name: "example-postgres-cluster",
engine: "pg",
version: "15",
size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
region: digitalocean.Region.NYC1,
nodeCount: 1,
});
const example = new digitalocean.DatabaseLogsinkOpensearch("example", {
clusterId: postgres_example.id,
name: "opensearch-logs",
endpoint: "https://opensearch.example.com:9200",
indexPrefix: "db-logs",
indexDaysMax: 7,
});
import pulumi
import pulumi_digitalocean as digitalocean
postgres_example = digitalocean.DatabaseCluster("postgres-example",
name="example-postgres-cluster",
engine="pg",
version="15",
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
region=digitalocean.Region.NYC1,
node_count=1)
example = digitalocean.DatabaseLogsinkOpensearch("example",
cluster_id=postgres_example.id,
name="opensearch-logs",
endpoint="https://opensearch.example.com:9200",
index_prefix="db-logs",
index_days_max=7)
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 {
postgres_example, err := digitalocean.NewDatabaseCluster(ctx, "postgres-example", &digitalocean.DatabaseClusterArgs{
Name: pulumi.String("example-postgres-cluster"),
Engine: pulumi.String("pg"),
Version: pulumi.String("15"),
Size: pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
Region: pulumi.String(digitalocean.RegionNYC1),
NodeCount: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = digitalocean.NewDatabaseLogsinkOpensearch(ctx, "example", &digitalocean.DatabaseLogsinkOpensearchArgs{
ClusterId: postgres_example.ID(),
Name: pulumi.String("opensearch-logs"),
Endpoint: pulumi.String("https://opensearch.example.com:9200"),
IndexPrefix: pulumi.String("db-logs"),
IndexDaysMax: pulumi.Int(7),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new()
{
Name = "example-postgres-cluster",
Engine = "pg",
Version = "15",
Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
Region = DigitalOcean.Region.NYC1,
NodeCount = 1,
});
var example = new DigitalOcean.DatabaseLogsinkOpensearch("example", new()
{
ClusterId = postgres_example.Id,
Name = "opensearch-logs",
Endpoint = "https://opensearch.example.com:9200",
IndexPrefix = "db-logs",
IndexDaysMax = 7,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearch;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearchArgs;
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 postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()
.name("example-postgres-cluster")
.engine("pg")
.version("15")
.size("db-s-1vcpu-1gb")
.region("nyc1")
.nodeCount(1)
.build());
var example = new DatabaseLogsinkOpensearch("example", DatabaseLogsinkOpensearchArgs.builder()
.clusterId(postgres_example.id())
.name("opensearch-logs")
.endpoint("https://opensearch.example.com:9200")
.indexPrefix("db-logs")
.indexDaysMax(7)
.build());
}
}
resources:
example:
type: digitalocean:DatabaseLogsinkOpensearch
properties:
clusterId: ${["postgres-example"].id}
name: opensearch-logs
endpoint: https://opensearch.example.com:9200
indexPrefix: db-logs
indexDaysMax: 7
postgres-example:
type: digitalocean:DatabaseCluster
properties:
name: example-postgres-cluster
engine: pg
version: '15'
size: db-s-1vcpu-1gb
region: nyc1
nodeCount: 1
OpenSearch with authentication and CA certificate
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
import * as std from "@pulumi/std";
const example_secure = new digitalocean.DatabaseLogsinkOpensearch("example-secure", {
clusterId: postgres_example.id,
name: "opensearch-secure",
endpoint: "https://user:password@opensearch.example.com:9200",
indexPrefix: "secure-logs",
indexDaysMax: 14,
caCert: std.file({
input: "/path/to/ca.pem",
}).then(invoke => invoke.result),
timeoutSeconds: 30,
});
import pulumi
import pulumi_digitalocean as digitalocean
import pulumi_std as std
example_secure = digitalocean.DatabaseLogsinkOpensearch("example-secure",
cluster_id=postgres_example["id"],
name="opensearch-secure",
endpoint="https://user:password@opensearch.example.com:9200",
index_prefix="secure-logs",
index_days_max=14,
ca_cert=std.file(input="/path/to/ca.pem").result,
timeout_seconds=30)
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "/path/to/ca.pem",
}, nil)
if err != nil {
return err
}
_, err = digitalocean.NewDatabaseLogsinkOpensearch(ctx, "example-secure", &digitalocean.DatabaseLogsinkOpensearchArgs{
ClusterId: pulumi.Any(postgres_example.Id),
Name: pulumi.String("opensearch-secure"),
Endpoint: pulumi.String("https://user:password@opensearch.example.com:9200"),
IndexPrefix: pulumi.String("secure-logs"),
IndexDaysMax: pulumi.Int(14),
CaCert: pulumi.String(invokeFile.Result),
TimeoutSeconds: pulumi.Int(30),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example_secure = new DigitalOcean.DatabaseLogsinkOpensearch("example-secure", new()
{
ClusterId = postgres_example.Id,
Name = "opensearch-secure",
Endpoint = "https://user:password@opensearch.example.com:9200",
IndexPrefix = "secure-logs",
IndexDaysMax = 14,
CaCert = Std.File.Invoke(new()
{
Input = "/path/to/ca.pem",
}).Apply(invoke => invoke.Result),
TimeoutSeconds = 30,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearch;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearchArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FileArgs;
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 example_secure = new DatabaseLogsinkOpensearch("example-secure", DatabaseLogsinkOpensearchArgs.builder()
.clusterId(postgres_example.id())
.name("opensearch-secure")
.endpoint("https://user:password@opensearch.example.com:9200")
.indexPrefix("secure-logs")
.indexDaysMax(14)
.caCert(StdFunctions.file(FileArgs.builder()
.input("/path/to/ca.pem")
.build()).result())
.timeoutSeconds(30)
.build());
}
}
resources:
example-secure:
type: digitalocean:DatabaseLogsinkOpensearch
properties:
clusterId: ${["postgres-example"].id}
name: opensearch-secure
endpoint: https://user:password@opensearch.example.com:9200
indexPrefix: secure-logs
indexDaysMax: 14
caCert:
fn::invoke:
function: std:file
arguments:
input: /path/to/ca.pem
return: result
timeoutSeconds: 30
Elasticsearch endpoint configuration
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const elasticsearch = new digitalocean.DatabaseLogsinkOpensearch("elasticsearch", {
clusterId: postgres_example.id,
name: "elasticsearch-logs",
endpoint: "https://elasticsearch.example.com:9243",
indexPrefix: "es-logs",
indexDaysMax: 30,
});
import pulumi
import pulumi_digitalocean as digitalocean
elasticsearch = digitalocean.DatabaseLogsinkOpensearch("elasticsearch",
cluster_id=postgres_example["id"],
name="elasticsearch-logs",
endpoint="https://elasticsearch.example.com:9243",
index_prefix="es-logs",
index_days_max=30)
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 {
_, err := digitalocean.NewDatabaseLogsinkOpensearch(ctx, "elasticsearch", &digitalocean.DatabaseLogsinkOpensearchArgs{
ClusterId: pulumi.Any(postgres_example.Id),
Name: pulumi.String("elasticsearch-logs"),
Endpoint: pulumi.String("https://elasticsearch.example.com:9243"),
IndexPrefix: pulumi.String("es-logs"),
IndexDaysMax: pulumi.Int(30),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var elasticsearch = new DigitalOcean.DatabaseLogsinkOpensearch("elasticsearch", new()
{
ClusterId = postgres_example.Id,
Name = "elasticsearch-logs",
Endpoint = "https://elasticsearch.example.com:9243",
IndexPrefix = "es-logs",
IndexDaysMax = 30,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearch;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearchArgs;
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 elasticsearch = new DatabaseLogsinkOpensearch("elasticsearch", DatabaseLogsinkOpensearchArgs.builder()
.clusterId(postgres_example.id())
.name("elasticsearch-logs")
.endpoint("https://elasticsearch.example.com:9243")
.indexPrefix("es-logs")
.indexDaysMax(30)
.build());
}
}
resources:
elasticsearch:
type: digitalocean:DatabaseLogsinkOpensearch
properties:
clusterId: ${["postgres-example"].id}
name: elasticsearch-logs
endpoint: https://elasticsearch.example.com:9243
indexPrefix: es-logs
indexDaysMax: 30
MySQL to OpenSearch configuration
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const mysql_example = new digitalocean.DatabaseCluster("mysql-example", {
name: "example-mysql-cluster",
engine: "mysql",
version: "8",
size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
region: digitalocean.Region.NYC1,
nodeCount: 1,
});
const mysql = new digitalocean.DatabaseLogsinkOpensearch("mysql", {
clusterId: mysql_example.id,
name: "mysql-logs",
endpoint: "https://opensearch.example.com:9200",
indexPrefix: "mysql-logs",
indexDaysMax: 7,
});
import pulumi
import pulumi_digitalocean as digitalocean
mysql_example = digitalocean.DatabaseCluster("mysql-example",
name="example-mysql-cluster",
engine="mysql",
version="8",
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
region=digitalocean.Region.NYC1,
node_count=1)
mysql = digitalocean.DatabaseLogsinkOpensearch("mysql",
cluster_id=mysql_example.id,
name="mysql-logs",
endpoint="https://opensearch.example.com:9200",
index_prefix="mysql-logs",
index_days_max=7)
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 {
mysql_example, err := digitalocean.NewDatabaseCluster(ctx, "mysql-example", &digitalocean.DatabaseClusterArgs{
Name: pulumi.String("example-mysql-cluster"),
Engine: pulumi.String("mysql"),
Version: pulumi.String("8"),
Size: pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
Region: pulumi.String(digitalocean.RegionNYC1),
NodeCount: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = digitalocean.NewDatabaseLogsinkOpensearch(ctx, "mysql", &digitalocean.DatabaseLogsinkOpensearchArgs{
ClusterId: mysql_example.ID(),
Name: pulumi.String("mysql-logs"),
Endpoint: pulumi.String("https://opensearch.example.com:9200"),
IndexPrefix: pulumi.String("mysql-logs"),
IndexDaysMax: pulumi.Int(7),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var mysql_example = new DigitalOcean.DatabaseCluster("mysql-example", new()
{
Name = "example-mysql-cluster",
Engine = "mysql",
Version = "8",
Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
Region = DigitalOcean.Region.NYC1,
NodeCount = 1,
});
var mysql = new DigitalOcean.DatabaseLogsinkOpensearch("mysql", new()
{
ClusterId = mysql_example.Id,
Name = "mysql-logs",
Endpoint = "https://opensearch.example.com:9200",
IndexPrefix = "mysql-logs",
IndexDaysMax = 7,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearch;
import com.pulumi.digitalocean.DatabaseLogsinkOpensearchArgs;
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 mysql_example = new DatabaseCluster("mysql-example", DatabaseClusterArgs.builder()
.name("example-mysql-cluster")
.engine("mysql")
.version("8")
.size("db-s-1vcpu-1gb")
.region("nyc1")
.nodeCount(1)
.build());
var mysql = new DatabaseLogsinkOpensearch("mysql", DatabaseLogsinkOpensearchArgs.builder()
.clusterId(mysql_example.id())
.name("mysql-logs")
.endpoint("https://opensearch.example.com:9200")
.indexPrefix("mysql-logs")
.indexDaysMax(7)
.build());
}
}
resources:
mysql:
type: digitalocean:DatabaseLogsinkOpensearch
properties:
clusterId: ${["mysql-example"].id}
name: mysql-logs
endpoint: https://opensearch.example.com:9200
indexPrefix: mysql-logs
indexDaysMax: 7
mysql-example:
type: digitalocean:DatabaseCluster
properties:
name: example-mysql-cluster
engine: mysql
version: '8'
size: db-s-1vcpu-1gb
region: nyc1
nodeCount: 1
Create DatabaseLogsinkOpensearch Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseLogsinkOpensearch(name: string, args: DatabaseLogsinkOpensearchArgs, opts?: CustomResourceOptions);@overload
def DatabaseLogsinkOpensearch(resource_name: str,
args: DatabaseLogsinkOpensearchArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseLogsinkOpensearch(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
endpoint: Optional[str] = None,
index_prefix: Optional[str] = None,
ca_cert: Optional[str] = None,
index_days_max: Optional[int] = None,
name: Optional[str] = None,
timeout_seconds: Optional[int] = None)func NewDatabaseLogsinkOpensearch(ctx *Context, name string, args DatabaseLogsinkOpensearchArgs, opts ...ResourceOption) (*DatabaseLogsinkOpensearch, error)public DatabaseLogsinkOpensearch(string name, DatabaseLogsinkOpensearchArgs args, CustomResourceOptions? opts = null)
public DatabaseLogsinkOpensearch(String name, DatabaseLogsinkOpensearchArgs args)
public DatabaseLogsinkOpensearch(String name, DatabaseLogsinkOpensearchArgs args, CustomResourceOptions options)
type: digitalocean:DatabaseLogsinkOpensearch
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 DatabaseLogsinkOpensearchArgs
- 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 DatabaseLogsinkOpensearchArgs
- 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 DatabaseLogsinkOpensearchArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseLogsinkOpensearchArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseLogsinkOpensearchArgs
- 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 databaseLogsinkOpensearchResource = new DigitalOcean.DatabaseLogsinkOpensearch("databaseLogsinkOpensearchResource", new()
{
ClusterId = "string",
Endpoint = "string",
IndexPrefix = "string",
CaCert = "string",
IndexDaysMax = 0,
Name = "string",
TimeoutSeconds = 0,
});
example, err := digitalocean.NewDatabaseLogsinkOpensearch(ctx, "databaseLogsinkOpensearchResource", &digitalocean.DatabaseLogsinkOpensearchArgs{
ClusterId: pulumi.String("string"),
Endpoint: pulumi.String("string"),
IndexPrefix: pulumi.String("string"),
CaCert: pulumi.String("string"),
IndexDaysMax: pulumi.Int(0),
Name: pulumi.String("string"),
TimeoutSeconds: pulumi.Int(0),
})
var databaseLogsinkOpensearchResource = new DatabaseLogsinkOpensearch("databaseLogsinkOpensearchResource", DatabaseLogsinkOpensearchArgs.builder()
.clusterId("string")
.endpoint("string")
.indexPrefix("string")
.caCert("string")
.indexDaysMax(0)
.name("string")
.timeoutSeconds(0)
.build());
database_logsink_opensearch_resource = digitalocean.DatabaseLogsinkOpensearch("databaseLogsinkOpensearchResource",
cluster_id="string",
endpoint="string",
index_prefix="string",
ca_cert="string",
index_days_max=0,
name="string",
timeout_seconds=0)
const databaseLogsinkOpensearchResource = new digitalocean.DatabaseLogsinkOpensearch("databaseLogsinkOpensearchResource", {
clusterId: "string",
endpoint: "string",
indexPrefix: "string",
caCert: "string",
indexDaysMax: 0,
name: "string",
timeoutSeconds: 0,
});
type: digitalocean:DatabaseLogsinkOpensearch
properties:
caCert: string
clusterId: string
endpoint: string
indexDaysMax: 0
indexPrefix: string
name: string
timeoutSeconds: 0
DatabaseLogsinkOpensearch 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 DatabaseLogsinkOpensearch resource accepts the following input properties:
- Cluster
Id string - UUID of the source database cluster that will forward logs.
- Endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - Index
Prefix string - Prefix for the indices where logs will be stored.
- Ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - Index
Days intMax - Maximum number of days to retain indices. Must be 1 or greater.
- Name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- Timeout
Seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- Cluster
Id string - UUID of the source database cluster that will forward logs.
- Endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - Index
Prefix string - Prefix for the indices where logs will be stored.
- Ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - Index
Days intMax - Maximum number of days to retain indices. Must be 1 or greater.
- Name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- Timeout
Seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- cluster
Id String - UUID of the source database cluster that will forward logs.
- endpoint String
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Prefix String - Prefix for the indices where logs will be stored.
- ca
Cert String - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - index
Days IntegerMax - Maximum number of days to retain indices. Must be 1 or greater.
- name String
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds Integer - Request timeout for log deliveries in seconds. Must be 1 or greater.
- cluster
Id string - UUID of the source database cluster that will forward logs.
- endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Prefix string - Prefix for the indices where logs will be stored.
- ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - index
Days numberMax - Maximum number of days to retain indices. Must be 1 or greater.
- name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds number - Request timeout for log deliveries in seconds. Must be 1 or greater.
- cluster_
id str - UUID of the source database cluster that will forward logs.
- endpoint str
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index_
prefix str - Prefix for the indices where logs will be stored.
- ca_
cert str - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - index_
days_ intmax - Maximum number of days to retain indices. Must be 1 or greater.
- name str
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout_
seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- cluster
Id String - UUID of the source database cluster that will forward logs.
- endpoint String
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Prefix String - Prefix for the indices where logs will be stored.
- ca
Cert String - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - index
Days NumberMax - Maximum number of days to retain indices. Must be 1 or greater.
- name String
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds Number - Request timeout for log deliveries in seconds. Must be 1 or greater.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseLogsinkOpensearch resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- logsink_
id str - The unique identifier for the logsink as returned by the DigitalOcean API.
Look up Existing DatabaseLogsinkOpensearch Resource
Get an existing DatabaseLogsinkOpensearch 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?: DatabaseLogsinkOpensearchState, opts?: CustomResourceOptions): DatabaseLogsinkOpensearch@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ca_cert: Optional[str] = None,
cluster_id: Optional[str] = None,
endpoint: Optional[str] = None,
index_days_max: Optional[int] = None,
index_prefix: Optional[str] = None,
logsink_id: Optional[str] = None,
name: Optional[str] = None,
timeout_seconds: Optional[int] = None) -> DatabaseLogsinkOpensearchfunc GetDatabaseLogsinkOpensearch(ctx *Context, name string, id IDInput, state *DatabaseLogsinkOpensearchState, opts ...ResourceOption) (*DatabaseLogsinkOpensearch, error)public static DatabaseLogsinkOpensearch Get(string name, Input<string> id, DatabaseLogsinkOpensearchState? state, CustomResourceOptions? opts = null)public static DatabaseLogsinkOpensearch get(String name, Output<String> id, DatabaseLogsinkOpensearchState state, CustomResourceOptions options)resources: _: type: digitalocean:DatabaseLogsinkOpensearch get: 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.
- Ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - Cluster
Id string - UUID of the source database cluster that will forward logs.
- Endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - Index
Days intMax - Maximum number of days to retain indices. Must be 1 or greater.
- Index
Prefix string - Prefix for the indices where logs will be stored.
- Logsink
Id string - The unique identifier for the logsink as returned by the DigitalOcean API.
- Name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- Timeout
Seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- Ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - Cluster
Id string - UUID of the source database cluster that will forward logs.
- Endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - Index
Days intMax - Maximum number of days to retain indices. Must be 1 or greater.
- Index
Prefix string - Prefix for the indices where logs will be stored.
- Logsink
Id string - The unique identifier for the logsink as returned by the DigitalOcean API.
- Name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- Timeout
Seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- ca
Cert String - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - cluster
Id String - UUID of the source database cluster that will forward logs.
- endpoint String
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Days IntegerMax - Maximum number of days to retain indices. Must be 1 or greater.
- index
Prefix String - Prefix for the indices where logs will be stored.
- logsink
Id String - The unique identifier for the logsink as returned by the DigitalOcean API.
- name String
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds Integer - Request timeout for log deliveries in seconds. Must be 1 or greater.
- ca
Cert string - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - cluster
Id string - UUID of the source database cluster that will forward logs.
- endpoint string
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Days numberMax - Maximum number of days to retain indices. Must be 1 or greater.
- index
Prefix string - Prefix for the indices where logs will be stored.
- logsink
Id string - The unique identifier for the logsink as returned by the DigitalOcean API.
- name string
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds number - Request timeout for log deliveries in seconds. Must be 1 or greater.
- ca_
cert str - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - cluster_
id str - UUID of the source database cluster that will forward logs.
- endpoint str
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index_
days_ intmax - Maximum number of days to retain indices. Must be 1 or greater.
- index_
prefix str - Prefix for the indices where logs will be stored.
- logsink_
id str - The unique identifier for the logsink as returned by the DigitalOcean API.
- name str
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout_
seconds int - Request timeout for log deliveries in seconds. Must be 1 or greater.
- ca
Cert String - CA certificate for TLS verification in PEM format. Can be specified using
file()function. This field is marked as sensitive. - cluster
Id String - UUID of the source database cluster that will forward logs.
- endpoint String
- HTTPS URL to the OpenSearch or Elasticsearch cluster (e.g.,
https://host:port). Note: Only HTTPS URLs are supported. - index
Days NumberMax - Maximum number of days to retain indices. Must be 1 or greater.
- index
Prefix String - Prefix for the indices where logs will be stored.
- logsink
Id String - The unique identifier for the logsink as returned by the DigitalOcean API.
- name String
- Display name for the logsink. Note: This is immutable; changing it will force recreation of the resource.
- timeout
Seconds Number - Request timeout for log deliveries in seconds. Must be 1 or greater.
Import
ant Notes
Elasticsearch Compatibility
This resource works with both OpenSearch and Elasticsearch endpoints due to their API compatibility. Use the same resource type regardless of whether you’re connecting to OpenSearch or Elasticsearch.
Managed OpenSearch with Trusted Sources
When forwarding logs to a DigitalOcean Managed OpenSearch cluster with trusted sources enabled, you must manually allow-list the IP addresses of your database cluster nodes.
Authentication
Include authentication credentials directly in the endpoint URL using the format https://username:password@host:port. Alternatively, configure authentication on your OpenSearch/Elasticsearch cluster to accept connections from your database cluster’s IP addresses.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
