aws_ddk_core.stages.AthenaSQLStage¶
- class aws_ddk_core.stages.AthenaSQLStage(*args: Any, **kwargs)¶
Class that represents a Athena SQL DDK DataStage.
- __init__(scope: constructs.Construct, id: str, environment_id: str, query_string: str, workgroup: Optional[str] = None, catalog_name: Optional[str] = None, database_name: Optional[str] = None, output_bucket_name: Optional[str] = None, output_object_key: Optional[str] = None, encryption_option: Optional[aws_cdk.aws_stepfunctions_tasks.EncryptionOption] = None, encryption_key: Optional[aws_cdk.aws_kms.Key] = None, state_machine_input: Optional[Dict[str, Any]] = None, additional_role_policy_statements: Optional[List[aws_cdk.aws_iam.PolicyStatement]] = None, state_machine_failed_executions_alarm_threshold: Optional[int] = 1, state_machine_failed_executions_alarm_evaluation_periods: Optional[int] = 1) None ¶
DDK Athena SQL stage.
Stage that contains a step function that execute Athena SQL query.
- Parameters
scope (Construct) – Scope within which this construct is defined
id (str) – Identifier of the stage
environment_id (str) – Identifier of the environment
query_string (str) – SQL query that will be started
workgroup (Optional[str]) – Workgroup name
catalog_name (Optional[str]) – Catalog name
database_name (Optional[str]) – Database name
output_bucket_name (Optional[str]) – Output S3 bucket name
output_object_key (Optional[str]) – Output S3 key
encryption_option (Optional[EncryptionOption]) – Encryption configuration
encryption_key (Optional[Key]) – Encryption KMS key
state_machine_input (Optional[Dict[str, Any]]) – Input of the state machine
additional_role_policy_statements (Optional[List[PolicyStatement]]) – Additional IAM policy statements to add to the state machine role
state_machine_failed_executions_alarm_threshold (Optional[int]) – The number of failed state machine executions before triggering CW alarm. Defaults to 1
state_machine_failed_executions_alarm_evaluation_periods (Optional[int]) – The number of periods over which data is compared to the specified threshold. Defaults to 1
Methods
__init__
(scope, id, environment_id, query_string)DDK Athena SQL stage.
add_alarm
(alarm_id, alarm_metric[, ...])Add a CloudWatch alarm for the Data Stage
build_state_machine
(id, environment_id, ...)Build state machine.
get_event_pattern
()Get output event pattern of the stage.
get_targets
()Get input targets of the stage.
is_construct
(x)Checks if
x
is a construct.to_string
()Returns a string representation of this construct.
Attributes
cloudwatch_alarms
List[Alarm] List of CloudWatch Alarms linked to the stage
node
The tree node.
state_machine
StateMachine The state machine