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: Optional[str] = None, query_string_path: Optional[str] = None, 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, state_machine_args: Optional[Dict[str, Any]] = {}, alarms_enabled: Optional[bool] = True) 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 (Optional[str]) – SQL query that will be started

  • query_string_path (Optional[str]) – dynamic path in statemachine for SQL query to 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

  • state_machine_args (Optional[Dict[str, Any]]) – Additional arguments to pass to State Machine creation. See: https://awslabs.github.io/aws-ddk/release/latest/api/core/stubs/aws_ddk_core.pipelines.StateMachineStage.html#aws_ddk_core.pipelines.StateMachineStage.build_state_machine # noqa

  • alarms_enabled (Optional[bool]) – Enable/Disable all alarms in the stage. Default - True

Methods

__init__(scope, id, environment_id[, ...])

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

get_targets() Optional[List[aws_cdk.aws_events.IRuleTarget]]

Get input targets of the stage.

Targets are used by Event Rules to describe what should be invoked when a rule matches an event.

Returns

targets – List of targets

Return type

Optional[List[IRuleTarget]]