blue_green_deployments
Creates, updates, deletes, gets or lists a blue_green_deployments resource.
Overview
| Name | blue_green_deployments |
| Type | Resource |
| Id | aws.rds.blue_green_deployments |
Fields
The following fields are returned by SELECT queries:
- describe_blue_green_deployments
| Name | Datatype | Description |
|---|---|---|
blue_green_deployment_identifier | string | The unique identifier of the blue/green deployment. |
blue_green_deployment_name | string | The user-supplied name of the blue/green deployment. |
create_time | string | The time when the blue/green deployment was created, in Universal Coordinated Time (UTC). |
delete_time | string | The time when the blue/green deployment was deleted, in Universal Coordinated Time (UTC). |
source | string | The source database for the blue/green deployment. Before switchover, the source database is the production database in the blue environment. |
status | string | The status of the blue/green deployment. Valid Values: PROVISIONING - Resources are being created in the green environment. AVAILABLE - Resources are available in the green environment. SWITCHOVER_IN_PROGRESS - The deployment is being switched from the blue environment to the green environment. SWITCHOVER_COMPLETED - Switchover from the blue environment to the green environment is complete. INVALID_CONFIGURATION - Resources in the green environment are invalid, so switchover isn't possible. SWITCHOVER_FAILED - Switchover was attempted but failed. DELETING - The blue/green deployment is being deleted. |
status_details | string | Additional information about the status of the blue/green deployment. |
switchover_details | string | The details about each source and target resource in the blue/green deployment. |
tag_list | string | A list of tags. For more information, see Tagging Amazon RDS resources in the Amazon RDS User Guide or Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide. |
target | string | The target database for the blue/green deployment. Before switchover, the target database is the clone database in the green environment. |
tasks | string | Either tasks to be performed or tasks that have been completed on the target database before switchover. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_blue_green_deployments | select | region | BlueGreenDeploymentIdentifier, Filters, Marker, MaxRecords | Describes one or more blue/green deployments. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide. |
create_blue_green_deployment | insert | BlueGreenDeploymentName, region | Source, TargetEngineVersion, TargetDBParameterGroupName, TargetDBClusterParameterGroupName, Tags, TargetDBInstanceClass, UpgradeTargetStorageConfig, TargetIops, TargetStorageType, TargetAllocatedStorage, TargetStorageThroughput | Creates a blue/green deployment. A blue/green deployment creates a staging environment that copies the production environment. In a blue/green deployment, the blue environment is the current production environment. The green environment is the staging environment, and it stays in sync with the current production environment. You can make changes to the databases in the green environment without affecting production workloads. For example, you can upgrade the major or minor DB engine version, change database parameters, or make schema changes in the staging environment. You can thoroughly test changes in the green environment. When ready, you can switch over the environments to promote the green environment to be the new production environment. The switchover typically takes under a minute. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide. |
delete_blue_green_deployment | delete | BlueGreenDeploymentIdentifier, region | DeleteTarget | Deletes a blue/green deployment. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide. |
switchover_blue_green_deployment | exec | BlueGreenDeploymentIdentifier, region | SwitchoverTimeout | Switches over a blue/green deployment. Before you switch over, production traffic is routed to the databases in the blue environment. After you switch over, production traffic is routed to the databases in the green environment. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide. |
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 |
|---|---|---|
BlueGreenDeploymentIdentifier | string | The resource ID of the blue/green deployment. Constraints: Must match an existing blue/green deployment resource ID. |
BlueGreenDeploymentName | string | The name of the blue/green deployment. Constraints: Can't be the same as an existing blue/green deployment name in the same account and Amazon Web Services Region. |
region | string | AWS region (default: us-east-1) |
BlueGreenDeploymentIdentifier | string | The blue/green deployment identifier. If you specify this parameter, the response only includes information about the specific blue/green deployment. This parameter isn't case-sensitive. Constraints: Must match an existing blue/green deployment identifier. |
DeleteTarget | boolean | Specifies whether to delete the resources in the green environment. You can't specify this option if the blue/green deployment status is SWITCHOVER_COMPLETED. |
Filters | array | A filter that specifies one or more blue/green deployments to describe. Valid Values: blue-green-deployment-identifier - Accepts system-generated identifiers for blue/green deployments. The results list only includes information about the blue/green deployments with the specified identifiers. blue-green-deployment-name - Accepts user-supplied names for blue/green deployments. The results list only includes information about the blue/green deployments with the specified names. source - Accepts source databases for a blue/green deployment. The results list only includes information about the blue/green deployments with the specified source databases. target - Accepts target databases for a blue/green deployment. The results list only includes information about the blue/green deployments with the specified target databases. |
Marker | string | An optional pagination token provided by a previous DescribeBlueGreenDeployments request. If you specify this parameter, the response only includes records beyond the marker, up to the value specified by MaxRecords. |
MaxRecords | integer | The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so you can retrieve the remaining results. Default: 100 Constraints: Must be a minimum of 20. Can't exceed 100. |
Source | string | The Amazon Resource Name (ARN) of the source production database. Specify the database that you want to clone. The blue/green deployment creates this database in the green environment. You can make updates to the database in the green environment, such as an engine version upgrade. When you are ready, you can switch the database in the green environment to be the production database. |
SwitchoverTimeout | integer | The amount of time, in seconds, for the switchover to complete. Default: 300 If the switchover takes longer than the specified duration, then any changes are rolled back, and no changes are made to the environments. |
Tags | array | Tags to assign to the blue/green deployment. |
TargetAllocatedStorage | integer | The amount of storage in gibibytes (GiB) to allocate for the green DB instance. You can choose to increase or decrease the allocated storage on the green DB instance. This setting doesn't apply to Amazon Aurora blue/green deployments. |
TargetDBClusterParameterGroupName | string | The DB cluster parameter group associated with the Aurora DB cluster in the green environment. To test parameter changes, specify a DB cluster parameter group that is different from the one associated with the source DB cluster. |
TargetDBInstanceClass | string | Specify the DB instance class for the databases in the green environment. This parameter only applies to RDS DB instances, because DB instances within an Aurora DB cluster can have multiple different instance classes. If you're creating a blue/green deployment from an Aurora DB cluster, don't specify this parameter. After the green environment is created, you can individually modify the instance classes of the DB instances within the green DB cluster. |
TargetDBParameterGroupName | string | The DB parameter group associated with the DB instance in the green environment. To test parameter changes, specify a DB parameter group that is different from the one associated with the source DB instance. |
TargetEngineVersion | string | The engine version of the database in the green environment. Specify the engine version to upgrade to in the green environment. |
TargetIops | integer | The amount of Provisioned IOPS (input/output operations per second) to allocate for the green DB instance. For information about valid IOPS values, see Amazon RDS DB instance storage in the Amazon RDS User Guide. This setting doesn't apply to Amazon Aurora blue/green deployments. |
TargetStorageThroughput | integer | The storage throughput value for the green DB instance. This setting applies only to the gp3 storage type. This setting doesn't apply to Amazon Aurora blue/green deployments. |
TargetStorageType | string | The storage type to associate with the green DB instance. Valid Values: gp2 | gp3 | io1 | io2 This setting doesn't apply to Amazon Aurora blue/green deployments. |
UpgradeTargetStorageConfig | boolean | Whether to upgrade the storage file system configuration on the green database. This option migrates the green DB instance from the older 32-bit file system to the preferred configuration. For more information, see Upgrading the storage file system for a DB instance. |
SELECT examples
- describe_blue_green_deployments
Describes one or more blue/green deployments. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide.
SELECT
blue_green_deployment_identifier,
blue_green_deployment_name,
create_time,
delete_time,
source,
status,
status_details,
switchover_details,
tag_list,
target,
tasks
FROM aws.rds.blue_green_deployments
WHERE region = '{{ region }}' -- required
AND BlueGreenDeploymentIdentifier = '{{ BlueGreenDeploymentIdentifier }}'
AND Filters = '{{ Filters }}'
AND Marker = '{{ Marker }}'
AND MaxRecords = '{{ MaxRecords }}'
;
INSERT examples
- create_blue_green_deployment
- Manifest
Creates a blue/green deployment. A blue/green deployment creates a staging environment that copies the production environment. In a blue/green deployment, the blue environment is the current production environment. The green environment is the staging environment, and it stays in sync with the current production environment. You can make changes to the databases in the green environment without affecting production workloads. For example, you can upgrade the major or minor DB engine version, change database parameters, or make schema changes in the staging environment. You can thoroughly test changes in the green environment. When ready, you can switch over the environments to promote the green environment to be the new production environment. The switchover typically takes under a minute. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide.
INSERT INTO aws.rds.blue_green_deployments (
BlueGreenDeploymentName,
region,
Source,
TargetEngineVersion,
TargetDBParameterGroupName,
TargetDBClusterParameterGroupName,
Tags,
TargetDBInstanceClass,
UpgradeTargetStorageConfig,
TargetIops,
TargetStorageType,
TargetAllocatedStorage,
TargetStorageThroughput
)
SELECT
'{{ BlueGreenDeploymentName }}',
'{{ region }}',
'{{ Source }}',
'{{ TargetEngineVersion }}',
'{{ TargetDBParameterGroupName }}',
'{{ TargetDBClusterParameterGroupName }}',
'{{ Tags }}',
'{{ TargetDBInstanceClass }}',
'{{ UpgradeTargetStorageConfig }}',
'{{ TargetIops }}',
'{{ TargetStorageType }}',
'{{ TargetAllocatedStorage }}',
'{{ TargetStorageThroughput }}'
RETURNING
blue_green_deployment_identifier,
blue_green_deployment_name,
create_time,
delete_time,
source,
status,
status_details,
switchover_details,
tag_list,
target,
tasks
;
# Description fields are for documentation purposes
- name: blue_green_deployments
props:
- name: BlueGreenDeploymentName
value: "{{ BlueGreenDeploymentName }}"
description: Required parameter for the blue_green_deployments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the blue_green_deployments resource.
- name: Source
value: "{{ Source }}"
description: The Amazon Resource Name (ARN) of the source production database. Specify the database that you want to clone. The blue/green deployment creates this database in the green environment. You can make updates to the database in the green environment, such as an engine version upgrade. When you are ready, you can switch the database in the green environment to be the production database.
description: The Amazon Resource Name (ARN) of the source production database. Specify the database that you want to clone. The blue/green deployment creates this database in the green environment. You can make updates to the database in the green environment, such as an engine version upgrade. When you are ready, you can switch the database in the green environment to be the production database.
- name: TargetEngineVersion
value: "{{ TargetEngineVersion }}"
description: The engine version of the database in the green environment. Specify the engine version to upgrade to in the green environment.
description: The engine version of the database in the green environment. Specify the engine version to upgrade to in the green environment.
- name: TargetDBParameterGroupName
value: "{{ TargetDBParameterGroupName }}"
description: The DB parameter group associated with the DB instance in the green environment. To test parameter changes, specify a DB parameter group that is different from the one associated with the source DB instance.
description: The DB parameter group associated with the DB instance in the green environment. To test parameter changes, specify a DB parameter group that is different from the one associated with the source DB instance.
- name: TargetDBClusterParameterGroupName
value: "{{ TargetDBClusterParameterGroupName }}"
description: The DB cluster parameter group associated with the Aurora DB cluster in the green environment. To test parameter changes, specify a DB cluster parameter group that is different from the one associated with the source DB cluster.
description: The DB cluster parameter group associated with the Aurora DB cluster in the green environment. To test parameter changes, specify a DB cluster parameter group that is different from the one associated with the source DB cluster.
- name: Tags
value: "{{ Tags }}"
description: Tags to assign to the blue/green deployment.
description: Tags to assign to the blue/green deployment.
- name: TargetDBInstanceClass
value: "{{ TargetDBInstanceClass }}"
description: Specify the DB instance class for the databases in the green environment. This parameter only applies to RDS DB instances, because DB instances within an Aurora DB cluster can have multiple different instance classes. If you're creating a blue/green deployment from an Aurora DB cluster, don't specify this parameter. After the green environment is created, you can individually modify the instance classes of the DB instances within the green DB cluster.
description: Specify the DB instance class for the databases in the green environment. This parameter only applies to RDS DB instances, because DB instances within an Aurora DB cluster can have multiple different instance classes. If you're creating a blue/green deployment from an Aurora DB cluster, don't specify this parameter. After the green environment is created, you can individually modify the instance classes of the DB instances within the green DB cluster.
- name: UpgradeTargetStorageConfig
value: {{ UpgradeTargetStorageConfig }}
description: Whether to upgrade the storage file system configuration on the green database. This option migrates the green DB instance from the older 32-bit file system to the preferred configuration. For more information, see Upgrading the storage file system for a DB instance.
description: Whether to upgrade the storage file system configuration on the green database. This option migrates the green DB instance from the older 32-bit file system to the preferred configuration. For more information, see Upgrading the storage file system for a DB instance.
- name: TargetIops
value: {{ TargetIops }}
description: The amount of Provisioned IOPS (input/output operations per second) to allocate for the green DB instance. For information about valid IOPS values, see Amazon RDS DB instance storage in the Amazon RDS User Guide. This setting doesn't apply to Amazon Aurora blue/green deployments.
description: The amount of Provisioned IOPS (input/output operations per second) to allocate for the green DB instance. For information about valid IOPS values, see Amazon RDS DB instance storage in the Amazon RDS User Guide. This setting doesn't apply to Amazon Aurora blue/green deployments.
- name: TargetStorageType
value: "{{ TargetStorageType }}"
description: The storage type to associate with the green DB instance. Valid Values: gp2 | gp3 | io1 | io2 This setting doesn't apply to Amazon Aurora blue/green deployments.
description: The storage type to associate with the green DB instance. Valid Values: gp2 | gp3 | io1 | io2 This setting doesn't apply to Amazon Aurora blue/green deployments.
- name: TargetAllocatedStorage
value: {{ TargetAllocatedStorage }}
description: The amount of storage in gibibytes (GiB) to allocate for the green DB instance. You can choose to increase or decrease the allocated storage on the green DB instance. This setting doesn't apply to Amazon Aurora blue/green deployments.
description: The amount of storage in gibibytes (GiB) to allocate for the green DB instance. You can choose to increase or decrease the allocated storage on the green DB instance. This setting doesn't apply to Amazon Aurora blue/green deployments.
- name: TargetStorageThroughput
value: {{ TargetStorageThroughput }}
description: The storage throughput value for the green DB instance. This setting applies only to the gp3 storage type. This setting doesn't apply to Amazon Aurora blue/green deployments.
description: The storage throughput value for the green DB instance. This setting applies only to the gp3 storage type. This setting doesn't apply to Amazon Aurora blue/green deployments.
DELETE examples
- delete_blue_green_deployment
Deletes a blue/green deployment. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide.
DELETE FROM aws.rds.blue_green_deployments
WHERE BlueGreenDeploymentIdentifier = '{{ BlueGreenDeploymentIdentifier }}' --required
AND region = '{{ region }}' --required
AND DeleteTarget = '{{ DeleteTarget }}'
;
Lifecycle Methods
- switchover_blue_green_deployment
Switches over a blue/green deployment. Before you switch over, production traffic is routed to the databases in the blue environment. After you switch over, production traffic is routed to the databases in the green environment. For more information, see Using Amazon RDS Blue/Green Deployments for database updates in the Amazon RDS User Guide and Using Amazon RDS Blue/Green Deployments for database updates in the Amazon Aurora User Guide.
EXEC aws.rds.blue_green_deployments.switchover_blue_green_deployment
@BlueGreenDeploymentIdentifier='{{ BlueGreenDeploymentIdentifier }}' --required,
@region='{{ region }}' --required,
@SwitchoverTimeout='{{ SwitchoverTimeout }}'
;