steampipe plugin install aws

Table: aws_drs_recovery_instance - Query AWS Disaster Recovery Service Recovery Instances using SQL

The AWS Disaster Recovery Service Recovery Instance is a component of the AWS Disaster Recovery Service, which aids in the recovery of applications and data in the event of a disaster. It allows for the rapid recovery of your IT infrastructure and data by utilizing AWS's robust, scalable, and secure global infrastructure. This service supports recovery scenarios ranging from small customer workload data loss to a complete site outage.

Table Usage Guide

The aws_drs_recovery_instance table in Steampipe provides you with information about recovery instances within AWS Disaster Recovery Service (DRS). This table allows you, as a DevOps engineer, to query recovery instance-specific details, including instance type, recovery instance ARN, and associated tags. You can utilize this table to gather insights on recovery instances, such as instance type, recovery instance ARN, and associated tags. The schema outlines the various attributes of the recovery instance for you, including the instance type, recovery instance ARN, and associated tags.

Examples

Basic Info

Uncover the details of AWS Disaster Recovery Service's recovery instances, such as their current state and associated EC2 instances. This can be useful for maintaining an overview of your disaster recovery setup and ensuring everything is functioning as expected.

select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
ec2_instance_state
from
aws_drs_recovery_instance;
select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
ec2_instance_state
from
aws_drs_recovery_instance;

Get recovery instance properties of each recovery instance

Explore the characteristics of each recovery instance, such as CPU usage, disk activity, identification hints, update time, network interfaces, operating system, and RAM usage. This can help in assessing the performance and resource usage of each instance, aiding in efficient resource management and troubleshooting.

select
recovery_instance_id arn,
recovery_instance_properties ->> 'Cpus' as recovery_instance_cpus,
recovery_instance_properties ->> 'Disks' as recovery_instance_disks,
recovery_instance_properties ->> 'IdentificationHints' as recovery_instance_identification_hints,
recovery_instance_properties ->> 'LastUpdatedDateTime' as recovery_instance_last_updated_date_time,
recovery_instance_properties ->> 'NetworkInterfaces' as recovery_instance_network_interfaces,
recovery_instance_properties ->> 'Os' as recovery_instance_os,
recovery_instance_properties ->> 'RamBytes' as recovery_instance_ram_bytes
from
aws_drs_recovery_instance;
select
recovery_instance_id,
arn,
json_extract(recovery_instance_properties, '$.Cpus') as recovery_instance_cpus,
json_extract(recovery_instance_properties, '$.Disks') as recovery_instance_disks,
json_extract(
recovery_instance_properties,
'$.IdentificationHints'
) as recovery_instance_identification_hints,
json_extract(
recovery_instance_properties,
'$.LastUpdatedDateTime'
) as recovery_instance_last_updated_date_time,
json_extract(
recovery_instance_properties,
'$.NetworkInterfaces'
) as recovery_instance_network_interfaces,
json_extract(recovery_instance_properties, '$.Os') as recovery_instance_os,
json_extract(recovery_instance_properties, '$.RamBytes') as recovery_instance_ram_bytes
from
aws_drs_recovery_instance;

Get failback details of each recovery instance

Determine the status and details of each recovery instance's failback process in your AWS Disaster Recovery Service. This allows you to understand the progress and potential issues in your data recovery efforts.

select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
failback ->> 'AgentLastSeenByServiceDateTime' as agent_last_seen_by_service_date_time,
failback ->> 'ElapsedReplicationDuration' as elapsed_replication_duration,
failback ->> 'FailbackClientID' as failback_client_id,
failback ->> 'FailbackClientLastSeenByServiceDateTime' as failback_client_last_seen_by_service_date_time,
failback ->> 'FailbackInitiationTime' as failback_initiation_time,
failback -> 'FailbackJobID' as failback_job_id,
failback -> 'FailbackLaunchType' as failback_launch_type,
failback -> 'FailbackToOriginalServer' as failback_to_original_server,
failback -> 'FirstByteDateTime' as failback_first_byte_date_time,
failback -> 'State' as failback_state
from
aws_drs_recovery_instance;
select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
json_extract(failback, '$.AgentLastSeenByServiceDateTime') as agent_last_seen_by_service_date_time,
json_extract(failback, '$.ElapsedReplicationDuration') as elapsed_replication_duration,
json_extract(failback, '$.FailbackClientID') as failback_client_id,
json_extract(
failback,
'$.FailbackClientLastSeenByServiceDateTime'
) as failback_client_last_seen_by_service_date_time,
json_extract(failback, '$.FailbackInitiationTime') as failback_initiation_time,
json_extract(failback, '$.FailbackJobID') as failback_job_id,
json_extract(failback, '$.FailbackLaunchType') as failback_launch_type,
json_extract(failback, '$.FailbackToOriginalServer') as failback_to_original_server,
json_extract(failback, '$.FirstByteDateTime') as failback_first_byte_date_time,
json_extract(failback, '$.State') as failback_state
from
aws_drs_recovery_instance;

Get data replication info of each recovery instance

Determine the areas in which data replication is occurring within each recovery instance. This can help assess the status and health of your data recovery operations, and identify any potential issues or delays in the replication process.

select
recovery_instance_id,
arn,
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_disks
from
aws_drs_recovery_instance;
select
recovery_instance_id,
arn,
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_disks
from
aws_drs_recovery_instance;

List recovery instances that are created for an actual recovery event

Determine the instances created for actual recovery events, allowing you to focus on real-time disaster recovery efforts rather than drills or tests. This is beneficial in tracking and managing genuine recovery instances for efficient resource allocation and response.

select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
ec2_instance_state,
is_drill,
job_id
from
aws_drs_recovery_instance
where
not is_drill;
select
recovery_instance_id,
arn,
source_server_id,
ec2_instance_id,
ec2_instance_state,
is_drill,
job_id
from
aws_drs_recovery_instance
where
is_drill = 0;

Schema for aws_drs_recovery_instance

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe ARN of the recovery instance.
data_replication_infojsonbThe Data Replication Info of the recovery instance.
ec2_instance_idtextThe EC2 instance ID of the recovery instance.
ec2_instance_statetextThe state of the EC2 instance for this recovery instance.
failbackjsonbAn object representing failback related information of the recovery instance.
is_drillbooleanWhether this recovery instance was created for a drill or for an actual recovery event.
job_idtextThe ID of the Job that created the recovery instance.
origin_environmenttextEnvironment (On Premises/AWS) of the instance that the recovery instance originated from.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
point_in_time_snapshot_date_timetextThe date and time of the Point in Time (PIT) snapshot that this recovery instance was launched from.
recovery_instance_idtext=The ID of the recovery instance.
recovery_instance_propertiesjsonbProperties of the recovery instance machine.
regiontextThe AWS Region in which the resource is located.
source_server_idtext=The source server ID that this recovery instance is associated with.
tagsjsonbA map of tags for the resource.
titletextTitle 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_recovery_instance