rediscloud.getDatabase
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",
    });
});
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
	})
}
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());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as rediscloud from "@pulumi/rediscloud";
const example = rediscloud.getDatabase({
    subscriptionId: "1234",
});
import pulumi
import pulumi_rediscloud as rediscloud
example = rediscloud.get_database(subscription_id="1234")
variables:
  example:
    fn::invoke:
      Function: rediscloud:getDatabase
      Arguments:
        subscriptionId: '1234'
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",
    });
});
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
	})
}
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());
    }
}
import * as pulumi from "@pulumi/pulumi";
import * as rediscloud from "@pulumi/rediscloud";
const example = rediscloud.getDatabase({
    name: "first-database",
    subscriptionId: "1234",
});
import pulumi
import pulumi_rediscloud as rediscloud
example = rediscloud.get_database(name="first-database",
    subscription_id="1234")
variables:
  example:
    fn::invoke:
      Function: rediscloud:getDatabase
      Arguments:
        name: first-database
        subscriptionId: '1234'
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>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]func GetDatabase(ctx *Context, args *GetDatabaseArgs, opts ...InvokeOption) (*GetDatabaseResult, error)
func GetDatabaseOutput(ctx *Context, args *GetDatabaseOutputArgs, opts ...InvokeOption) GetDatabaseResultOutput> 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)
}public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
public static Output<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
fn::invoke:
  function: rediscloud:index/getDatabase:getDatabase
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SubscriptionId 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 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 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 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 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 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. Get Database Alert> 
- 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.
- MemoryLimit doubleIn Gb 
- The maximum memory usage for the database.
- Modules
List<RedisLabs. Rediscloud. Outputs. Get Database Module> 
- Name string
- The alert name
- Password string
- The password used to access the database - not present on memcachedprotocol 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
- SupportOss boolCluster Api 
- Supports the Redis open-source (OSS) Cluster API.
- ThroughputMeasurement stringBy 
- The throughput measurement method.
- ThroughputMeasurement intValue 
- The throughput value.
- Alerts
[]GetDatabase Alert 
- 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.
- MemoryLimit float64In Gb 
- The maximum memory usage for the database.
- Modules
[]GetDatabase Module 
- Name string
- The alert name
- Password string
- The password used to access the database - not present on memcachedprotocol 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
- SupportOss boolCluster Api 
- Supports the Redis open-source (OSS) Cluster API.
- ThroughputMeasurement stringBy 
- The throughput measurement method.
- ThroughputMeasurement intValue 
- The throughput value.
- alerts
List<GetDatabase Alert> 
- 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.
- memoryLimit DoubleIn Gb 
- The maximum memory usage for the database.
- modules
List<GetDatabase Module> 
- name String
- The alert name
- password String
- The password used to access the database - not present on memcachedprotocol 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
- supportOss BooleanCluster Api 
- Supports the Redis open-source (OSS) Cluster API.
- throughputMeasurement StringBy 
- The throughput measurement method.
- throughputMeasurement IntegerValue 
- The throughput value.
- alerts
GetDatabase Alert[] 
- 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.
- memoryLimit numberIn Gb 
- The maximum memory usage for the database.
- modules
GetDatabase Module[] 
- name string
- The alert name
- password string
- The password used to access the database - not present on memcachedprotocol 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
- supportOss booleanCluster Api 
- Supports the Redis open-source (OSS) Cluster API.
- throughputMeasurement stringBy 
- The throughput measurement method.
- throughputMeasurement numberValue 
- The throughput value.
- alerts
Sequence[GetDatabase Alert] 
- 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_ floatin_ gb 
- The maximum memory usage for the database.
- modules
Sequence[GetDatabase Module] 
- name str
- The alert name
- password str
- The password used to access the database - not present on memcachedprotocol 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_ boolcluster_ api 
- Supports the Redis open-source (OSS) Cluster API.
- throughput_measurement_ strby 
- The throughput measurement method.
- throughput_measurement_ intvalue 
- 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.
- memoryLimit NumberIn Gb 
- 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 memcachedprotocol 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
- supportOss BooleanCluster Api 
- Supports the Redis open-source (OSS) Cluster API.
- throughputMeasurement StringBy 
- The throughput measurement method.
- throughputMeasurement NumberValue 
- The throughput value.
Supporting Types
GetDatabaseAlert  
GetDatabaseModule  
- Name string
- The name of the database to filter returned databases
- Name string
- The name of the database to filter returned databases
- name String
- The name of the database to filter returned databases
- name string
- The name of the database to filter returned databases
- name str
- The name of the database to filter returned databases
- name 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 rediscloudTerraform Provider.
