1. Packages
  2. RedisCloud
  3. API Docs
  4. getDatabase
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

rediscloud.getDatabase

Explore with Pulumi AI

Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

The Database data source allows access to the details of an existing database within your Redis Enterprise Cloud account.

Example Usage

The following example shows how to locate a single database within a Subscription. This example assumes the subscription only contains a single database.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rediscloud = Pulumi.Rediscloud;

return await Deployment.RunAsync(() => 
{
    var example = Rediscloud.GetDatabase.Invoke(new()
    {
        SubscriptionId = "1234",
    });

});
Copy
package main

import (
	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rediscloud.GetDatabase(ctx, &rediscloud.GetDatabaseArgs{
			SubscriptionId: "1234",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rediscloud.RediscloudFunctions;
import com.pulumi.rediscloud.inputs.GetDatabaseArgs;
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 example = RediscloudFunctions.getDatabase(GetDatabaseArgs.builder()
            .subscriptionId("1234")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as rediscloud from "@pulumi/rediscloud";

const example = rediscloud.getDatabase({
    subscriptionId: "1234",
});
Copy
import pulumi
import pulumi_rediscloud as rediscloud

example = rediscloud.get_database(subscription_id="1234")
Copy
variables:
  example:
    fn::invoke:
      Function: rediscloud:getDatabase
      Arguments:
        subscriptionId: '1234'
Copy

The following example shows how to use the name to locate a single database within a subscription that has multiple databases.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rediscloud = Pulumi.Rediscloud;

return await Deployment.RunAsync(() => 
{
    var example = Rediscloud.GetDatabase.Invoke(new()
    {
        Name = "first-database",
        SubscriptionId = "1234",
    });

});
Copy
package main

import (
	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rediscloud.GetDatabase(ctx, &rediscloud.GetDatabaseArgs{
			Name:           pulumi.StringRef("first-database"),
			SubscriptionId: "1234",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rediscloud.RediscloudFunctions;
import com.pulumi.rediscloud.inputs.GetDatabaseArgs;
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 example = RediscloudFunctions.getDatabase(GetDatabaseArgs.builder()
            .name("first-database")
            .subscriptionId("1234")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as rediscloud from "@pulumi/rediscloud";

const example = rediscloud.getDatabase({
    name: "first-database",
    subscriptionId: "1234",
});
Copy
import pulumi
import pulumi_rediscloud as rediscloud

example = rediscloud.get_database(name="first-database",
    subscription_id="1234")
Copy
variables:
  example:
    fn::invoke:
      Function: rediscloud:getDatabase
      Arguments:
        name: first-database
        subscriptionId: '1234'
Copy

Using getDatabase

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 getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: InvokeOptions): Output<GetDatabaseResult>
Copy
def get_database(name: Optional[str] = None,
                 protocol: Optional[str] = None,
                 region: Optional[str] = None,
                 subscription_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
def get_database_output(name: Optional[pulumi.Input[str]] = None,
                 protocol: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 subscription_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
Copy
func GetDatabase(ctx *Context, args *GetDatabaseArgs, opts ...InvokeOption) (*GetDatabaseResult, error)
func GetDatabaseOutput(ctx *Context, args *GetDatabaseOutputArgs, opts ...InvokeOption) GetDatabaseResultOutput
Copy

> Note: This function is named GetDatabase in the Go SDK.

public static class GetDatabase 
{
    public static Task<GetDatabaseResult> InvokeAsync(GetDatabaseArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseResult> Invoke(GetDatabaseInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
public static Output<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: rediscloud:index/getDatabase:getDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

SubscriptionId This property is required. string
ID of the subscription that the database belongs to
Name string
The name of the database to filter returned databases
Protocol string
The protocol of the database to filter returned databases
Region string
The region of the database to filter returned databases
SubscriptionId This property is required. string
ID of the subscription that the database belongs to
Name string
The name of the database to filter returned databases
Protocol string
The protocol of the database to filter returned databases
Region string
The region of the database to filter returned databases
subscriptionId This property is required. String
ID of the subscription that the database belongs to
name String
The name of the database to filter returned databases
protocol String
The protocol of the database to filter returned databases
region String
The region of the database to filter returned databases
subscriptionId This property is required. string
ID of the subscription that the database belongs to
name string
The name of the database to filter returned databases
protocol string
The protocol of the database to filter returned databases
region string
The region of the database to filter returned databases
subscription_id This property is required. str
ID of the subscription that the database belongs to
name str
The name of the database to filter returned databases
protocol str
The protocol of the database to filter returned databases
region str
The region of the database to filter returned databases
subscriptionId This property is required. String
ID of the subscription that the database belongs to
name String
The name of the database to filter returned databases
protocol String
The protocol of the database to filter returned databases
region String
The region of the database to filter returned databases

getDatabase Result

The following output properties are available:

Alerts List<RedisLabs.Rediscloud.Outputs.GetDatabaseAlert>
Set of alerts to enable on the database, documented below.
DataEviction string
The data items eviction policy.
DataPersistence string
The rate of database data persistence (in persistent storage).
HashingPolicies List<string>
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
Id string
The provider-assigned unique ID for this managed resource.
MemoryLimitInGb double
The maximum memory usage for the database.
Modules List<RedisLabs.Rediscloud.Outputs.GetDatabaseModule>
Name string
The alert name
Password string
The password used to access the database - not present on memcached protocol databases.
PrivateEndpoint string
Private endpoint to access the database
Protocol string
The protocol of the database.
PublicEndpoint string
Public endpoint to access the database
Region string
ReplicaOfs List<string>
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
Replication bool
Database replication.
SubscriptionId string
SupportOssClusterApi bool
Supports the Redis open-source (OSS) Cluster API.
ThroughputMeasurementBy string
The throughput measurement method.
ThroughputMeasurementValue int
The throughput value.
Alerts []GetDatabaseAlert
Set of alerts to enable on the database, documented below.
DataEviction string
The data items eviction policy.
DataPersistence string
The rate of database data persistence (in persistent storage).
HashingPolicies []string
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
Id string
The provider-assigned unique ID for this managed resource.
MemoryLimitInGb float64
The maximum memory usage for the database.
Modules []GetDatabaseModule
Name string
The alert name
Password string
The password used to access the database - not present on memcached protocol databases.
PrivateEndpoint string
Private endpoint to access the database
Protocol string
The protocol of the database.
PublicEndpoint string
Public endpoint to access the database
Region string
ReplicaOfs []string
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
Replication bool
Database replication.
SubscriptionId string
SupportOssClusterApi bool
Supports the Redis open-source (OSS) Cluster API.
ThroughputMeasurementBy string
The throughput measurement method.
ThroughputMeasurementValue int
The throughput value.
alerts List<GetDatabaseAlert>
Set of alerts to enable on the database, documented below.
dataEviction String
The data items eviction policy.
dataPersistence String
The rate of database data persistence (in persistent storage).
hashingPolicies List<String>
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
id String
The provider-assigned unique ID for this managed resource.
memoryLimitInGb Double
The maximum memory usage for the database.
modules List<GetDatabaseModule>
name String
The alert name
password String
The password used to access the database - not present on memcached protocol databases.
privateEndpoint String
Private endpoint to access the database
protocol String
The protocol of the database.
publicEndpoint String
Public endpoint to access the database
region String
replicaOfs List<String>
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
replication Boolean
Database replication.
subscriptionId String
supportOssClusterApi Boolean
Supports the Redis open-source (OSS) Cluster API.
throughputMeasurementBy String
The throughput measurement method.
throughputMeasurementValue Integer
The throughput value.
alerts GetDatabaseAlert[]
Set of alerts to enable on the database, documented below.
dataEviction string
The data items eviction policy.
dataPersistence string
The rate of database data persistence (in persistent storage).
hashingPolicies string[]
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
id string
The provider-assigned unique ID for this managed resource.
memoryLimitInGb number
The maximum memory usage for the database.
modules GetDatabaseModule[]
name string
The alert name
password string
The password used to access the database - not present on memcached protocol databases.
privateEndpoint string
Private endpoint to access the database
protocol string
The protocol of the database.
publicEndpoint string
Public endpoint to access the database
region string
replicaOfs string[]
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
replication boolean
Database replication.
subscriptionId string
supportOssClusterApi boolean
Supports the Redis open-source (OSS) Cluster API.
throughputMeasurementBy string
The throughput measurement method.
throughputMeasurementValue number
The throughput value.
alerts Sequence[GetDatabaseAlert]
Set of alerts to enable on the database, documented below.
data_eviction str
The data items eviction policy.
data_persistence str
The rate of database data persistence (in persistent storage).
hashing_policies Sequence[str]
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
id str
The provider-assigned unique ID for this managed resource.
memory_limit_in_gb float
The maximum memory usage for the database.
modules Sequence[GetDatabaseModule]
name str
The alert name
password str
The password used to access the database - not present on memcached protocol databases.
private_endpoint str
Private endpoint to access the database
protocol str
The protocol of the database.
public_endpoint str
Public endpoint to access the database
region str
replica_ofs Sequence[str]
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
replication bool
Database replication.
subscription_id str
support_oss_cluster_api bool
Supports the Redis open-source (OSS) Cluster API.
throughput_measurement_by str
The throughput measurement method.
throughput_measurement_value int
The throughput value.
alerts List<Property Map>
Set of alerts to enable on the database, documented below.
dataEviction String
The data items eviction policy.
dataPersistence String
The rate of database data persistence (in persistent storage).
hashingPolicies List<String>
The list of regular expression rules the database is sharded by. See the documentation on clustering for more information on the hashing policy.
id String
The provider-assigned unique ID for this managed resource.
memoryLimitInGb Number
The maximum memory usage for the database.
modules List<Property Map>
name String
The alert name
password String
The password used to access the database - not present on memcached protocol databases.
privateEndpoint String
Private endpoint to access the database
protocol String
The protocol of the database.
publicEndpoint String
Public endpoint to access the database
region String
replicaOfs List<String>
The set of Redis database URIs, in the format redis://user:password@host:port, that this database will be a replica of.
replication Boolean
Database replication.
subscriptionId String
supportOssClusterApi Boolean
Supports the Redis open-source (OSS) Cluster API.
throughputMeasurementBy String
The throughput measurement method.
throughputMeasurementValue Number
The throughput value.

Supporting Types

GetDatabaseAlert

Name This property is required. string
The name of the database to filter returned databases
Value This property is required. int
The alert value
Name This property is required. string
The name of the database to filter returned databases
Value This property is required. int
The alert value
name This property is required. String
The name of the database to filter returned databases
value This property is required. Integer
The alert value
name This property is required. string
The name of the database to filter returned databases
value This property is required. number
The alert value
name This property is required. str
The name of the database to filter returned databases
value This property is required. int
The alert value
name This property is required. String
The name of the database to filter returned databases
value This property is required. Number
The alert value

GetDatabaseModule

Name This property is required. string
The name of the database to filter returned databases
Name This property is required. string
The name of the database to filter returned databases
name This property is required. String
The name of the database to filter returned databases
name This property is required. string
The name of the database to filter returned databases
name This property is required. str
The name of the database to filter returned databases
name This property is required. String
The name of the database to filter returned databases

Package Details

Repository
rediscloud RedisLabs/pulumi-rediscloud
License
Apache-2.0
Notes
This Pulumi package is based on the rediscloud Terraform Provider.
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs