source_networks
Creates, updates, deletes, gets or lists a source_networks resource.
Overview
| Name | source_networks |
| Type | Resource |
| Id | aws.drs.source_networks |
Fields
The following fields are returned by SELECT queries:
- describe_source_networks
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the Source Network. (pattern: <code>arn:.{16,2044}</code>) |
cfn_stack_name | string | CloudFormation stack name that was deployed for recovering the Source Network. (pattern: <code>[a-zA-Z][-a-zA-Z0-9]*</code>) |
last_recovery | object | An object containing information regarding the last recovery of the Source Network. |
launched_vpc_id | string | ID of the recovered VPC following Source Network recovery. (pattern: <code>vpc-[0-9a-fA-F]{8,}</code>) |
replication_status | string | Status of Source Network Replication. Possible values: (a) STOPPED - Source Network is not replicating. (b) IN_PROGRESS - Source Network is being replicated. (c) PROTECTED - Source Network was replicated successfully and is being synchronized for changes. (d) ERROR - Source Network replication has failed (STOPPED, IN_PROGRESS, PROTECTED, ERROR) |
replication_status_details | string | Error details in case Source Network replication status is ERROR. |
source_account_id | string | Account ID containing the VPC protected by the Source Network. (pattern: <code>.[0-9]{12,}.</code>) |
source_network_id | string | Source Network ID. (pattern: <code>sn-[0-9a-zA-Z]{17}</code>) |
source_region | string | Region containing the VPC protected by the Source Network. (pattern: <code>(us(-gov)?|ap|ca|cn|eu|eusc|sa|af|me|mx|il)-([a-z]{2}-)?(central|north|(north(?:east|west))|south|south(?:east|west)|east|west)-[0-9]</code>) |
source_vpc_id | string | VPC ID protected by the Source Network. (pattern: <code>vpc-[0-9a-fA-F]{8,}</code>) |
tags | object | A list of tags associated with the Source Network. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_source_networks | select | region | Lists all Source Networks or multiple Source Networks filtered by ID. | |
create_source_network | insert | region, vpcID, originAccountID, originRegion | Create a new Source Network resource for a provided VPC ID. | |
associate_source_network_stack | update | region, sourceNetworkID, cfnStackName | Associate a Source Network to an existing CloudFormation Stack and modify launch templates to use this network. Can be used for reverting to previously deployed CloudFormation stacks. | |
delete_source_network | delete | region | Delete Source Network resource. | |
export_source_network_cfn_template | exec | region, sourceNetworkID | Export the Source Network CloudFormation template to an S3 bucket. | |
start_source_network_recovery | exec | region, sourceNetworks | Deploy VPC for the specified Source Network and modify launch templates to use this network. The VPC will be deployed using a dedicated CloudFormation stack. | |
start_source_network_replication | exec | region, sourceNetworkID | Starts replication for a Source Network. This action would make the Source Network protected. | |
stop_source_network_replication | exec | region, sourceNetworkID | Stops replication for a Source Network. This action would make the Source Network unprotected. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_source_networks
Lists all Source Networks or multiple Source Networks filtered by ID.
SELECT
arn,
cfn_stack_name,
last_recovery,
launched_vpc_id,
replication_status,
replication_status_details,
source_account_id,
source_network_id,
source_region,
source_vpc_id,
tags
FROM aws.drs.source_networks
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_source_network
- Manifest
Create a new Source Network resource for a provided VPC ID.
INSERT INTO aws.drs.source_networks (
vpcID,
originAccountID,
originRegion,
tags,
region
)
SELECT
'{{ vpcID }}' /* required */,
'{{ originAccountID }}' /* required */,
'{{ originRegion }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
source_network_id
;
# Description fields are for documentation purposes
- name: source_networks
props:
- name: region
value: "{{ region }}"
description: Required parameter for the source_networks resource.
- name: vpcID
value: "{{ vpcID }}"
- name: originAccountID
value: "{{ originAccountID }}"
- name: originRegion
value: "{{ originRegion }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- associate_source_network_stack
Associate a Source Network to an existing CloudFormation Stack and modify launch templates to use this network. Can be used for reverting to previously deployed CloudFormation stacks.
UPDATE aws.drs.source_networks
SET
sourceNetworkID = '{{ sourceNetworkID }}',
cfnStackName = '{{ cfnStackName }}'
WHERE
region = '{{ region }}' --required
AND sourceNetworkID = '{{ sourceNetworkID }}' --required
AND cfnStackName = '{{ cfnStackName }}' --required
RETURNING
job;
DELETE examples
- delete_source_network
Delete Source Network resource.
DELETE FROM aws.drs.source_networks
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- export_source_network_cfn_template
- start_source_network_recovery
- start_source_network_replication
- stop_source_network_replication
Export the Source Network CloudFormation template to an S3 bucket.
EXEC aws.drs.source_networks.export_source_network_cfn_template
@region='{{ region }}' --required
@@json=
'{
"sourceNetworkID": "{{ sourceNetworkID }}"
}'
;
Deploy VPC for the specified Source Network and modify launch templates to use this network. The VPC will be deployed using a dedicated CloudFormation stack.
EXEC aws.drs.source_networks.start_source_network_recovery
@region='{{ region }}' --required
@@json=
'{
"sourceNetworks": "{{ sourceNetworks }}",
"deployAsNew": {{ deployAsNew }},
"tags": "{{ tags }}"
}'
;
Starts replication for a Source Network. This action would make the Source Network protected.
EXEC aws.drs.source_networks.start_source_network_replication
@region='{{ region }}' --required
@@json=
'{
"sourceNetworkID": "{{ sourceNetworkID }}"
}'
;
Stops replication for a Source Network. This action would make the Source Network unprotected.
EXEC aws.drs.source_networks.stop_source_network_replication
@region='{{ region }}' --required
@@json=
'{
"sourceNetworkID": "{{ sourceNetworkID }}"
}'
;