Table: aws_drs_source_server - Query AWS Database Migration Service Source Server using SQL
The AWS Database Migration Service (DMS) Source Server is a component of AWS DMS that facilitates the migration of databases to AWS in a secure and efficient manner. It supports homogeneous migrations such as Oracle to Oracle, as well as heterogeneous migrations between different database platforms, such as Oracle to Amazon Aurora. The Source Server is the database instance from which the migration or replication tasks are initiated.
Table Usage Guide
The aws_drs_source_server
table in Steampipe provides you with information about source servers within AWS Database Migration Service (DMS). This table allows you, as a DevOps engineer, to query server-specific details, including server type, replication job status, associated replication tasks, and more. You can utilize this table to gather insights on source servers, such as server status, assigned replication tasks, and server configuration details. The schema outlines the various attributes of the source server for you, including the server ID, status, replication job details, and associated tags.
Examples
Basic Info
Explore the status of your last server launch and identify the source server details to understand the origin of your data. This can help in tracing data lineage or diagnosing issues related to specific server launches.
select arn, last_launch_result, source_server_id, titlefrom aws_drs_source_server;
select arn, last_launch_result, source_server_id, titlefrom aws_drs_source_server;
Get source cloud properties of all source servers
Explore the origin details of all source servers on your cloud platform. This information can be useful to understand the geographical distribution and account ownership of your servers, aiding in resource allocation and risk management strategies.
select arn, title, source_cloud_properties ->> 'OriginAccountID' as source_cloud_origin_account_id, source_cloud_properties ->> 'OriginAvailabilityZone' as source_cloud_origin_availability_zone, source_cloud_properties ->> 'OriginRegion' as source_cloud_origin_regionfrom aws_drs_source_server;
select arn, title, json_extract(source_cloud_properties, '$.OriginAccountID') as source_cloud_origin_account_id, json_extract( source_cloud_properties, '$.OriginAvailabilityZone' ) as source_cloud_origin_availability_zone, json_extract(source_cloud_properties, '$.OriginRegion') as source_cloud_origin_regionfrom aws_drs_source_server;
Get source properties of all source servers
This query helps you gain insights into the properties of all source servers, including CPU, disk details, network interfaces, RAM, and the recommended instance type. It's useful for understanding the capabilities of each server and for making informed decisions on server management and resource allocation.
select arn, title, source_properties ->> 'Cpus' as source_cpus, source_properties ->> 'Disks' as source_disks, source_properties -> 'IdentificationHints' ->> 'Hostname' as source_hostname, source_properties ->> 'NetworkInterfaces' as source_network_interfaces, source_properties -> 'Os' ->> 'FullString' as source_os, source_properties -> 'RamBytes' as source_ram_bytes, source_properties -> 'RecommendedInstanceType' as source_recommended_instance_type, source_properties -> 'LastUpdatedDateTime' as source_last_updated_date_timefrom aws_drs_source_server;
select arn, title, json_extract(source_properties, '$.Cpus') as source_cpus, json_extract(source_properties, '$.Disks') as source_disks, json_extract( source_properties, '$.IdentificationHints.Hostname' ) as source_hostname, json_extract(source_properties, '$.NetworkInterfaces') as source_network_interfaces, json_extract(source_properties, '$.Os.FullString') as source_os, json_extract(source_properties, '$.RamBytes') as source_ram_bytes, json_extract(source_properties, '$.RecommendedInstanceType') as source_recommended_instance_type, json_extract(source_properties, '$.LastUpdatedDateTime') as source_last_updated_date_timefrom aws_drs_source_server;
Get data replication info of all source servers
Explore the status of data replication across all source servers, identifying any errors and assessing when the next replication attempt will occur. This information can be crucial in ensuring data integrity and timely updates across your network.
select arn, title, data_replication_info -> 'DataReplicationInitiation' ->> 'StartDateTime' as data_replication_start_date_time, data_replication_info -> 'DataReplicationInitiation' ->> 'NextAttemptDateTime' as data_replication_next_attempt_date_time, data_replication_info ->> 'DataReplicationError' as data_replication_error, data_replication_info ->> 'DataReplicationState' as data_replication_state, data_replication_info ->> 'ReplicatedDisks' as data_replication_replicated_disksfrom aws_drs_source_server;
select arn, title, json_extract( data_replication_info, '$.DataReplicationInitiation.StartDateTime' ) as data_replication_start_date_time, json_extract( data_replication_info, '$.DataReplicationInitiation.NextAttemptDateTime' ) as data_replication_next_attempt_date_time, json_extract(data_replication_info, '$.DataReplicationError') as data_replication_error, json_extract(data_replication_info, '$.DataReplicationState') as data_replication_state, json_extract(data_replication_info, '$.ReplicatedDisks') as data_replication_replicated_disksfrom aws_drs_source_server;
Get launch configuration settings of all source servers
Explore the launch configuration settings of all source servers to understand their setup and configuration. This can help in assessing the current state of servers for auditing, troubleshooting, or planning purposes.
select arn, title, launch_configuration ->> 'Name' as launch_configuration_name, launch_configuration ->> 'CopyPrivateIp' as launch_configuration_copy_private_ip, launch_configuration ->> 'CopyTags' as launch_configuration_copy_tags, launch_configuration ->> 'Ec2LaunchTemplateID' as launch_configuration_ec2_launch_template_id, launch_configuration ->> 'LaunchDisposition' as launch_configuration_disposition, launch_configuration ->> 'TargetInstanceTypeRightSizingMethod' as launch_configuration_target_instance_type_right_sizing_method, launch_configuration -> 'Licensing' as launch_configuration_licensing, launch_configuration -> 'ResultMetadata' as launch_configuration_result_metadatafrom aws_drs_source_server;
select arn, title, json_extract(launch_configuration, '$.Name') as launch_configuration_name, json_extract(launch_configuration, '$.CopyPrivateIp') as launch_configuration_copy_private_ip, json_extract(launch_configuration, '$.CopyTags') as launch_configuration_copy_tags, json_extract(launch_configuration, '$.Ec2LaunchTemplateID') as launch_configuration_ec2_launch_template_id, json_extract(launch_configuration, '$.LaunchDisposition') as launch_configuration_disposition, json_extract( launch_configuration, '$.TargetInstanceTypeRightSizingMethod' ) as launch_configuration_target_instance_type_right_sizing_method, json_extract(launch_configuration, '$.Licensing') as launch_configuration_licensing, json_extract(launch_configuration, '$.ResultMetadata') as launch_configuration_result_metadatafrom aws_drs_source_server;
List source servers that failed last recovery launch
Identify instances where the last recovery launch of source servers was unsuccessful, which is crucial for troubleshooting and ensuring the robustness of the disaster recovery system.
select title, arn, last_launch_result, source_server_idfrom aws_drs_source_serverwhere last_launch_result = 'FAILED';
select title, arn, last_launch_result, source_server_idfrom aws_drs_source_serverwhere last_launch_result = 'FAILED';
List disconnected source servers
Identify instances where source servers have become disconnected. This is useful for troubleshooting and maintaining data integrity across your AWS infrastructure.
select title, arn, data_replication_info ->> 'DataReplicationState' as data_replication_state, data_replication_info ->> 'DataReplicationError' as data_replication_error, data_replication_info -> 'DataReplicationInitiation' ->> 'StartDateTime' as data_replication_start_date_time, data_replication_info -> 'DataReplicationInitiation' ->> 'NextAttemptDateTime' as data_replication_next_attempt_date_timefrom aws_drs_source_serverwhere data_replication_info ->> 'DataReplicationState' = 'DISCONNECTED';
select title, arn, json_extract(data_replication_info, '$.DataReplicationState') as data_replication_state, json_extract(data_replication_info, '$.DataReplicationError') as data_replication_error, json_extract( data_replication_info, '$.DataReplicationInitiation.StartDateTime' ) as data_replication_start_date_time, json_extract( data_replication_info, '$.DataReplicationInitiation.NextAttemptDateTime' ) as data_replication_next_attempt_date_timefrom aws_drs_source_serverwhere json_extract(data_replication_info, '$.DataReplicationState') = 'DISCONNECTED';
Schema for aws_drs_source_server
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
agent_version | text | The version of the DRS agent installed on the source server. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The ARN of the Source Server. | |
data_replication_info | jsonb | The Data Replication Info of the Source Server. | |
hardware_id | text | = | An ID that describes the hardware of the Source Server. This is either an EC2 instance id, a VMware uuid or a mac address. |
last_launch_result | text | The status of the last recovery launch of this Source Server. | |
launch_configuration | jsonb | The launch configuration settings of the source server. | |
life_cycle | jsonb | The lifecycle information of this Source Server. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
recovery_instance_id | text | The ID of the Recovery Instance associated with this Source Server. | |
region | text | The AWS Region in which the resource is located. | |
replication_direction | text | Replication direction of the Source Server. | |
reversed_direction_source_server_arn | text | For EC2-originated Source Servers which have been failed over and then failed back, this value will mean the ARN of the Source Server on the opposite replication direction. | |
source_cloud_properties | jsonb | Source cloud properties of the Source Server. | |
source_network_id | text | ID of the Source Network which is protecting this Source Server's network. | |
source_properties | jsonb | The source properties of the Source Server. | |
source_server_id | text | = | The ID of the Source Server. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
staging_account_id | text | = | The staging account ID that extended source servers belong to. |
staging_area | jsonb | The staging area of the source server. | |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_drs_source_server