CfnScheduledQueryProps

class aws_cdk.aws_timestream.CfnScheduledQueryProps(*, error_report_configuration, notification_configuration, query_string, schedule_configuration, scheduled_query_execution_role_arn, client_token=None, kms_key_id=None, scheduled_query_name=None, tags=None, target_configuration=None)

Bases: object

Properties for defining a CfnScheduledQuery.

Parameters
  • error_report_configuration (Union[ErrorReportConfigurationProperty, Dict[str, Any], IResolvable]) – Configuration for error reporting. Error reports will be generated when a problem is encountered when writing the query results.

  • notification_configuration (Union[IResolvable, NotificationConfigurationProperty, Dict[str, Any]]) – Notification configuration for the scheduled query. A notification is sent by Timestream when a query run finishes, when the state is updated or when you delete it.

  • query_string (str) – The query string to run. Parameter names can be specified in the query string @ character followed by an identifier. The named Parameter @scheduled_runtime is reserved and can be used in the query to get the time at which the query is scheduled to run. The timestamp calculated according to the ScheduleConfiguration parameter, will be the value of @scheduled_runtime paramater for each query run. For example, consider an instance of a scheduled query executing on 2021-12-01 00:00:00. For this instance, the @scheduled_runtime parameter is initialized to the timestamp 2021-12-01 00:00:00 when invoking the query.

  • schedule_configuration (Union[IResolvable, ScheduleConfigurationProperty, Dict[str, Any]]) – Schedule configuration.

  • scheduled_query_execution_role_arn (str) – The ARN for the IAM role that Timestream will assume when running the scheduled query.

  • client_token (Optional[str]) – Using a ClientToken makes the call to CreateScheduledQuery idempotent, in other words, making the same request repeatedly will produce the same result. Making multiple identical CreateScheduledQuery requests has the same effect as making a single request. - If CreateScheduledQuery is called without a ClientToken , the Query SDK generates a ClientToken on your behalf. - After 8 hours, any request with the same ClientToken is treated as a new request.

  • kms_key_id (Optional[str]) – The Amazon KMS key used to encrypt the scheduled query resource, at-rest. If the Amazon KMS key is not specified, the scheduled query resource will be encrypted with a Timestream owned Amazon KMS key. To specify a KMS key, use the key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix the name with alias/ If ErrorReportConfiguration uses SSE_KMS as encryption type, the same KmsKeyId is used to encrypt the error report at rest.

  • scheduled_query_name (Optional[str]) – A name for the query. Scheduled query names must be unique within each Region.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – A list of key-value pairs to label the scheduled query.

  • target_configuration (Union[IResolvable, TargetConfigurationProperty, Dict[str, Any], None]) – Scheduled query target store configuration.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_timestream as timestream

cfn_scheduled_query_props = timestream.CfnScheduledQueryProps(
    error_report_configuration=timestream.CfnScheduledQuery.ErrorReportConfigurationProperty(
        s3_configuration=timestream.CfnScheduledQuery.S3ConfigurationProperty(
            bucket_name="bucketName",

            # the properties below are optional
            encryption_option="encryptionOption",
            object_key_prefix="objectKeyPrefix"
        )
    ),
    notification_configuration=timestream.CfnScheduledQuery.NotificationConfigurationProperty(
        sns_configuration=timestream.CfnScheduledQuery.SnsConfigurationProperty(
            topic_arn="topicArn"
        )
    ),
    query_string="queryString",
    schedule_configuration=timestream.CfnScheduledQuery.ScheduleConfigurationProperty(
        schedule_expression="scheduleExpression"
    ),
    scheduled_query_execution_role_arn="scheduledQueryExecutionRoleArn",

    # the properties below are optional
    client_token="clientToken",
    kms_key_id="kmsKeyId",
    scheduled_query_name="scheduledQueryName",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    target_configuration=timestream.CfnScheduledQuery.TargetConfigurationProperty(
        timestream_configuration=timestream.CfnScheduledQuery.TimestreamConfigurationProperty(
            database_name="databaseName",
            dimension_mappings=[timestream.CfnScheduledQuery.DimensionMappingProperty(
                dimension_value_type="dimensionValueType",
                name="name"
            )],
            table_name="tableName",
            time_column="timeColumn",

            # the properties below are optional
            measure_name_column="measureNameColumn",
            mixed_measure_mappings=[timestream.CfnScheduledQuery.MixedMeasureMappingProperty(
                measure_value_type="measureValueType",

                # the properties below are optional
                measure_name="measureName",
                multi_measure_attribute_mappings=[timestream.CfnScheduledQuery.MultiMeasureAttributeMappingProperty(
                    measure_value_type="measureValueType",
                    source_column="sourceColumn",

                    # the properties below are optional
                    target_multi_measure_attribute_name="targetMultiMeasureAttributeName"
                )],
                source_column="sourceColumn",
                target_measure_name="targetMeasureName"
            )],
            multi_measure_mappings=timestream.CfnScheduledQuery.MultiMeasureMappingsProperty(
                multi_measure_attribute_mappings=[timestream.CfnScheduledQuery.MultiMeasureAttributeMappingProperty(
                    measure_value_type="measureValueType",
                    source_column="sourceColumn",

                    # the properties below are optional
                    target_multi_measure_attribute_name="targetMultiMeasureAttributeName"
                )],

                # the properties below are optional
                target_multi_measure_name="targetMultiMeasureName"
            )
        )
    )
)

Attributes

client_token

Using a ClientToken makes the call to CreateScheduledQuery idempotent, in other words, making the same request repeatedly will produce the same result.

Making multiple identical CreateScheduledQuery requests has the same effect as making a single request.

  • If CreateScheduledQuery is called without a ClientToken , the Query SDK generates a ClientToken on your behalf.

  • After 8 hours, any request with the same ClientToken is treated as a new request.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-clienttoken

Return type

Optional[str]

error_report_configuration

Configuration for error reporting.

Error reports will be generated when a problem is encountered when writing the query results.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-errorreportconfiguration

Return type

Union[ErrorReportConfigurationProperty, IResolvable]

kms_key_id

The Amazon KMS key used to encrypt the scheduled query resource, at-rest.

If the Amazon KMS key is not specified, the scheduled query resource will be encrypted with a Timestream owned Amazon KMS key. To specify a KMS key, use the key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix the name with alias/

If ErrorReportConfiguration uses SSE_KMS as encryption type, the same KmsKeyId is used to encrypt the error report at rest.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-kmskeyid

Return type

Optional[str]

notification_configuration

Notification configuration for the scheduled query.

A notification is sent by Timestream when a query run finishes, when the state is updated or when you delete it.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-notificationconfiguration

Return type

Union[IResolvable, NotificationConfigurationProperty]

query_string

The query string to run.

Parameter names can be specified in the query string @ character followed by an identifier. The named Parameter @scheduled_runtime is reserved and can be used in the query to get the time at which the query is scheduled to run.

The timestamp calculated according to the ScheduleConfiguration parameter, will be the value of @scheduled_runtime paramater for each query run. For example, consider an instance of a scheduled query executing on 2021-12-01 00:00:00. For this instance, the @scheduled_runtime parameter is initialized to the timestamp 2021-12-01 00:00:00 when invoking the query.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-querystring

Return type

str

schedule_configuration

Schedule configuration.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-scheduleconfiguration

Return type

Union[IResolvable, ScheduleConfigurationProperty]

scheduled_query_execution_role_arn

The ARN for the IAM role that Timestream will assume when running the scheduled query.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-scheduledqueryexecutionrolearn

Return type

str

scheduled_query_name

A name for the query.

Scheduled query names must be unique within each Region.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-scheduledqueryname

Return type

Optional[str]

tags

A list of key-value pairs to label the scheduled query.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-tags

Return type

Optional[List[CfnTag]]

target_configuration

Scheduled query target store configuration.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-timestream-scheduledquery.html#cfn-timestream-scheduledquery-targetconfiguration

Return type

Union[IResolvable, TargetConfigurationProperty, None]