instance_sql_ha_history_states
Creates, updates, deletes, gets or lists an instance_sql_ha_history_states resource.
Overview
| Name | instance_sql_ha_history_states |
| Type | Resource |
| Id | aws.ec2.instance_sql_ha_history_states |
Fields
The following fields are returned by SELECT queries:
- describe_instance_sql_ha_history_states
| Name | Datatype | Description |
|---|---|---|
ha_status | string | The SQL Server High Availability status of the instance. Valid values are: processing - The SQL Server High Availability status for the SQL Server High Availability instance is being updated. active - The SQL Server High Availability instance is an active node in an SQL Server High Availability cluster. standby - The SQL Server High Availability instance is a standby failover node in an SQL Server High Availability cluster. invalid - An error occurred due to misconfigured permissions, or unable to dertemine SQL Server High Availability status for the SQL Server High Availability instance. |
instance_id | string | The ID of the SQL Server High Availability instance. |
last_updated_time | string | The date and time when the instance's SQL Server High Availability status was last updated, in the ISO 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ). |
processing_status | string | A brief description of the SQL Server High Availability status. If the instance is in the invalid High Availability status, this parameter includes the error message. |
sql_server_credentials | string | The ARN of the Secrets Manager secret containing the SQL Server access credentials for the SQL Server High Availability instance. If not specified, deafult local user credentials will be used by the Amazon Web Services Systems Manager agent. |
sql_server_license_usage | string | The license type for the SQL Server license. Valid values include: full - The SQL Server High Availability instance is using a full SQL Server license. waived - The SQL Server High Availability instance is waived from the SQL Server license. |
tags | string | The tags assigned to the SQL Server High Availability instance. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_instance_sql_ha_history_states | select | region | InstanceId, StartTime, EndTime, NextToken, MaxResults, Filter, DryRun | Describes the historical SQL Server High Availability states for Amazon EC2 instances that are enabled for Amazon EC2 High Availability for SQL Server monitoring. |
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) |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
EndTime | string (date-time) | The end data and time of the period for which to get historical SQL Server High Availability states. If omitted, the API returns historical states up to the current date and time. Timezone: UTC Format: YYYY-MM-DDThh:mm:ss.sssZ |
Filter | array | One or more filters to apply to the results. Supported filters include: tag:<key> - The tag key and value pair assigned to the instance. For example, to find all instances tagged with Owner:TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The tag key assigned to the instance. haStatus - The SQL Server High Availability status of the SQL Server High Availability instance (processing | active | standby | invalid). sqlServerLicenseUsage - The license type for the SQL Server license (full | waived). |
InstanceId | array | The IDs of the SQL Server High Availability instances to describe. If omitted, the API returns historical states for all SQL Server High Availability instances. |
MaxResults | integer | The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. |
NextToken | string | The token to use to retrieve the next page of results. |
StartTime | string (date-time) | The start data and time of the period for which to get the historical SQL Server High Availability states. If omitted, the API returns all available historical states. Timezone: UTC Format: YYYY-MM-DDThh:mm:ss.sssZ |
SELECT examples
- describe_instance_sql_ha_history_states
Describes the historical SQL Server High Availability states for Amazon EC2 instances that are enabled for Amazon EC2 High Availability for SQL Server monitoring.
SELECT
ha_status,
instance_id,
last_updated_time,
processing_status,
sql_server_credentials,
sql_server_license_usage,
tags
FROM aws.ec2.instance_sql_ha_history_states
WHERE region = '{{ region }}' -- required
AND InstanceId = '{{ InstanceId }}'
AND StartTime = '{{ StartTime }}'
AND EndTime = '{{ EndTime }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
;