AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

getInstance

Use this data source to get information about an RDS instance

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var database = Aws.Rds.GetInstance.Invoke(new()
    {
        DbInstanceIdentifier = "my-test-database",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/rds"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rds.LookupInstance(ctx, &rds.LookupInstanceArgs{
			DbInstanceIdentifier: "my-test-database",
		}, 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.aws.rds.RdsFunctions;
import com.pulumi.aws.connect.inputs.GetInstanceArgs;
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 database = RdsFunctions.getInstance(GetInstanceArgs.builder()
            .dbInstanceIdentifier("my-test-database")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

database = aws.rds.get_instance(db_instance_identifier="my-test-database")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const database = pulumi.output(aws.rds.getInstance({
    dbInstanceIdentifier: "my-test-database",
}));
variables:
  database:
    Fn::Invoke:
      Function: aws:rds:getInstance
      Arguments:
        dbInstanceIdentifier: my-test-database

Using getInstance

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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
def get_instance(db_instance_identifier: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(db_instance_identifier: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

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

public static class GetInstance 
{
    public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: aws:rds/getInstance:getInstance
  arguments:
    # arguments dictionary

The following arguments are supported:

DbInstanceIdentifier string

Name of the RDS instance

Tags Dictionary<string, string>
DbInstanceIdentifier string

Name of the RDS instance

Tags map[string]string
dbInstanceIdentifier String

Name of the RDS instance

tags Map<String,String>
dbInstanceIdentifier string

Name of the RDS instance

tags {[key: string]: string}
db_instance_identifier str

Name of the RDS instance

tags Mapping[str, str]
dbInstanceIdentifier String

Name of the RDS instance

tags Map<String>

getInstance Result

The following output properties are available:

Address string

Hostname of the RDS instance. See also endpoint and port.

AllocatedStorage int

Allocated storage size specified in gigabytes.

AutoMinorVersionUpgrade bool

Indicates that minor version patches are applied automatically.

AvailabilityZone string

Name of the Availability Zone the DB instance is located in.

BackupRetentionPeriod int

Specifies the number of days for which automatic DB snapshots are retained.

CaCertIdentifier string

Identifier of the CA certificate for the DB instance.

DbClusterIdentifier string

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

DbInstanceArn string

ARN for the DB instance.

DbInstanceClass string

Contains the name of the compute and memory capacity class of the DB instance.

DbInstanceIdentifier string
DbInstancePort int

Port that the DB instance listens on.

DbName string

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

DbParameterGroups List<string>

Provides the list of DB parameter groups applied to this DB instance.

DbSecurityGroups List<string>

Provides List of DB security groups associated to this DB instance.

DbSubnetGroup string

Name of the subnet group associated with the DB instance.

EnabledCloudwatchLogsExports List<string>

List of log types to export to cloudwatch.

Endpoint string

Connection endpoint in address:port format.

Engine string

Provides the name of the database engine to be used for this DB instance.

EngineVersion string

Database engine version.

HostedZoneId string

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

Id string

The provider-assigned unique ID for this managed resource.

Iops int

Provisioned IOPS (I/O operations per second) value.

KmsKeyId string

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

LicenseModel string

License model information for this DB instance.

MasterUsername string

Contains the master username for the DB instance.

MonitoringInterval int

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

MonitoringRoleArn string

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

MultiAz bool

If the DB instance is a Multi-AZ deployment.

NetworkType string

Network type of the DB instance.

OptionGroupMemberships List<string>

Provides the list of option group memberships for this DB instance.

Port int

Database port.

PreferredBackupWindow string

Specifies the daily time range during which automated backups are created.

PreferredMaintenanceWindow string

Specifies the weekly time range during which system maintenance can occur in UTC.

PubliclyAccessible bool

Accessibility options for the DB instance.

ReplicateSourceDb string

Identifier of the source DB that this is a replica of.

ResourceId string

RDS Resource ID of this instance.

StorageEncrypted bool

Whether the DB instance is encrypted.

StorageType string

Storage type associated with DB instance.

Tags Dictionary<string, string>
Timezone string

Time zone of the DB instance.

VpcSecurityGroups List<string>

Provides a list of VPC security group elements that the DB instance belongs to.

Address string

Hostname of the RDS instance. See also endpoint and port.

AllocatedStorage int

Allocated storage size specified in gigabytes.

AutoMinorVersionUpgrade bool

Indicates that minor version patches are applied automatically.

AvailabilityZone string

Name of the Availability Zone the DB instance is located in.

BackupRetentionPeriod int

Specifies the number of days for which automatic DB snapshots are retained.

CaCertIdentifier string

Identifier of the CA certificate for the DB instance.

DbClusterIdentifier string

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

DbInstanceArn string

ARN for the DB instance.

DbInstanceClass string

Contains the name of the compute and memory capacity class of the DB instance.

DbInstanceIdentifier string
DbInstancePort int

Port that the DB instance listens on.

DbName string

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

DbParameterGroups []string

Provides the list of DB parameter groups applied to this DB instance.

DbSecurityGroups []string

Provides List of DB security groups associated to this DB instance.

DbSubnetGroup string

Name of the subnet group associated with the DB instance.

EnabledCloudwatchLogsExports []string

List of log types to export to cloudwatch.

Endpoint string

Connection endpoint in address:port format.

Engine string

Provides the name of the database engine to be used for this DB instance.

EngineVersion string

Database engine version.

HostedZoneId string

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

Id string

The provider-assigned unique ID for this managed resource.

Iops int

Provisioned IOPS (I/O operations per second) value.

KmsKeyId string

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

LicenseModel string

License model information for this DB instance.

MasterUsername string

Contains the master username for the DB instance.

MonitoringInterval int

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

MonitoringRoleArn string

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

MultiAz bool

If the DB instance is a Multi-AZ deployment.

NetworkType string

Network type of the DB instance.

OptionGroupMemberships []string

Provides the list of option group memberships for this DB instance.

Port int

Database port.

PreferredBackupWindow string

Specifies the daily time range during which automated backups are created.

PreferredMaintenanceWindow string

Specifies the weekly time range during which system maintenance can occur in UTC.

PubliclyAccessible bool

Accessibility options for the DB instance.

ReplicateSourceDb string

Identifier of the source DB that this is a replica of.

ResourceId string

RDS Resource ID of this instance.

StorageEncrypted bool

Whether the DB instance is encrypted.

StorageType string

Storage type associated with DB instance.

Tags map[string]string
Timezone string

Time zone of the DB instance.

VpcSecurityGroups []string

Provides a list of VPC security group elements that the DB instance belongs to.

address String

Hostname of the RDS instance. See also endpoint and port.

allocatedStorage Integer

Allocated storage size specified in gigabytes.

autoMinorVersionUpgrade Boolean

Indicates that minor version patches are applied automatically.

availabilityZone String

Name of the Availability Zone the DB instance is located in.

backupRetentionPeriod Integer

Specifies the number of days for which automatic DB snapshots are retained.

caCertIdentifier String

Identifier of the CA certificate for the DB instance.

dbClusterIdentifier String

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

dbInstanceArn String

ARN for the DB instance.

dbInstanceClass String

Contains the name of the compute and memory capacity class of the DB instance.

dbInstanceIdentifier String
dbInstancePort Integer

Port that the DB instance listens on.

dbName String

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

dbParameterGroups List<String>

Provides the list of DB parameter groups applied to this DB instance.

dbSecurityGroups List<String>

Provides List of DB security groups associated to this DB instance.

dbSubnetGroup String

Name of the subnet group associated with the DB instance.

enabledCloudwatchLogsExports List<String>

List of log types to export to cloudwatch.

endpoint String

Connection endpoint in address:port format.

engine String

Provides the name of the database engine to be used for this DB instance.

engineVersion String

Database engine version.

hostedZoneId String

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

id String

The provider-assigned unique ID for this managed resource.

iops Integer

Provisioned IOPS (I/O operations per second) value.

kmsKeyId String

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

licenseModel String

License model information for this DB instance.

masterUsername String

Contains the master username for the DB instance.

monitoringInterval Integer

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

monitoringRoleArn String

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

multiAz Boolean

If the DB instance is a Multi-AZ deployment.

networkType String

Network type of the DB instance.

optionGroupMemberships List<String>

Provides the list of option group memberships for this DB instance.

port Integer

Database port.

preferredBackupWindow String

Specifies the daily time range during which automated backups are created.

preferredMaintenanceWindow String

Specifies the weekly time range during which system maintenance can occur in UTC.

publiclyAccessible Boolean

Accessibility options for the DB instance.

replicateSourceDb String

Identifier of the source DB that this is a replica of.

resourceId String

RDS Resource ID of this instance.

storageEncrypted Boolean

Whether the DB instance is encrypted.

storageType String

Storage type associated with DB instance.

tags Map<String,String>
timezone String

Time zone of the DB instance.

vpcSecurityGroups List<String>

Provides a list of VPC security group elements that the DB instance belongs to.

address string

Hostname of the RDS instance. See also endpoint and port.

allocatedStorage number

Allocated storage size specified in gigabytes.

autoMinorVersionUpgrade boolean

Indicates that minor version patches are applied automatically.

availabilityZone string

Name of the Availability Zone the DB instance is located in.

backupRetentionPeriod number

Specifies the number of days for which automatic DB snapshots are retained.

caCertIdentifier string

Identifier of the CA certificate for the DB instance.

dbClusterIdentifier string

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

dbInstanceArn string

ARN for the DB instance.

dbInstanceClass string

Contains the name of the compute and memory capacity class of the DB instance.

dbInstanceIdentifier string
dbInstancePort number

Port that the DB instance listens on.

dbName string

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

dbParameterGroups string[]

Provides the list of DB parameter groups applied to this DB instance.

dbSecurityGroups string[]

Provides List of DB security groups associated to this DB instance.

dbSubnetGroup string

Name of the subnet group associated with the DB instance.

enabledCloudwatchLogsExports string[]

List of log types to export to cloudwatch.

endpoint string

Connection endpoint in address:port format.

engine string

Provides the name of the database engine to be used for this DB instance.

engineVersion string

Database engine version.

hostedZoneId string

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

id string

The provider-assigned unique ID for this managed resource.

iops number

Provisioned IOPS (I/O operations per second) value.

kmsKeyId string

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

licenseModel string

License model information for this DB instance.

masterUsername string

Contains the master username for the DB instance.

monitoringInterval number

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

monitoringRoleArn string

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

multiAz boolean

If the DB instance is a Multi-AZ deployment.

networkType string

Network type of the DB instance.

optionGroupMemberships string[]

Provides the list of option group memberships for this DB instance.

port number

Database port.

preferredBackupWindow string

Specifies the daily time range during which automated backups are created.

preferredMaintenanceWindow string

Specifies the weekly time range during which system maintenance can occur in UTC.

publiclyAccessible boolean

Accessibility options for the DB instance.

replicateSourceDb string

Identifier of the source DB that this is a replica of.

resourceId string

RDS Resource ID of this instance.

storageEncrypted boolean

Whether the DB instance is encrypted.

storageType string

Storage type associated with DB instance.

tags {[key: string]: string}
timezone string

Time zone of the DB instance.

vpcSecurityGroups string[]

Provides a list of VPC security group elements that the DB instance belongs to.

address str

Hostname of the RDS instance. See also endpoint and port.

allocated_storage int

Allocated storage size specified in gigabytes.

auto_minor_version_upgrade bool

Indicates that minor version patches are applied automatically.

availability_zone str

Name of the Availability Zone the DB instance is located in.

backup_retention_period int

Specifies the number of days for which automatic DB snapshots are retained.

ca_cert_identifier str

Identifier of the CA certificate for the DB instance.

db_cluster_identifier str

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

db_instance_arn str

ARN for the DB instance.

db_instance_class str

Contains the name of the compute and memory capacity class of the DB instance.

db_instance_identifier str
db_instance_port int

Port that the DB instance listens on.

db_name str

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

db_parameter_groups Sequence[str]

Provides the list of DB parameter groups applied to this DB instance.

db_security_groups Sequence[str]

Provides List of DB security groups associated to this DB instance.

db_subnet_group str

Name of the subnet group associated with the DB instance.

enabled_cloudwatch_logs_exports Sequence[str]

List of log types to export to cloudwatch.

endpoint str

Connection endpoint in address:port format.

engine str

Provides the name of the database engine to be used for this DB instance.

engine_version str

Database engine version.

hosted_zone_id str

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

id str

The provider-assigned unique ID for this managed resource.

iops int

Provisioned IOPS (I/O operations per second) value.

kms_key_id str

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

license_model str

License model information for this DB instance.

master_username str

Contains the master username for the DB instance.

monitoring_interval int

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

monitoring_role_arn str

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

multi_az bool

If the DB instance is a Multi-AZ deployment.

network_type str

Network type of the DB instance.

option_group_memberships Sequence[str]

Provides the list of option group memberships for this DB instance.

port int

Database port.

preferred_backup_window str

Specifies the daily time range during which automated backups are created.

preferred_maintenance_window str

Specifies the weekly time range during which system maintenance can occur in UTC.

publicly_accessible bool

Accessibility options for the DB instance.

replicate_source_db str

Identifier of the source DB that this is a replica of.

resource_id str

RDS Resource ID of this instance.

storage_encrypted bool

Whether the DB instance is encrypted.

storage_type str

Storage type associated with DB instance.

tags Mapping[str, str]
timezone str

Time zone of the DB instance.

vpc_security_groups Sequence[str]

Provides a list of VPC security group elements that the DB instance belongs to.

address String

Hostname of the RDS instance. See also endpoint and port.

allocatedStorage Number

Allocated storage size specified in gigabytes.

autoMinorVersionUpgrade Boolean

Indicates that minor version patches are applied automatically.

availabilityZone String

Name of the Availability Zone the DB instance is located in.

backupRetentionPeriod Number

Specifies the number of days for which automatic DB snapshots are retained.

caCertIdentifier String

Identifier of the CA certificate for the DB instance.

dbClusterIdentifier String

If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.

dbInstanceArn String

ARN for the DB instance.

dbInstanceClass String

Contains the name of the compute and memory capacity class of the DB instance.

dbInstanceIdentifier String
dbInstancePort Number

Port that the DB instance listens on.

dbName String

Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.

dbParameterGroups List<String>

Provides the list of DB parameter groups applied to this DB instance.

dbSecurityGroups List<String>

Provides List of DB security groups associated to this DB instance.

dbSubnetGroup String

Name of the subnet group associated with the DB instance.

enabledCloudwatchLogsExports List<String>

List of log types to export to cloudwatch.

endpoint String

Connection endpoint in address:port format.

engine String

Provides the name of the database engine to be used for this DB instance.

engineVersion String

Database engine version.

hostedZoneId String

Canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record).

id String

The provider-assigned unique ID for this managed resource.

iops Number

Provisioned IOPS (I/O operations per second) value.

kmsKeyId String

If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance.

licenseModel String

License model information for this DB instance.

masterUsername String

Contains the master username for the DB instance.

monitoringInterval Number

Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

monitoringRoleArn String

ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.

multiAz Boolean

If the DB instance is a Multi-AZ deployment.

networkType String

Network type of the DB instance.

optionGroupMemberships List<String>

Provides the list of option group memberships for this DB instance.

port Number

Database port.

preferredBackupWindow String

Specifies the daily time range during which automated backups are created.

preferredMaintenanceWindow String

Specifies the weekly time range during which system maintenance can occur in UTC.

publiclyAccessible Boolean

Accessibility options for the DB instance.

replicateSourceDb String

Identifier of the source DB that this is a replica of.

resourceId String

RDS Resource ID of this instance.

storageEncrypted Boolean

Whether the DB instance is encrypted.

storageType String

Storage type associated with DB instance.

tags Map<String>
timezone String

Time zone of the DB instance.

vpcSecurityGroups List<String>

Provides a list of VPC security group elements that the DB instance belongs to.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.