aws-cdk-lib 2.184.1__py3-none-any.whl → 2.186.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aws-cdk-lib might be problematic. Click here for more details.
- aws_cdk/__init__.py +102 -29
- aws_cdk/_jsii/__init__.py +1 -1
- aws_cdk/_jsii/{aws-cdk-lib@2.184.1.jsii.tgz → aws-cdk-lib@2.186.0.jsii.tgz} +0 -0
- aws_cdk/aws_amazonmq/__init__.py +3 -2
- aws_cdk/aws_apigateway/__init__.py +1 -1
- aws_cdk/aws_apigatewayv2/__init__.py +9 -0
- aws_cdk/aws_appconfig/__init__.py +3 -3
- aws_cdk/aws_applicationsignals/__init__.py +495 -1
- aws_cdk/aws_appsync/__init__.py +65 -11
- aws_cdk/aws_athena/__init__.py +143 -0
- aws_cdk/aws_backup/__init__.py +4 -2
- aws_cdk/aws_batch/__init__.py +9 -0
- aws_cdk/aws_bedrock/__init__.py +645 -199
- aws_cdk/aws_cassandra/__init__.py +3 -5
- aws_cdk/aws_chatbot/__init__.py +41 -0
- aws_cdk/aws_cleanrooms/__init__.py +21 -9
- aws_cdk/aws_cloudformation/__init__.py +1 -5
- aws_cdk/aws_cloudfront/__init__.py +4 -1
- aws_cdk/aws_cloudfront_origins/__init__.py +4 -2
- aws_cdk/aws_codeartifact/__init__.py +20 -33
- aws_cdk/aws_codebuild/__init__.py +10 -3
- aws_cdk/aws_codepipeline/__init__.py +1328 -120
- aws_cdk/aws_cognito/__init__.py +1 -1
- aws_cdk/aws_cognito_identitypool/__init__.py +2303 -0
- aws_cdk/aws_config/__init__.py +1 -1
- aws_cdk/aws_connect/__init__.py +3 -7
- aws_cdk/aws_controltower/__init__.py +18 -26
- aws_cdk/aws_datasync/__init__.py +12 -14
- aws_cdk/aws_datazone/__init__.py +3471 -2
- aws_cdk/aws_ec2/__init__.py +701 -37
- aws_cdk/aws_ecr/__init__.py +84 -2
- aws_cdk/aws_ecs/__init__.py +20 -25
- aws_cdk/aws_eks/__init__.py +2 -0
- aws_cdk/aws_elasticloadbalancingv2/__init__.py +42 -5
- aws_cdk/aws_elasticsearch/__init__.py +1 -1
- aws_cdk/aws_events/__init__.py +37 -14
- aws_cdk/aws_events_targets/__init__.py +5 -5
- aws_cdk/aws_gamelift/__init__.py +165 -165
- aws_cdk/aws_gameliftstreams/__init__.py +199 -59
- aws_cdk/aws_iam/__init__.py +320 -25
- aws_cdk/aws_imagebuilder/__init__.py +15 -2
- aws_cdk/aws_iotfleetwise/__init__.py +15 -6
- aws_cdk/aws_kinesisfirehose/__init__.py +115 -113
- aws_cdk/aws_lambda/__init__.py +7 -1
- aws_cdk/aws_location/__init__.py +24 -7
- aws_cdk/aws_logs/__init__.py +21 -27
- aws_cdk/aws_msk/__init__.py +17 -50
- aws_cdk/aws_networkfirewall/__init__.py +16 -12
- aws_cdk/aws_oam/__init__.py +8 -37
- aws_cdk/aws_opensearchservice/__init__.py +1 -1
- aws_cdk/aws_pcs/__init__.py +33 -22
- aws_cdk/aws_quicksight/__init__.py +6 -69
- aws_cdk/aws_rds/__init__.py +8 -4
- aws_cdk/aws_redshiftserverless/__init__.py +192 -15
- aws_cdk/aws_rum/__init__.py +454 -43
- aws_cdk/aws_s3/__init__.py +4 -6
- aws_cdk/aws_s3_deployment/__init__.py +2 -0
- aws_cdk/aws_sagemaker/__init__.py +524 -0
- aws_cdk/aws_scheduler/__init__.py +3944 -121
- aws_cdk/aws_scheduler_targets/__init__.py +4472 -0
- aws_cdk/aws_ses/__init__.py +9 -9
- aws_cdk/aws_sns/__init__.py +12 -12
- aws_cdk/aws_ssmquicksetup/__init__.py +5 -3
- aws_cdk/aws_stepfunctions/__init__.py +17 -15
- aws_cdk/aws_timestream/__init__.py +4 -4
- aws_cdk/aws_wafv2/__init__.py +345 -0
- aws_cdk/aws_workspacesthinclient/__init__.py +4 -4
- aws_cdk/cx_api/__init__.py +53 -0
- aws_cdk/region_info/__init__.py +2 -2
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/METADATA +1 -1
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/RECORD +75 -73
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.184.1.dist-info → aws_cdk_lib-2.186.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,4472 @@
|
|
|
1
|
+
r'''
|
|
2
|
+
# Amazon EventBridge Scheduler Targets Construct Library
|
|
3
|
+
|
|
4
|
+
[Amazon EventBridge Scheduler](https://aws.amazon.com/blogs/compute/introducing-amazon-eventbridge-scheduler/) is a feature from Amazon EventBridge
|
|
5
|
+
that allows you to create, run, and manage scheduled tasks at scale. With EventBridge Scheduler, you can schedule millions of one-time or recurring tasks across various AWS services without provisioning or managing underlying infrastructure.
|
|
6
|
+
|
|
7
|
+
This library contains integration classes for Amazon EventBridge Scheduler to call any
|
|
8
|
+
number of supported AWS Services.
|
|
9
|
+
|
|
10
|
+
The following targets are supported:
|
|
11
|
+
|
|
12
|
+
1. `targets.LambdaInvoke`: [Invoke an AWS Lambda function](#invoke-a-lambda-function)
|
|
13
|
+
2. `targets.StepFunctionsStartExecution`: [Start an AWS Step Function](#start-an-aws-step-function)
|
|
14
|
+
3. `targets.CodeBuildStartBuild`: [Start a CodeBuild job](#start-a-codebuild-job)
|
|
15
|
+
4. `targets.SqsSendMessage`: [Send a Message to an Amazon SQS Queue](#send-a-message-to-an-sqs-queue)
|
|
16
|
+
5. `targets.SnsPublish`: [Publish messages to an Amazon SNS topic](#publish-messages-to-an-amazon-sns-topic)
|
|
17
|
+
6. `targets.EventBridgePutEvents`: [Put Events on EventBridge](#send-events-to-an-eventbridge-event-bus)
|
|
18
|
+
7. `targets.InspectorStartAssessmentRun`: [Start an Amazon Inspector assessment run](#start-an-amazon-inspector-assessment-run)
|
|
19
|
+
8. `targets.KinesisStreamPutRecord`: [Put a record to an Amazon Kinesis Data Stream](#put-a-record-to-an-amazon-kinesis-data-stream)
|
|
20
|
+
9. `targets.FirehosePutRecord`: [Put a record to an Amazon Data Firehose](#put-a-record-to-an-amazon-data-firehose)
|
|
21
|
+
10. `targets.CodePipelineStartPipelineExecution`: [Start a CodePipeline execution](#start-a-codepipeline-execution)
|
|
22
|
+
11. `targets.SageMakerStartPipelineExecution`: [Start a SageMaker pipeline execution](#start-a-sagemaker-pipeline-execution)
|
|
23
|
+
12. `targets.EcsRunTask`: [Start a new ECS task](#schedule-an-ecs-task-run)
|
|
24
|
+
13. `targets.Universal`: [Invoke a wider set of AWS API](#invoke-a-wider-set-of-aws-api)
|
|
25
|
+
|
|
26
|
+
## Invoke a Lambda function
|
|
27
|
+
|
|
28
|
+
Use the `LambdaInvoke` target to invoke a lambda function.
|
|
29
|
+
|
|
30
|
+
The code snippet below creates an event rule with a Lambda function as a target
|
|
31
|
+
called every hour by EventBridge Scheduler with a custom payload. You can optionally attach a
|
|
32
|
+
[dead letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html).
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import aws_cdk.aws_lambda as lambda_
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
fn = lambda_.Function(self, "MyFunc",
|
|
39
|
+
runtime=lambda_.Runtime.NODEJS_LATEST,
|
|
40
|
+
handler="index.handler",
|
|
41
|
+
code=lambda_.Code.from_inline("exports.handler = handler.toString()")
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
dlq = sqs.Queue(self, "DLQ",
|
|
45
|
+
queue_name="MyDLQ"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
target = targets.LambdaInvoke(fn,
|
|
49
|
+
dead_letter_queue=dlq,
|
|
50
|
+
max_event_age=Duration.minutes(1),
|
|
51
|
+
retry_attempts=3,
|
|
52
|
+
input=ScheduleTargetInput.from_object({
|
|
53
|
+
"payload": "useful"
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
schedule = Schedule(self, "Schedule",
|
|
58
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
59
|
+
target=target
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Start an AWS Step Function
|
|
64
|
+
|
|
65
|
+
Use the `StepFunctionsStartExecution` target to start a new execution on a StepFunction.
|
|
66
|
+
|
|
67
|
+
The code snippet below creates an event rule with a Step Function as a target
|
|
68
|
+
called every hour by EventBridge Scheduler with a custom payload.
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
import aws_cdk.aws_stepfunctions as sfn
|
|
72
|
+
import aws_cdk.aws_stepfunctions_tasks as tasks
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
payload = {
|
|
76
|
+
"Name": "MyParameter",
|
|
77
|
+
"Value": "🌥️"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
put_parameter_step = tasks.CallAwsService(self, "PutParameter",
|
|
81
|
+
service="ssm",
|
|
82
|
+
action="putParameter",
|
|
83
|
+
iam_resources=["*"],
|
|
84
|
+
parameters={
|
|
85
|
+
"Name.$": "$.Name",
|
|
86
|
+
"Value.$": "$.Value",
|
|
87
|
+
"Type": "String",
|
|
88
|
+
"Overwrite": True
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
state_machine = sfn.StateMachine(self, "StateMachine",
|
|
93
|
+
definition_body=sfn.DefinitionBody.from_chainable(put_parameter_step)
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
Schedule(self, "Schedule",
|
|
97
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
98
|
+
target=targets.StepFunctionsStartExecution(state_machine,
|
|
99
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Start a CodeBuild job
|
|
105
|
+
|
|
106
|
+
Use the `CodeBuildStartBuild` target to start a new build run on a CodeBuild project.
|
|
107
|
+
|
|
108
|
+
The code snippet below creates an event rule with a CodeBuild project as target which is
|
|
109
|
+
called every hour by EventBridge Scheduler.
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
import aws_cdk.aws_codebuild as codebuild
|
|
113
|
+
|
|
114
|
+
# project: codebuild.Project
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
Schedule(self, "Schedule",
|
|
118
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
119
|
+
target=targets.CodeBuildStartBuild(project)
|
|
120
|
+
)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Send a Message To an SQS Queue
|
|
124
|
+
|
|
125
|
+
Use the `SqsSendMessage` target to send a message to an SQS Queue.
|
|
126
|
+
|
|
127
|
+
The code snippet below creates an event rule with an SQS Queue as a target
|
|
128
|
+
called every hour by EventBridge Scheduler with a custom payload.
|
|
129
|
+
|
|
130
|
+
Contains the `messageGroupId` to use when the target is a FIFO queue. If you specify
|
|
131
|
+
a FIFO queue as a target, the queue must have content-based deduplication enabled.
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
payload = "test"
|
|
135
|
+
message_group_id = "id"
|
|
136
|
+
queue = sqs.Queue(self, "MyQueue",
|
|
137
|
+
fifo=True,
|
|
138
|
+
content_based_deduplication=True
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
target = targets.SqsSendMessage(queue,
|
|
142
|
+
input=ScheduleTargetInput.from_text(payload),
|
|
143
|
+
message_group_id=message_group_id
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
Schedule(self, "Schedule",
|
|
147
|
+
schedule=ScheduleExpression.rate(Duration.minutes(1)),
|
|
148
|
+
target=target
|
|
149
|
+
)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Publish messages to an Amazon SNS topic
|
|
153
|
+
|
|
154
|
+
Use the `SnsPublish` target to publish messages to an Amazon SNS topic.
|
|
155
|
+
|
|
156
|
+
The code snippets below create an event rule with a Amazon SNS topic as a target.
|
|
157
|
+
It's called every hour by Amazon EventBridge Scheduler with a custom payload.
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
import aws_cdk.aws_sns as sns
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
topic = sns.Topic(self, "Topic")
|
|
164
|
+
|
|
165
|
+
payload = {
|
|
166
|
+
"message": "Hello scheduler!"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
target = targets.SnsPublish(topic,
|
|
170
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
Schedule(self, "Schedule",
|
|
174
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
175
|
+
target=target
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Send events to an EventBridge event bus
|
|
180
|
+
|
|
181
|
+
Use the `EventBridgePutEvents` target to send events to an EventBridge event bus.
|
|
182
|
+
|
|
183
|
+
The code snippet below creates an event rule with an EventBridge event bus as a target
|
|
184
|
+
called every hour by EventBridge Scheduler with a custom event payload.
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
import aws_cdk.aws_events as events
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
event_bus = events.EventBus(self, "EventBus",
|
|
191
|
+
event_bus_name="DomainEvents"
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
event_entry = targets.EventBridgePutEventsEntry(
|
|
195
|
+
event_bus=event_bus,
|
|
196
|
+
source="PetService",
|
|
197
|
+
detail=ScheduleTargetInput.from_object({"Name": "Fluffy"}),
|
|
198
|
+
detail_type="🐶"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
Schedule(self, "Schedule",
|
|
202
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
203
|
+
target=targets.EventBridgePutEvents(event_entry)
|
|
204
|
+
)
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Start an Amazon Inspector assessment run
|
|
208
|
+
|
|
209
|
+
Use the `InspectorStartAssessmentRun` target to start an Inspector assessment run.
|
|
210
|
+
|
|
211
|
+
The code snippet below creates an event rule with an assessment template as the target which is
|
|
212
|
+
called every hour by EventBridge Scheduler.
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
import aws_cdk.aws_inspector as inspector
|
|
216
|
+
|
|
217
|
+
# cfn_assessment_template: inspector.CfnAssessmentTemplate
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
assessment_template = inspector.AssessmentTemplate.from_cfn_assessment_template(self, "MyAssessmentTemplate", cfn_assessment_template)
|
|
221
|
+
|
|
222
|
+
Schedule(self, "Schedule",
|
|
223
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
224
|
+
target=targets.InspectorStartAssessmentRun(assessment_template)
|
|
225
|
+
)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Put a record to an Amazon Kinesis Data Stream
|
|
229
|
+
|
|
230
|
+
Use the `KinesisStreamPutRecord` target to put a record to an Amazon Kinesis Data Stream.
|
|
231
|
+
|
|
232
|
+
The code snippet below creates an event rule with a stream as the target which is
|
|
233
|
+
called every hour by EventBridge Scheduler.
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
import aws_cdk.aws_kinesis as kinesis
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
stream = kinesis.Stream(self, "MyStream")
|
|
240
|
+
|
|
241
|
+
Schedule(self, "Schedule",
|
|
242
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
243
|
+
target=targets.KinesisStreamPutRecord(stream,
|
|
244
|
+
partition_key="key"
|
|
245
|
+
)
|
|
246
|
+
)
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Put a record to an Amazon Data Firehose
|
|
250
|
+
|
|
251
|
+
Use the `FirehosePutRecord` target to put a record to an Amazon Data Firehose delivery stream.
|
|
252
|
+
|
|
253
|
+
The code snippet below creates an event rule with a delivery stream as a target
|
|
254
|
+
called every hour by EventBridge Scheduler with a custom payload.
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
import aws_cdk.aws_kinesisfirehose as firehose
|
|
258
|
+
# delivery_stream: firehose.IDeliveryStream
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
payload = {
|
|
262
|
+
"Data": "record"
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
Schedule(self, "Schedule",
|
|
266
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
267
|
+
target=targets.FirehosePutRecord(delivery_stream,
|
|
268
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
269
|
+
)
|
|
270
|
+
)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Start a CodePipeline execution
|
|
274
|
+
|
|
275
|
+
Use the `CodePipelineStartPipelineExecution` target to start a new execution for a CodePipeline pipeline.
|
|
276
|
+
|
|
277
|
+
The code snippet below creates an event rule with a CodePipeline pipeline as the target which is
|
|
278
|
+
called every hour by EventBridge Scheduler.
|
|
279
|
+
|
|
280
|
+
```python
|
|
281
|
+
import aws_cdk.aws_codepipeline as codepipeline
|
|
282
|
+
|
|
283
|
+
# pipeline: codepipeline.Pipeline
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
Schedule(self, "Schedule",
|
|
287
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
288
|
+
target=targets.CodePipelineStartPipelineExecution(pipeline)
|
|
289
|
+
)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Start a SageMaker pipeline execution
|
|
293
|
+
|
|
294
|
+
Use the `SageMakerStartPipelineExecution` target to start a new execution for a SageMaker pipeline.
|
|
295
|
+
|
|
296
|
+
The code snippet below creates an event rule with a SageMaker pipeline as the target which is
|
|
297
|
+
called every hour by EventBridge Scheduler.
|
|
298
|
+
|
|
299
|
+
```python
|
|
300
|
+
import aws_cdk.aws_sagemaker as sagemaker
|
|
301
|
+
|
|
302
|
+
# pipeline: sagemaker.IPipeline
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
Schedule(self, "Schedule",
|
|
306
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
307
|
+
target=targets.SageMakerStartPipelineExecution(pipeline,
|
|
308
|
+
pipeline_parameter_list=[targets.SageMakerPipelineParameter(
|
|
309
|
+
name="parameter-name",
|
|
310
|
+
value="parameter-value"
|
|
311
|
+
)]
|
|
312
|
+
)
|
|
313
|
+
)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Schedule an ECS task run
|
|
317
|
+
|
|
318
|
+
Use the `EcsRunTask` target to schedule an ECS task run for a cluster.
|
|
319
|
+
|
|
320
|
+
The code snippet below creates an event rule with a Fargate task definition and cluster as the target which is called every hour by EventBridge Scheduler.
|
|
321
|
+
|
|
322
|
+
```python
|
|
323
|
+
import aws_cdk.aws_ecs as ecs
|
|
324
|
+
|
|
325
|
+
# cluster: ecs.ICluster
|
|
326
|
+
# task_definition: ecs.FargateTaskDefinition
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
Schedule(self, "Schedule",
|
|
330
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
331
|
+
target=targets.EcsRunFargateTask(cluster,
|
|
332
|
+
task_definition=task_definition
|
|
333
|
+
)
|
|
334
|
+
)
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
The code snippet below creates an event rule with a EC2 task definition and cluster as the target which is called every hour by EventBridge Scheduler.
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
import aws_cdk.aws_ecs as ecs
|
|
341
|
+
|
|
342
|
+
# cluster: ecs.ICluster
|
|
343
|
+
# task_definition: ecs.Ec2TaskDefinition
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
Schedule(self, "Schedule",
|
|
347
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
348
|
+
target=targets.EcsRunEc2Task(cluster,
|
|
349
|
+
task_definition=task_definition
|
|
350
|
+
)
|
|
351
|
+
)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Invoke a wider set of AWS API
|
|
355
|
+
|
|
356
|
+
Use the `Universal` target to invoke AWS API. See [https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html)
|
|
357
|
+
|
|
358
|
+
The code snippet below creates an event rule with AWS API as the target which is
|
|
359
|
+
called at midnight every day by EventBridge Scheduler.
|
|
360
|
+
|
|
361
|
+
```python
|
|
362
|
+
Schedule(self, "Schedule",
|
|
363
|
+
schedule=ScheduleExpression.cron(
|
|
364
|
+
minute="0",
|
|
365
|
+
hour="0"
|
|
366
|
+
),
|
|
367
|
+
target=targets.Universal(
|
|
368
|
+
service="rds",
|
|
369
|
+
action="stopDBCluster",
|
|
370
|
+
input=ScheduleTargetInput.from_object({
|
|
371
|
+
"DbClusterIdentifier": "my-db"
|
|
372
|
+
})
|
|
373
|
+
)
|
|
374
|
+
)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
The `service` must be in lowercase and the `action` must be in camelCase.
|
|
378
|
+
|
|
379
|
+
By default, an IAM policy for the Scheduler is extracted from the API call. The action in the policy is constructed using the `service` and `action` prop.
|
|
380
|
+
Re-using the example above, the action will be `rds:stopDBCluster`. Note that not all IAM actions follow the same pattern. In such scenario, please use the
|
|
381
|
+
`policyStatements` prop to override the policy:
|
|
382
|
+
|
|
383
|
+
```python
|
|
384
|
+
Schedule(self, "Schedule",
|
|
385
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
386
|
+
target=targets.Universal(
|
|
387
|
+
service="sqs",
|
|
388
|
+
action="sendMessage",
|
|
389
|
+
policy_statements=[
|
|
390
|
+
iam.PolicyStatement(
|
|
391
|
+
actions=["sqs:SendMessage"],
|
|
392
|
+
resources=["arn:aws:sqs:us-east-1:123456789012:my_queue"]
|
|
393
|
+
),
|
|
394
|
+
iam.PolicyStatement(
|
|
395
|
+
actions=["kms:Decrypt", "kms:GenerateDataKey*"],
|
|
396
|
+
resources=["arn:aws:kms:us-east-1:123456789012:key/0987dcba-09fe-87dc-65ba-ab0987654321"]
|
|
397
|
+
)
|
|
398
|
+
]
|
|
399
|
+
)
|
|
400
|
+
)
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
> Note: The default policy uses `*` in the resources field as CDK does not have a straight forward way to auto-discover the resources permission required.
|
|
404
|
+
> It is recommended that you scope the field down to specific resources to have a better security posture.
|
|
405
|
+
'''
|
|
406
|
+
from pkgutil import extend_path
|
|
407
|
+
__path__ = extend_path(__path__, __name__)
|
|
408
|
+
|
|
409
|
+
import abc
|
|
410
|
+
import builtins
|
|
411
|
+
import datetime
|
|
412
|
+
import enum
|
|
413
|
+
import typing
|
|
414
|
+
|
|
415
|
+
import jsii
|
|
416
|
+
import publication
|
|
417
|
+
import typing_extensions
|
|
418
|
+
|
|
419
|
+
import typeguard
|
|
420
|
+
from importlib.metadata import version as _metadata_package_version
|
|
421
|
+
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
422
|
+
|
|
423
|
+
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
424
|
+
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
425
|
+
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
426
|
+
else:
|
|
427
|
+
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
428
|
+
pass
|
|
429
|
+
else:
|
|
430
|
+
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
431
|
+
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
432
|
+
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
433
|
+
else:
|
|
434
|
+
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
435
|
+
|
|
436
|
+
from .._jsii import *
|
|
437
|
+
|
|
438
|
+
from .. import Duration as _Duration_4839e8c3
|
|
439
|
+
from ..aws_codebuild import IProject as _IProject_aafae30a
|
|
440
|
+
from ..aws_codepipeline import IPipeline as _IPipeline_0931f838
|
|
441
|
+
from ..aws_ec2 import (
|
|
442
|
+
ISecurityGroup as _ISecurityGroup_acf8a799,
|
|
443
|
+
SubnetSelection as _SubnetSelection_e57d76df,
|
|
444
|
+
)
|
|
445
|
+
from ..aws_ecs import (
|
|
446
|
+
CapacityProviderStrategy as _CapacityProviderStrategy_8d7b6657,
|
|
447
|
+
FargatePlatformVersion as _FargatePlatformVersion_55d8be5c,
|
|
448
|
+
ICluster as _ICluster_16cddd09,
|
|
449
|
+
PlacementConstraint as _PlacementConstraint_11d82a52,
|
|
450
|
+
PlacementStrategy as _PlacementStrategy_2bb6c232,
|
|
451
|
+
TaskDefinition as _TaskDefinition_a541a103,
|
|
452
|
+
)
|
|
453
|
+
from ..aws_events import IEventBus as _IEventBus_88d13111
|
|
454
|
+
from ..aws_iam import (
|
|
455
|
+
IRole as _IRole_235f5d8e, PolicyStatement as _PolicyStatement_0fe33853
|
|
456
|
+
)
|
|
457
|
+
from ..aws_inspector import IAssessmentTemplate as _IAssessmentTemplate_495c2d4e
|
|
458
|
+
from ..aws_kinesis import IStream as _IStream_4e2457d2
|
|
459
|
+
from ..aws_kinesisfirehose import IDeliveryStream as _IDeliveryStream_8f118861
|
|
460
|
+
from ..aws_lambda import IFunction as _IFunction_6adb0ab8
|
|
461
|
+
from ..aws_sagemaker import IPipeline as _IPipeline_3f0dad92
|
|
462
|
+
from ..aws_scheduler import (
|
|
463
|
+
ISchedule as _ISchedule_4a32574d,
|
|
464
|
+
IScheduleTarget as _IScheduleTarget_46344d95,
|
|
465
|
+
ScheduleTargetConfig as _ScheduleTargetConfig_74216353,
|
|
466
|
+
ScheduleTargetInput as _ScheduleTargetInput_dd30d070,
|
|
467
|
+
)
|
|
468
|
+
from ..aws_sns import ITopic as _ITopic_9eca4852
|
|
469
|
+
from ..aws_sqs import IQueue as _IQueue_7ed6f679
|
|
470
|
+
from ..aws_stepfunctions import IStateMachine as _IStateMachine_73e8d2b0
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
@jsii.data_type(
|
|
474
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EventBridgePutEventsEntry",
|
|
475
|
+
jsii_struct_bases=[],
|
|
476
|
+
name_mapping={
|
|
477
|
+
"detail": "detail",
|
|
478
|
+
"detail_type": "detailType",
|
|
479
|
+
"event_bus": "eventBus",
|
|
480
|
+
"source": "source",
|
|
481
|
+
},
|
|
482
|
+
)
|
|
483
|
+
class EventBridgePutEventsEntry:
|
|
484
|
+
def __init__(
|
|
485
|
+
self,
|
|
486
|
+
*,
|
|
487
|
+
detail: _ScheduleTargetInput_dd30d070,
|
|
488
|
+
detail_type: builtins.str,
|
|
489
|
+
event_bus: _IEventBus_88d13111,
|
|
490
|
+
source: builtins.str,
|
|
491
|
+
) -> None:
|
|
492
|
+
'''An entry to be sent to EventBridge.
|
|
493
|
+
|
|
494
|
+
:param detail: The event body. Can either be provided as an object or as a JSON-serialized string
|
|
495
|
+
:param detail_type: Used along with the source field to help identify the fields and values expected in the detail field. For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"
|
|
496
|
+
:param event_bus: The event bus the entry will be sent to.
|
|
497
|
+
:param source: The service or application that caused this event to be generated. Example value: ``com.example.service``
|
|
498
|
+
|
|
499
|
+
:see: https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEventsRequestEntry.html
|
|
500
|
+
:exampleMetadata: infused
|
|
501
|
+
|
|
502
|
+
Example::
|
|
503
|
+
|
|
504
|
+
import aws_cdk.aws_events as events
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
event_bus = events.EventBus(self, "EventBus",
|
|
508
|
+
event_bus_name="DomainEvents"
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
event_entry = targets.EventBridgePutEventsEntry(
|
|
512
|
+
event_bus=event_bus,
|
|
513
|
+
source="PetService",
|
|
514
|
+
detail=ScheduleTargetInput.from_object({"Name": "Fluffy"}),
|
|
515
|
+
detail_type="🐶"
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
Schedule(self, "Schedule",
|
|
519
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
520
|
+
target=targets.EventBridgePutEvents(event_entry)
|
|
521
|
+
)
|
|
522
|
+
'''
|
|
523
|
+
if __debug__:
|
|
524
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c20ea1ffb2760df785aee8014a687654066d35e08ebf631810b29af40f20952b)
|
|
525
|
+
check_type(argname="argument detail", value=detail, expected_type=type_hints["detail"])
|
|
526
|
+
check_type(argname="argument detail_type", value=detail_type, expected_type=type_hints["detail_type"])
|
|
527
|
+
check_type(argname="argument event_bus", value=event_bus, expected_type=type_hints["event_bus"])
|
|
528
|
+
check_type(argname="argument source", value=source, expected_type=type_hints["source"])
|
|
529
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
530
|
+
"detail": detail,
|
|
531
|
+
"detail_type": detail_type,
|
|
532
|
+
"event_bus": event_bus,
|
|
533
|
+
"source": source,
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
@builtins.property
|
|
537
|
+
def detail(self) -> _ScheduleTargetInput_dd30d070:
|
|
538
|
+
'''The event body.
|
|
539
|
+
|
|
540
|
+
Can either be provided as an object or as a JSON-serialized string
|
|
541
|
+
|
|
542
|
+
Example::
|
|
543
|
+
|
|
544
|
+
ScheduleTargetInput.from_text("{\"instance-id\": \"i-1234567890abcdef0\", \"state\": \"terminated\"}")
|
|
545
|
+
ScheduleTargetInput.from_object({"Message": "Hello from a friendly event :)"})
|
|
546
|
+
'''
|
|
547
|
+
result = self._values.get("detail")
|
|
548
|
+
assert result is not None, "Required property 'detail' is missing"
|
|
549
|
+
return typing.cast(_ScheduleTargetInput_dd30d070, result)
|
|
550
|
+
|
|
551
|
+
@builtins.property
|
|
552
|
+
def detail_type(self) -> builtins.str:
|
|
553
|
+
'''Used along with the source field to help identify the fields and values expected in the detail field.
|
|
554
|
+
|
|
555
|
+
For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"
|
|
556
|
+
|
|
557
|
+
:see: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
|
|
558
|
+
'''
|
|
559
|
+
result = self._values.get("detail_type")
|
|
560
|
+
assert result is not None, "Required property 'detail_type' is missing"
|
|
561
|
+
return typing.cast(builtins.str, result)
|
|
562
|
+
|
|
563
|
+
@builtins.property
|
|
564
|
+
def event_bus(self) -> _IEventBus_88d13111:
|
|
565
|
+
'''The event bus the entry will be sent to.'''
|
|
566
|
+
result = self._values.get("event_bus")
|
|
567
|
+
assert result is not None, "Required property 'event_bus' is missing"
|
|
568
|
+
return typing.cast(_IEventBus_88d13111, result)
|
|
569
|
+
|
|
570
|
+
@builtins.property
|
|
571
|
+
def source(self) -> builtins.str:
|
|
572
|
+
'''The service or application that caused this event to be generated.
|
|
573
|
+
|
|
574
|
+
Example value: ``com.example.service``
|
|
575
|
+
|
|
576
|
+
:see: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
|
|
577
|
+
'''
|
|
578
|
+
result = self._values.get("source")
|
|
579
|
+
assert result is not None, "Required property 'source' is missing"
|
|
580
|
+
return typing.cast(builtins.str, result)
|
|
581
|
+
|
|
582
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
583
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
584
|
+
|
|
585
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
586
|
+
return not (rhs == self)
|
|
587
|
+
|
|
588
|
+
def __repr__(self) -> str:
|
|
589
|
+
return "EventBridgePutEventsEntry(%s)" % ", ".join(
|
|
590
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
@jsii.data_type(
|
|
595
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SageMakerPipelineParameter",
|
|
596
|
+
jsii_struct_bases=[],
|
|
597
|
+
name_mapping={"name": "name", "value": "value"},
|
|
598
|
+
)
|
|
599
|
+
class SageMakerPipelineParameter:
|
|
600
|
+
def __init__(self, *, name: builtins.str, value: builtins.str) -> None:
|
|
601
|
+
'''Properties for a pipeline parameter.
|
|
602
|
+
|
|
603
|
+
:param name: Name of parameter to start execution of a SageMaker Model Building Pipeline.
|
|
604
|
+
:param value: Value of parameter to start execution of a SageMaker Model Building Pipeline.
|
|
605
|
+
|
|
606
|
+
:exampleMetadata: fixture=_generated
|
|
607
|
+
|
|
608
|
+
Example::
|
|
609
|
+
|
|
610
|
+
# The code below shows an example of how to instantiate this type.
|
|
611
|
+
# The values are placeholders you should change.
|
|
612
|
+
from aws_cdk import aws_scheduler_targets as scheduler_targets
|
|
613
|
+
|
|
614
|
+
sage_maker_pipeline_parameter = scheduler_targets.SageMakerPipelineParameter(
|
|
615
|
+
name="name",
|
|
616
|
+
value="value"
|
|
617
|
+
)
|
|
618
|
+
'''
|
|
619
|
+
if __debug__:
|
|
620
|
+
type_hints = typing.get_type_hints(_typecheckingstub__a9b88d9119f8045f4c3b695d8ed58b7f5b8833e798cbc2660e4c8ba59fc95cb1)
|
|
621
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
622
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
623
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
624
|
+
"name": name,
|
|
625
|
+
"value": value,
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
@builtins.property
|
|
629
|
+
def name(self) -> builtins.str:
|
|
630
|
+
'''Name of parameter to start execution of a SageMaker Model Building Pipeline.'''
|
|
631
|
+
result = self._values.get("name")
|
|
632
|
+
assert result is not None, "Required property 'name' is missing"
|
|
633
|
+
return typing.cast(builtins.str, result)
|
|
634
|
+
|
|
635
|
+
@builtins.property
|
|
636
|
+
def value(self) -> builtins.str:
|
|
637
|
+
'''Value of parameter to start execution of a SageMaker Model Building Pipeline.'''
|
|
638
|
+
result = self._values.get("value")
|
|
639
|
+
assert result is not None, "Required property 'value' is missing"
|
|
640
|
+
return typing.cast(builtins.str, result)
|
|
641
|
+
|
|
642
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
643
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
644
|
+
|
|
645
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
646
|
+
return not (rhs == self)
|
|
647
|
+
|
|
648
|
+
def __repr__(self) -> str:
|
|
649
|
+
return "SageMakerPipelineParameter(%s)" % ", ".join(
|
|
650
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
651
|
+
)
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
class ScheduleTargetBase(
|
|
655
|
+
metaclass=jsii.JSIIAbstractClass,
|
|
656
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.ScheduleTargetBase",
|
|
657
|
+
):
|
|
658
|
+
'''Base class for Schedule Targets.'''
|
|
659
|
+
|
|
660
|
+
def __init__(
|
|
661
|
+
self,
|
|
662
|
+
base_props: typing.Union["ScheduleTargetBaseProps", typing.Dict[builtins.str, typing.Any]],
|
|
663
|
+
target_arn: builtins.str,
|
|
664
|
+
) -> None:
|
|
665
|
+
'''
|
|
666
|
+
:param base_props: -
|
|
667
|
+
:param target_arn: -
|
|
668
|
+
'''
|
|
669
|
+
if __debug__:
|
|
670
|
+
type_hints = typing.get_type_hints(_typecheckingstub__8d830072c02aa1c93302e9c28e7f88fb42c5a6a2a9deec3c567a7179aebb7d89)
|
|
671
|
+
check_type(argname="argument base_props", value=base_props, expected_type=type_hints["base_props"])
|
|
672
|
+
check_type(argname="argument target_arn", value=target_arn, expected_type=type_hints["target_arn"])
|
|
673
|
+
jsii.create(self.__class__, self, [base_props, target_arn])
|
|
674
|
+
|
|
675
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
676
|
+
@abc.abstractmethod
|
|
677
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
678
|
+
'''
|
|
679
|
+
:param role: -
|
|
680
|
+
'''
|
|
681
|
+
...
|
|
682
|
+
|
|
683
|
+
@jsii.member(jsii_name="bind")
|
|
684
|
+
def bind(self, schedule: _ISchedule_4a32574d) -> _ScheduleTargetConfig_74216353:
|
|
685
|
+
'''Create a return a Schedule Target Configuration for the given schedule.
|
|
686
|
+
|
|
687
|
+
:param schedule: -
|
|
688
|
+
|
|
689
|
+
:return: a Schedule Target Configuration
|
|
690
|
+
'''
|
|
691
|
+
if __debug__:
|
|
692
|
+
type_hints = typing.get_type_hints(_typecheckingstub__01737bee0bf8db4b920430443ea84a27c1c2f6246bd71927150a4fb28accc32d)
|
|
693
|
+
check_type(argname="argument schedule", value=schedule, expected_type=type_hints["schedule"])
|
|
694
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bind", [schedule]))
|
|
695
|
+
|
|
696
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
697
|
+
def _bind_base_target_config(
|
|
698
|
+
self,
|
|
699
|
+
_schedule: _ISchedule_4a32574d,
|
|
700
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
701
|
+
'''
|
|
702
|
+
:param _schedule: -
|
|
703
|
+
'''
|
|
704
|
+
if __debug__:
|
|
705
|
+
type_hints = typing.get_type_hints(_typecheckingstub__bd8a5015bbf00d1130163ba73634014dc8420ec6c2484ca7ca7e2d9776b12c60)
|
|
706
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
707
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
708
|
+
|
|
709
|
+
@builtins.property
|
|
710
|
+
@jsii.member(jsii_name="targetArn")
|
|
711
|
+
def _target_arn(self) -> builtins.str:
|
|
712
|
+
return typing.cast(builtins.str, jsii.get(self, "targetArn"))
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
class _ScheduleTargetBaseProxy(ScheduleTargetBase):
|
|
716
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
717
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
718
|
+
'''
|
|
719
|
+
:param role: -
|
|
720
|
+
'''
|
|
721
|
+
if __debug__:
|
|
722
|
+
type_hints = typing.get_type_hints(_typecheckingstub__13ff83395a9b3dcc596bc1aa8b656c8638facf50a6854e6d21772607443b3efc)
|
|
723
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
724
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
725
|
+
|
|
726
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
|
|
727
|
+
typing.cast(typing.Any, ScheduleTargetBase).__jsii_proxy_class__ = lambda : _ScheduleTargetBaseProxy
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
@jsii.data_type(
|
|
731
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.ScheduleTargetBaseProps",
|
|
732
|
+
jsii_struct_bases=[],
|
|
733
|
+
name_mapping={
|
|
734
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
735
|
+
"input": "input",
|
|
736
|
+
"max_event_age": "maxEventAge",
|
|
737
|
+
"retry_attempts": "retryAttempts",
|
|
738
|
+
"role": "role",
|
|
739
|
+
},
|
|
740
|
+
)
|
|
741
|
+
class ScheduleTargetBaseProps:
|
|
742
|
+
def __init__(
|
|
743
|
+
self,
|
|
744
|
+
*,
|
|
745
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
746
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
747
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
748
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
749
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
750
|
+
) -> None:
|
|
751
|
+
'''Base properties for a Schedule Target.
|
|
752
|
+
|
|
753
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
754
|
+
:param input: Input passed to the target. Default: - no input.
|
|
755
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
756
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
757
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
758
|
+
|
|
759
|
+
:exampleMetadata: infused
|
|
760
|
+
|
|
761
|
+
Example::
|
|
762
|
+
|
|
763
|
+
import aws_cdk.aws_sns as sns
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
topic = sns.Topic(self, "Topic")
|
|
767
|
+
|
|
768
|
+
payload = {
|
|
769
|
+
"message": "Hello scheduler!"
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
target = targets.SnsPublish(topic,
|
|
773
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
774
|
+
)
|
|
775
|
+
|
|
776
|
+
Schedule(self, "Schedule",
|
|
777
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
778
|
+
target=target
|
|
779
|
+
)
|
|
780
|
+
'''
|
|
781
|
+
if __debug__:
|
|
782
|
+
type_hints = typing.get_type_hints(_typecheckingstub__29dad4add4695787b706ed4741ddf63b9b8130a1bdf3339dff7939d0917e60de)
|
|
783
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
784
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
785
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
786
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
787
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
788
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
789
|
+
if dead_letter_queue is not None:
|
|
790
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
791
|
+
if input is not None:
|
|
792
|
+
self._values["input"] = input
|
|
793
|
+
if max_event_age is not None:
|
|
794
|
+
self._values["max_event_age"] = max_event_age
|
|
795
|
+
if retry_attempts is not None:
|
|
796
|
+
self._values["retry_attempts"] = retry_attempts
|
|
797
|
+
if role is not None:
|
|
798
|
+
self._values["role"] = role
|
|
799
|
+
|
|
800
|
+
@builtins.property
|
|
801
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
802
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
803
|
+
|
|
804
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
805
|
+
depending on the retry policy of the target.
|
|
806
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
807
|
+
|
|
808
|
+
:default: - no dead-letter queue
|
|
809
|
+
'''
|
|
810
|
+
result = self._values.get("dead_letter_queue")
|
|
811
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
812
|
+
|
|
813
|
+
@builtins.property
|
|
814
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
815
|
+
'''Input passed to the target.
|
|
816
|
+
|
|
817
|
+
:default: - no input.
|
|
818
|
+
'''
|
|
819
|
+
result = self._values.get("input")
|
|
820
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
821
|
+
|
|
822
|
+
@builtins.property
|
|
823
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
824
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
825
|
+
|
|
826
|
+
Minimum value of 60.
|
|
827
|
+
Maximum value of 86400.
|
|
828
|
+
|
|
829
|
+
:default: Duration.hours(24)
|
|
830
|
+
'''
|
|
831
|
+
result = self._values.get("max_event_age")
|
|
832
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
833
|
+
|
|
834
|
+
@builtins.property
|
|
835
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
836
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
837
|
+
|
|
838
|
+
Minimum value of 0.
|
|
839
|
+
Maximum value of 185.
|
|
840
|
+
|
|
841
|
+
:default: 185
|
|
842
|
+
'''
|
|
843
|
+
result = self._values.get("retry_attempts")
|
|
844
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
845
|
+
|
|
846
|
+
@builtins.property
|
|
847
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
848
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
849
|
+
|
|
850
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
851
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
852
|
+
will grant minimal required permissions.
|
|
853
|
+
|
|
854
|
+
:default: - created by target
|
|
855
|
+
'''
|
|
856
|
+
result = self._values.get("role")
|
|
857
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
858
|
+
|
|
859
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
860
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
861
|
+
|
|
862
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
863
|
+
return not (rhs == self)
|
|
864
|
+
|
|
865
|
+
def __repr__(self) -> str:
|
|
866
|
+
return "ScheduleTargetBaseProps(%s)" % ", ".join(
|
|
867
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
868
|
+
)
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
872
|
+
class SnsPublish(
|
|
873
|
+
ScheduleTargetBase,
|
|
874
|
+
metaclass=jsii.JSIIMeta,
|
|
875
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SnsPublish",
|
|
876
|
+
):
|
|
877
|
+
'''Use an Amazon SNS topic as a target for AWS EventBridge Scheduler.
|
|
878
|
+
|
|
879
|
+
:exampleMetadata: infused
|
|
880
|
+
|
|
881
|
+
Example::
|
|
882
|
+
|
|
883
|
+
import aws_cdk.aws_sns as sns
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
topic = sns.Topic(self, "Topic")
|
|
887
|
+
|
|
888
|
+
payload = {
|
|
889
|
+
"message": "Hello scheduler!"
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
target = targets.SnsPublish(topic,
|
|
893
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
Schedule(self, "Schedule",
|
|
897
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
898
|
+
target=target
|
|
899
|
+
)
|
|
900
|
+
'''
|
|
901
|
+
|
|
902
|
+
def __init__(
|
|
903
|
+
self,
|
|
904
|
+
topic: _ITopic_9eca4852,
|
|
905
|
+
*,
|
|
906
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
907
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
908
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
909
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
910
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
911
|
+
) -> None:
|
|
912
|
+
'''
|
|
913
|
+
:param topic: -
|
|
914
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
915
|
+
:param input: Input passed to the target. Default: - no input.
|
|
916
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
917
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
918
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
919
|
+
'''
|
|
920
|
+
if __debug__:
|
|
921
|
+
type_hints = typing.get_type_hints(_typecheckingstub__961b73901f7c52b4629b4552b6be3585368cfc6c4de258420a2e2c4c9108b398)
|
|
922
|
+
check_type(argname="argument topic", value=topic, expected_type=type_hints["topic"])
|
|
923
|
+
props = ScheduleTargetBaseProps(
|
|
924
|
+
dead_letter_queue=dead_letter_queue,
|
|
925
|
+
input=input,
|
|
926
|
+
max_event_age=max_event_age,
|
|
927
|
+
retry_attempts=retry_attempts,
|
|
928
|
+
role=role,
|
|
929
|
+
)
|
|
930
|
+
|
|
931
|
+
jsii.create(self.__class__, self, [topic, props])
|
|
932
|
+
|
|
933
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
934
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
935
|
+
'''
|
|
936
|
+
:param role: -
|
|
937
|
+
'''
|
|
938
|
+
if __debug__:
|
|
939
|
+
type_hints = typing.get_type_hints(_typecheckingstub__6302629a59c54cd7dafc566171c4a283657f72f44a44767384888df0e6012021)
|
|
940
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
941
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
945
|
+
class SqsSendMessage(
|
|
946
|
+
ScheduleTargetBase,
|
|
947
|
+
metaclass=jsii.JSIIMeta,
|
|
948
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SqsSendMessage",
|
|
949
|
+
):
|
|
950
|
+
'''Use an Amazon SQS Queue as a target for AWS EventBridge Scheduler.
|
|
951
|
+
|
|
952
|
+
:exampleMetadata: infused
|
|
953
|
+
|
|
954
|
+
Example::
|
|
955
|
+
|
|
956
|
+
payload = "test"
|
|
957
|
+
message_group_id = "id"
|
|
958
|
+
queue = sqs.Queue(self, "MyQueue",
|
|
959
|
+
fifo=True,
|
|
960
|
+
content_based_deduplication=True
|
|
961
|
+
)
|
|
962
|
+
|
|
963
|
+
target = targets.SqsSendMessage(queue,
|
|
964
|
+
input=ScheduleTargetInput.from_text(payload),
|
|
965
|
+
message_group_id=message_group_id
|
|
966
|
+
)
|
|
967
|
+
|
|
968
|
+
Schedule(self, "Schedule",
|
|
969
|
+
schedule=ScheduleExpression.rate(Duration.minutes(1)),
|
|
970
|
+
target=target
|
|
971
|
+
)
|
|
972
|
+
'''
|
|
973
|
+
|
|
974
|
+
def __init__(
|
|
975
|
+
self,
|
|
976
|
+
queue: _IQueue_7ed6f679,
|
|
977
|
+
*,
|
|
978
|
+
message_group_id: typing.Optional[builtins.str] = None,
|
|
979
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
980
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
981
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
982
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
983
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
984
|
+
) -> None:
|
|
985
|
+
'''
|
|
986
|
+
:param queue: -
|
|
987
|
+
:param message_group_id: The FIFO message group ID to use as the target. This must be specified when the target is a FIFO queue. If you specify a FIFO queue as a target, the queue must have content-based deduplication enabled. A length of ``messageGroupId`` must be between 1 and 128. Default: - no message group ID
|
|
988
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
989
|
+
:param input: Input passed to the target. Default: - no input.
|
|
990
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
991
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
992
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
993
|
+
'''
|
|
994
|
+
if __debug__:
|
|
995
|
+
type_hints = typing.get_type_hints(_typecheckingstub__a86c2fb46323ac8851887e951da0704b179c89e96fbc73b43048720c09f816d0)
|
|
996
|
+
check_type(argname="argument queue", value=queue, expected_type=type_hints["queue"])
|
|
997
|
+
props = SqsSendMessageProps(
|
|
998
|
+
message_group_id=message_group_id,
|
|
999
|
+
dead_letter_queue=dead_letter_queue,
|
|
1000
|
+
input=input,
|
|
1001
|
+
max_event_age=max_event_age,
|
|
1002
|
+
retry_attempts=retry_attempts,
|
|
1003
|
+
role=role,
|
|
1004
|
+
)
|
|
1005
|
+
|
|
1006
|
+
jsii.create(self.__class__, self, [queue, props])
|
|
1007
|
+
|
|
1008
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1009
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1010
|
+
'''
|
|
1011
|
+
:param role: -
|
|
1012
|
+
'''
|
|
1013
|
+
if __debug__:
|
|
1014
|
+
type_hints = typing.get_type_hints(_typecheckingstub__eef58dbd8df5d2551bec19ddf4779f0177025eb93b55e41899b7c2ad6298258b)
|
|
1015
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1016
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1017
|
+
|
|
1018
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
1019
|
+
def _bind_base_target_config(
|
|
1020
|
+
self,
|
|
1021
|
+
_schedule: _ISchedule_4a32574d,
|
|
1022
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
1023
|
+
'''
|
|
1024
|
+
:param _schedule: -
|
|
1025
|
+
'''
|
|
1026
|
+
if __debug__:
|
|
1027
|
+
type_hints = typing.get_type_hints(_typecheckingstub__cc4c92c6b396957e8236f2f491374f5459edff0144a288b6c967faa0660c413d)
|
|
1028
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
1029
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
@jsii.data_type(
|
|
1033
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SqsSendMessageProps",
|
|
1034
|
+
jsii_struct_bases=[ScheduleTargetBaseProps],
|
|
1035
|
+
name_mapping={
|
|
1036
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
1037
|
+
"input": "input",
|
|
1038
|
+
"max_event_age": "maxEventAge",
|
|
1039
|
+
"retry_attempts": "retryAttempts",
|
|
1040
|
+
"role": "role",
|
|
1041
|
+
"message_group_id": "messageGroupId",
|
|
1042
|
+
},
|
|
1043
|
+
)
|
|
1044
|
+
class SqsSendMessageProps(ScheduleTargetBaseProps):
|
|
1045
|
+
def __init__(
|
|
1046
|
+
self,
|
|
1047
|
+
*,
|
|
1048
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1049
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1050
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1051
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1052
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1053
|
+
message_group_id: typing.Optional[builtins.str] = None,
|
|
1054
|
+
) -> None:
|
|
1055
|
+
'''Properties for a SQS Queue Target.
|
|
1056
|
+
|
|
1057
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1058
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1059
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1060
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1061
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1062
|
+
:param message_group_id: The FIFO message group ID to use as the target. This must be specified when the target is a FIFO queue. If you specify a FIFO queue as a target, the queue must have content-based deduplication enabled. A length of ``messageGroupId`` must be between 1 and 128. Default: - no message group ID
|
|
1063
|
+
|
|
1064
|
+
:exampleMetadata: infused
|
|
1065
|
+
|
|
1066
|
+
Example::
|
|
1067
|
+
|
|
1068
|
+
payload = "test"
|
|
1069
|
+
message_group_id = "id"
|
|
1070
|
+
queue = sqs.Queue(self, "MyQueue",
|
|
1071
|
+
fifo=True,
|
|
1072
|
+
content_based_deduplication=True
|
|
1073
|
+
)
|
|
1074
|
+
|
|
1075
|
+
target = targets.SqsSendMessage(queue,
|
|
1076
|
+
input=ScheduleTargetInput.from_text(payload),
|
|
1077
|
+
message_group_id=message_group_id
|
|
1078
|
+
)
|
|
1079
|
+
|
|
1080
|
+
Schedule(self, "Schedule",
|
|
1081
|
+
schedule=ScheduleExpression.rate(Duration.minutes(1)),
|
|
1082
|
+
target=target
|
|
1083
|
+
)
|
|
1084
|
+
'''
|
|
1085
|
+
if __debug__:
|
|
1086
|
+
type_hints = typing.get_type_hints(_typecheckingstub__f9b071d098054dd80fee122aca519dd583724dcca2e31d39c850498cbc64a259)
|
|
1087
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
1088
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
1089
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
1090
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
1091
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1092
|
+
check_type(argname="argument message_group_id", value=message_group_id, expected_type=type_hints["message_group_id"])
|
|
1093
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
1094
|
+
if dead_letter_queue is not None:
|
|
1095
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
1096
|
+
if input is not None:
|
|
1097
|
+
self._values["input"] = input
|
|
1098
|
+
if max_event_age is not None:
|
|
1099
|
+
self._values["max_event_age"] = max_event_age
|
|
1100
|
+
if retry_attempts is not None:
|
|
1101
|
+
self._values["retry_attempts"] = retry_attempts
|
|
1102
|
+
if role is not None:
|
|
1103
|
+
self._values["role"] = role
|
|
1104
|
+
if message_group_id is not None:
|
|
1105
|
+
self._values["message_group_id"] = message_group_id
|
|
1106
|
+
|
|
1107
|
+
@builtins.property
|
|
1108
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
1109
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
1110
|
+
|
|
1111
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
1112
|
+
depending on the retry policy of the target.
|
|
1113
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
1114
|
+
|
|
1115
|
+
:default: - no dead-letter queue
|
|
1116
|
+
'''
|
|
1117
|
+
result = self._values.get("dead_letter_queue")
|
|
1118
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
1119
|
+
|
|
1120
|
+
@builtins.property
|
|
1121
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
1122
|
+
'''Input passed to the target.
|
|
1123
|
+
|
|
1124
|
+
:default: - no input.
|
|
1125
|
+
'''
|
|
1126
|
+
result = self._values.get("input")
|
|
1127
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
1128
|
+
|
|
1129
|
+
@builtins.property
|
|
1130
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
1131
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
1132
|
+
|
|
1133
|
+
Minimum value of 60.
|
|
1134
|
+
Maximum value of 86400.
|
|
1135
|
+
|
|
1136
|
+
:default: Duration.hours(24)
|
|
1137
|
+
'''
|
|
1138
|
+
result = self._values.get("max_event_age")
|
|
1139
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
1140
|
+
|
|
1141
|
+
@builtins.property
|
|
1142
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
1143
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
1144
|
+
|
|
1145
|
+
Minimum value of 0.
|
|
1146
|
+
Maximum value of 185.
|
|
1147
|
+
|
|
1148
|
+
:default: 185
|
|
1149
|
+
'''
|
|
1150
|
+
result = self._values.get("retry_attempts")
|
|
1151
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
1152
|
+
|
|
1153
|
+
@builtins.property
|
|
1154
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
1155
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
1156
|
+
|
|
1157
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
1158
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
1159
|
+
will grant minimal required permissions.
|
|
1160
|
+
|
|
1161
|
+
:default: - created by target
|
|
1162
|
+
'''
|
|
1163
|
+
result = self._values.get("role")
|
|
1164
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
1165
|
+
|
|
1166
|
+
@builtins.property
|
|
1167
|
+
def message_group_id(self) -> typing.Optional[builtins.str]:
|
|
1168
|
+
'''The FIFO message group ID to use as the target.
|
|
1169
|
+
|
|
1170
|
+
This must be specified when the target is a FIFO queue. If you specify
|
|
1171
|
+
a FIFO queue as a target, the queue must have content-based deduplication enabled.
|
|
1172
|
+
|
|
1173
|
+
A length of ``messageGroupId`` must be between 1 and 128.
|
|
1174
|
+
|
|
1175
|
+
:default: - no message group ID
|
|
1176
|
+
|
|
1177
|
+
:see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-sqsparameters.html#cfn-scheduler-schedule-sqsparameters-messagegroupid
|
|
1178
|
+
'''
|
|
1179
|
+
result = self._values.get("message_group_id")
|
|
1180
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
1181
|
+
|
|
1182
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1183
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1184
|
+
|
|
1185
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1186
|
+
return not (rhs == self)
|
|
1187
|
+
|
|
1188
|
+
def __repr__(self) -> str:
|
|
1189
|
+
return "SqsSendMessageProps(%s)" % ", ".join(
|
|
1190
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1191
|
+
)
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
1195
|
+
class StepFunctionsStartExecution(
|
|
1196
|
+
ScheduleTargetBase,
|
|
1197
|
+
metaclass=jsii.JSIIMeta,
|
|
1198
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.StepFunctionsStartExecution",
|
|
1199
|
+
):
|
|
1200
|
+
'''Use an AWS Step function as a target for AWS EventBridge Scheduler.
|
|
1201
|
+
|
|
1202
|
+
:exampleMetadata: infused
|
|
1203
|
+
|
|
1204
|
+
Example::
|
|
1205
|
+
|
|
1206
|
+
import aws_cdk.aws_stepfunctions as sfn
|
|
1207
|
+
import aws_cdk.aws_stepfunctions_tasks as tasks
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
payload = {
|
|
1211
|
+
"Name": "MyParameter",
|
|
1212
|
+
"Value": "🌥️"
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
put_parameter_step = tasks.CallAwsService(self, "PutParameter",
|
|
1216
|
+
service="ssm",
|
|
1217
|
+
action="putParameter",
|
|
1218
|
+
iam_resources=["*"],
|
|
1219
|
+
parameters={
|
|
1220
|
+
"Name.$": "$.Name",
|
|
1221
|
+
"Value.$": "$.Value",
|
|
1222
|
+
"Type": "String",
|
|
1223
|
+
"Overwrite": True
|
|
1224
|
+
}
|
|
1225
|
+
)
|
|
1226
|
+
|
|
1227
|
+
state_machine = sfn.StateMachine(self, "StateMachine",
|
|
1228
|
+
definition_body=sfn.DefinitionBody.from_chainable(put_parameter_step)
|
|
1229
|
+
)
|
|
1230
|
+
|
|
1231
|
+
Schedule(self, "Schedule",
|
|
1232
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
1233
|
+
target=targets.StepFunctionsStartExecution(state_machine,
|
|
1234
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
1235
|
+
)
|
|
1236
|
+
)
|
|
1237
|
+
'''
|
|
1238
|
+
|
|
1239
|
+
def __init__(
|
|
1240
|
+
self,
|
|
1241
|
+
state_machine: _IStateMachine_73e8d2b0,
|
|
1242
|
+
*,
|
|
1243
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1244
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1245
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1246
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1247
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1248
|
+
) -> None:
|
|
1249
|
+
'''
|
|
1250
|
+
:param state_machine: -
|
|
1251
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1252
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1253
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1254
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1255
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1256
|
+
'''
|
|
1257
|
+
if __debug__:
|
|
1258
|
+
type_hints = typing.get_type_hints(_typecheckingstub__f6f72a14975c4b50622c65c3545124a5a40541c99ee789b2764dd89dbe6db65e)
|
|
1259
|
+
check_type(argname="argument state_machine", value=state_machine, expected_type=type_hints["state_machine"])
|
|
1260
|
+
props = ScheduleTargetBaseProps(
|
|
1261
|
+
dead_letter_queue=dead_letter_queue,
|
|
1262
|
+
input=input,
|
|
1263
|
+
max_event_age=max_event_age,
|
|
1264
|
+
retry_attempts=retry_attempts,
|
|
1265
|
+
role=role,
|
|
1266
|
+
)
|
|
1267
|
+
|
|
1268
|
+
jsii.create(self.__class__, self, [state_machine, props])
|
|
1269
|
+
|
|
1270
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1271
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1272
|
+
'''
|
|
1273
|
+
:param role: -
|
|
1274
|
+
'''
|
|
1275
|
+
if __debug__:
|
|
1276
|
+
type_hints = typing.get_type_hints(_typecheckingstub__bdb74e28e429f1b8574596c9b7d69dbbe6d4a87709fe0afeee3a982c558eefa6)
|
|
1277
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1278
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
@jsii.data_type(
|
|
1282
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.Tag",
|
|
1283
|
+
jsii_struct_bases=[],
|
|
1284
|
+
name_mapping={"key": "key", "value": "value"},
|
|
1285
|
+
)
|
|
1286
|
+
class Tag:
|
|
1287
|
+
def __init__(self, *, key: builtins.str, value: builtins.str) -> None:
|
|
1288
|
+
'''Metadata that you apply to a resource to help categorize and organize the resource.
|
|
1289
|
+
|
|
1290
|
+
Each tag consists of a key and an optional value, both of which you define.
|
|
1291
|
+
|
|
1292
|
+
:param key: Key is the name of the tag.
|
|
1293
|
+
:param value: Value is the metadata contents of the tag.
|
|
1294
|
+
|
|
1295
|
+
:exampleMetadata: fixture=_generated
|
|
1296
|
+
|
|
1297
|
+
Example::
|
|
1298
|
+
|
|
1299
|
+
# The code below shows an example of how to instantiate this type.
|
|
1300
|
+
# The values are placeholders you should change.
|
|
1301
|
+
from aws_cdk import aws_scheduler_targets as scheduler_targets
|
|
1302
|
+
|
|
1303
|
+
tag = scheduler_targets.Tag(
|
|
1304
|
+
key="key",
|
|
1305
|
+
value="value"
|
|
1306
|
+
)
|
|
1307
|
+
'''
|
|
1308
|
+
if __debug__:
|
|
1309
|
+
type_hints = typing.get_type_hints(_typecheckingstub__8d7e0165c9edbeca9c1f67729ca5e04e783483e5161d761577189cfb4595daf8)
|
|
1310
|
+
check_type(argname="argument key", value=key, expected_type=type_hints["key"])
|
|
1311
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
1312
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1313
|
+
"key": key,
|
|
1314
|
+
"value": value,
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
@builtins.property
|
|
1318
|
+
def key(self) -> builtins.str:
|
|
1319
|
+
'''Key is the name of the tag.'''
|
|
1320
|
+
result = self._values.get("key")
|
|
1321
|
+
assert result is not None, "Required property 'key' is missing"
|
|
1322
|
+
return typing.cast(builtins.str, result)
|
|
1323
|
+
|
|
1324
|
+
@builtins.property
|
|
1325
|
+
def value(self) -> builtins.str:
|
|
1326
|
+
'''Value is the metadata contents of the tag.'''
|
|
1327
|
+
result = self._values.get("value")
|
|
1328
|
+
assert result is not None, "Required property 'value' is missing"
|
|
1329
|
+
return typing.cast(builtins.str, result)
|
|
1330
|
+
|
|
1331
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1332
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1333
|
+
|
|
1334
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1335
|
+
return not (rhs == self)
|
|
1336
|
+
|
|
1337
|
+
def __repr__(self) -> str:
|
|
1338
|
+
return "Tag(%s)" % ", ".join(
|
|
1339
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1340
|
+
)
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
1344
|
+
class Universal(
|
|
1345
|
+
ScheduleTargetBase,
|
|
1346
|
+
metaclass=jsii.JSIIMeta,
|
|
1347
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.Universal",
|
|
1348
|
+
):
|
|
1349
|
+
'''Use a wider set of AWS API as a target for AWS EventBridge Scheduler.
|
|
1350
|
+
|
|
1351
|
+
:see: https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html
|
|
1352
|
+
:exampleMetadata: infused
|
|
1353
|
+
|
|
1354
|
+
Example::
|
|
1355
|
+
|
|
1356
|
+
Schedule(self, "Schedule",
|
|
1357
|
+
schedule=ScheduleExpression.cron(
|
|
1358
|
+
minute="0",
|
|
1359
|
+
hour="0"
|
|
1360
|
+
),
|
|
1361
|
+
target=targets.Universal(
|
|
1362
|
+
service="rds",
|
|
1363
|
+
action="stopDBCluster",
|
|
1364
|
+
input=ScheduleTargetInput.from_object({
|
|
1365
|
+
"DbClusterIdentifier": "my-db"
|
|
1366
|
+
})
|
|
1367
|
+
)
|
|
1368
|
+
)
|
|
1369
|
+
'''
|
|
1370
|
+
|
|
1371
|
+
def __init__(
|
|
1372
|
+
self,
|
|
1373
|
+
*,
|
|
1374
|
+
action: builtins.str,
|
|
1375
|
+
service: builtins.str,
|
|
1376
|
+
policy_statements: typing.Optional[typing.Sequence[_PolicyStatement_0fe33853]] = None,
|
|
1377
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1378
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1379
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1380
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1381
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1382
|
+
) -> None:
|
|
1383
|
+
'''
|
|
1384
|
+
:param action: The API action to call. Must be camelCase. You cannot use read-only API actions such as common GET operations.
|
|
1385
|
+
:param service: The AWS service to call. This must be in lowercase.
|
|
1386
|
+
:param policy_statements: The IAM policy statements needed to invoke the target. These statements are attached to the Scheduler's role. Note that the default may not be the correct actions as not all AWS services follows the same IAM action pattern, or there may be more actions needed to invoke the target. Default: - Policy with ``service:action`` action only.
|
|
1387
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1388
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1389
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1390
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1391
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1392
|
+
'''
|
|
1393
|
+
props = UniversalTargetProps(
|
|
1394
|
+
action=action,
|
|
1395
|
+
service=service,
|
|
1396
|
+
policy_statements=policy_statements,
|
|
1397
|
+
dead_letter_queue=dead_letter_queue,
|
|
1398
|
+
input=input,
|
|
1399
|
+
max_event_age=max_event_age,
|
|
1400
|
+
retry_attempts=retry_attempts,
|
|
1401
|
+
role=role,
|
|
1402
|
+
)
|
|
1403
|
+
|
|
1404
|
+
jsii.create(self.__class__, self, [props])
|
|
1405
|
+
|
|
1406
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1407
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1408
|
+
'''
|
|
1409
|
+
:param role: -
|
|
1410
|
+
'''
|
|
1411
|
+
if __debug__:
|
|
1412
|
+
type_hints = typing.get_type_hints(_typecheckingstub__198e835ff77413b2cbd7a9aad16223af355077748c1e61e3dc51f2c3390c66ca)
|
|
1413
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1414
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
@jsii.data_type(
|
|
1418
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.UniversalTargetProps",
|
|
1419
|
+
jsii_struct_bases=[ScheduleTargetBaseProps],
|
|
1420
|
+
name_mapping={
|
|
1421
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
1422
|
+
"input": "input",
|
|
1423
|
+
"max_event_age": "maxEventAge",
|
|
1424
|
+
"retry_attempts": "retryAttempts",
|
|
1425
|
+
"role": "role",
|
|
1426
|
+
"action": "action",
|
|
1427
|
+
"service": "service",
|
|
1428
|
+
"policy_statements": "policyStatements",
|
|
1429
|
+
},
|
|
1430
|
+
)
|
|
1431
|
+
class UniversalTargetProps(ScheduleTargetBaseProps):
|
|
1432
|
+
def __init__(
|
|
1433
|
+
self,
|
|
1434
|
+
*,
|
|
1435
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1436
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1437
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1438
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1439
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1440
|
+
action: builtins.str,
|
|
1441
|
+
service: builtins.str,
|
|
1442
|
+
policy_statements: typing.Optional[typing.Sequence[_PolicyStatement_0fe33853]] = None,
|
|
1443
|
+
) -> None:
|
|
1444
|
+
'''Properties for a Universal Target.
|
|
1445
|
+
|
|
1446
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1447
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1448
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1449
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1450
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1451
|
+
:param action: The API action to call. Must be camelCase. You cannot use read-only API actions such as common GET operations.
|
|
1452
|
+
:param service: The AWS service to call. This must be in lowercase.
|
|
1453
|
+
:param policy_statements: The IAM policy statements needed to invoke the target. These statements are attached to the Scheduler's role. Note that the default may not be the correct actions as not all AWS services follows the same IAM action pattern, or there may be more actions needed to invoke the target. Default: - Policy with ``service:action`` action only.
|
|
1454
|
+
|
|
1455
|
+
:exampleMetadata: infused
|
|
1456
|
+
|
|
1457
|
+
Example::
|
|
1458
|
+
|
|
1459
|
+
Schedule(self, "Schedule",
|
|
1460
|
+
schedule=ScheduleExpression.cron(
|
|
1461
|
+
minute="0",
|
|
1462
|
+
hour="0"
|
|
1463
|
+
),
|
|
1464
|
+
target=targets.Universal(
|
|
1465
|
+
service="rds",
|
|
1466
|
+
action="stopDBCluster",
|
|
1467
|
+
input=ScheduleTargetInput.from_object({
|
|
1468
|
+
"DbClusterIdentifier": "my-db"
|
|
1469
|
+
})
|
|
1470
|
+
)
|
|
1471
|
+
)
|
|
1472
|
+
'''
|
|
1473
|
+
if __debug__:
|
|
1474
|
+
type_hints = typing.get_type_hints(_typecheckingstub__7aebf9e651de63ef570a11970d3762c22b62acdcb5386c5ba69076181e926f71)
|
|
1475
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
1476
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
1477
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
1478
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
1479
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1480
|
+
check_type(argname="argument action", value=action, expected_type=type_hints["action"])
|
|
1481
|
+
check_type(argname="argument service", value=service, expected_type=type_hints["service"])
|
|
1482
|
+
check_type(argname="argument policy_statements", value=policy_statements, expected_type=type_hints["policy_statements"])
|
|
1483
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1484
|
+
"action": action,
|
|
1485
|
+
"service": service,
|
|
1486
|
+
}
|
|
1487
|
+
if dead_letter_queue is not None:
|
|
1488
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
1489
|
+
if input is not None:
|
|
1490
|
+
self._values["input"] = input
|
|
1491
|
+
if max_event_age is not None:
|
|
1492
|
+
self._values["max_event_age"] = max_event_age
|
|
1493
|
+
if retry_attempts is not None:
|
|
1494
|
+
self._values["retry_attempts"] = retry_attempts
|
|
1495
|
+
if role is not None:
|
|
1496
|
+
self._values["role"] = role
|
|
1497
|
+
if policy_statements is not None:
|
|
1498
|
+
self._values["policy_statements"] = policy_statements
|
|
1499
|
+
|
|
1500
|
+
@builtins.property
|
|
1501
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
1502
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
1503
|
+
|
|
1504
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
1505
|
+
depending on the retry policy of the target.
|
|
1506
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
1507
|
+
|
|
1508
|
+
:default: - no dead-letter queue
|
|
1509
|
+
'''
|
|
1510
|
+
result = self._values.get("dead_letter_queue")
|
|
1511
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
1512
|
+
|
|
1513
|
+
@builtins.property
|
|
1514
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
1515
|
+
'''Input passed to the target.
|
|
1516
|
+
|
|
1517
|
+
:default: - no input.
|
|
1518
|
+
'''
|
|
1519
|
+
result = self._values.get("input")
|
|
1520
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
1521
|
+
|
|
1522
|
+
@builtins.property
|
|
1523
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
1524
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
1525
|
+
|
|
1526
|
+
Minimum value of 60.
|
|
1527
|
+
Maximum value of 86400.
|
|
1528
|
+
|
|
1529
|
+
:default: Duration.hours(24)
|
|
1530
|
+
'''
|
|
1531
|
+
result = self._values.get("max_event_age")
|
|
1532
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
1533
|
+
|
|
1534
|
+
@builtins.property
|
|
1535
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
1536
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
1537
|
+
|
|
1538
|
+
Minimum value of 0.
|
|
1539
|
+
Maximum value of 185.
|
|
1540
|
+
|
|
1541
|
+
:default: 185
|
|
1542
|
+
'''
|
|
1543
|
+
result = self._values.get("retry_attempts")
|
|
1544
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
1545
|
+
|
|
1546
|
+
@builtins.property
|
|
1547
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
1548
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
1549
|
+
|
|
1550
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
1551
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
1552
|
+
will grant minimal required permissions.
|
|
1553
|
+
|
|
1554
|
+
:default: - created by target
|
|
1555
|
+
'''
|
|
1556
|
+
result = self._values.get("role")
|
|
1557
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
1558
|
+
|
|
1559
|
+
@builtins.property
|
|
1560
|
+
def action(self) -> builtins.str:
|
|
1561
|
+
'''The API action to call. Must be camelCase.
|
|
1562
|
+
|
|
1563
|
+
You cannot use read-only API actions such as common GET operations.
|
|
1564
|
+
|
|
1565
|
+
:see: https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html#unsupported-api-actions
|
|
1566
|
+
'''
|
|
1567
|
+
result = self._values.get("action")
|
|
1568
|
+
assert result is not None, "Required property 'action' is missing"
|
|
1569
|
+
return typing.cast(builtins.str, result)
|
|
1570
|
+
|
|
1571
|
+
@builtins.property
|
|
1572
|
+
def service(self) -> builtins.str:
|
|
1573
|
+
'''The AWS service to call.
|
|
1574
|
+
|
|
1575
|
+
This must be in lowercase.
|
|
1576
|
+
'''
|
|
1577
|
+
result = self._values.get("service")
|
|
1578
|
+
assert result is not None, "Required property 'service' is missing"
|
|
1579
|
+
return typing.cast(builtins.str, result)
|
|
1580
|
+
|
|
1581
|
+
@builtins.property
|
|
1582
|
+
def policy_statements(
|
|
1583
|
+
self,
|
|
1584
|
+
) -> typing.Optional[typing.List[_PolicyStatement_0fe33853]]:
|
|
1585
|
+
'''The IAM policy statements needed to invoke the target. These statements are attached to the Scheduler's role.
|
|
1586
|
+
|
|
1587
|
+
Note that the default may not be the correct actions as not all AWS services follows the same IAM action pattern, or there may be more actions needed to invoke the target.
|
|
1588
|
+
|
|
1589
|
+
:default: - Policy with ``service:action`` action only.
|
|
1590
|
+
'''
|
|
1591
|
+
result = self._values.get("policy_statements")
|
|
1592
|
+
return typing.cast(typing.Optional[typing.List[_PolicyStatement_0fe33853]], result)
|
|
1593
|
+
|
|
1594
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1595
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1596
|
+
|
|
1597
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1598
|
+
return not (rhs == self)
|
|
1599
|
+
|
|
1600
|
+
def __repr__(self) -> str:
|
|
1601
|
+
return "UniversalTargetProps(%s)" % ", ".join(
|
|
1602
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1603
|
+
)
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
1607
|
+
class CodeBuildStartBuild(
|
|
1608
|
+
ScheduleTargetBase,
|
|
1609
|
+
metaclass=jsii.JSIIMeta,
|
|
1610
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.CodeBuildStartBuild",
|
|
1611
|
+
):
|
|
1612
|
+
'''Use an AWS CodeBuild as a target for AWS EventBridge Scheduler.
|
|
1613
|
+
|
|
1614
|
+
:exampleMetadata: infused
|
|
1615
|
+
|
|
1616
|
+
Example::
|
|
1617
|
+
|
|
1618
|
+
import aws_cdk.aws_codebuild as codebuild
|
|
1619
|
+
|
|
1620
|
+
# project: codebuild.Project
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
Schedule(self, "Schedule",
|
|
1624
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
1625
|
+
target=targets.CodeBuildStartBuild(project)
|
|
1626
|
+
)
|
|
1627
|
+
'''
|
|
1628
|
+
|
|
1629
|
+
def __init__(
|
|
1630
|
+
self,
|
|
1631
|
+
project: _IProject_aafae30a,
|
|
1632
|
+
*,
|
|
1633
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1634
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1635
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1636
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1637
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1638
|
+
) -> None:
|
|
1639
|
+
'''
|
|
1640
|
+
:param project: -
|
|
1641
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1642
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1643
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1644
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1645
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1646
|
+
'''
|
|
1647
|
+
if __debug__:
|
|
1648
|
+
type_hints = typing.get_type_hints(_typecheckingstub__eacc4f0e06890a24c88fe0c8814a8e396c6c6442e38857fee0168c08fca876ea)
|
|
1649
|
+
check_type(argname="argument project", value=project, expected_type=type_hints["project"])
|
|
1650
|
+
props = ScheduleTargetBaseProps(
|
|
1651
|
+
dead_letter_queue=dead_letter_queue,
|
|
1652
|
+
input=input,
|
|
1653
|
+
max_event_age=max_event_age,
|
|
1654
|
+
retry_attempts=retry_attempts,
|
|
1655
|
+
role=role,
|
|
1656
|
+
)
|
|
1657
|
+
|
|
1658
|
+
jsii.create(self.__class__, self, [project, props])
|
|
1659
|
+
|
|
1660
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1661
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1662
|
+
'''
|
|
1663
|
+
:param role: -
|
|
1664
|
+
'''
|
|
1665
|
+
if __debug__:
|
|
1666
|
+
type_hints = typing.get_type_hints(_typecheckingstub__7638691fb0294fb00596be4967a0508a1091ee4b552678b943b548af397963ba)
|
|
1667
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1668
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
1672
|
+
class CodePipelineStartPipelineExecution(
|
|
1673
|
+
ScheduleTargetBase,
|
|
1674
|
+
metaclass=jsii.JSIIMeta,
|
|
1675
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.CodePipelineStartPipelineExecution",
|
|
1676
|
+
):
|
|
1677
|
+
'''Use an AWS CodePipeline pipeline as a target for AWS EventBridge Scheduler.
|
|
1678
|
+
|
|
1679
|
+
:exampleMetadata: infused
|
|
1680
|
+
|
|
1681
|
+
Example::
|
|
1682
|
+
|
|
1683
|
+
import aws_cdk.aws_codepipeline as codepipeline
|
|
1684
|
+
|
|
1685
|
+
# pipeline: codepipeline.Pipeline
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
Schedule(self, "Schedule",
|
|
1689
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
1690
|
+
target=targets.CodePipelineStartPipelineExecution(pipeline)
|
|
1691
|
+
)
|
|
1692
|
+
'''
|
|
1693
|
+
|
|
1694
|
+
def __init__(
|
|
1695
|
+
self,
|
|
1696
|
+
pipeline: _IPipeline_0931f838,
|
|
1697
|
+
*,
|
|
1698
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1699
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1700
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1701
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1702
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1703
|
+
) -> None:
|
|
1704
|
+
'''
|
|
1705
|
+
:param pipeline: -
|
|
1706
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1707
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1708
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1709
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1710
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1711
|
+
'''
|
|
1712
|
+
if __debug__:
|
|
1713
|
+
type_hints = typing.get_type_hints(_typecheckingstub__f972d090ad80411fc0dff42233ee8b4ff2a48be68b7d646d1c7606a3cfb7fe56)
|
|
1714
|
+
check_type(argname="argument pipeline", value=pipeline, expected_type=type_hints["pipeline"])
|
|
1715
|
+
props = ScheduleTargetBaseProps(
|
|
1716
|
+
dead_letter_queue=dead_letter_queue,
|
|
1717
|
+
input=input,
|
|
1718
|
+
max_event_age=max_event_age,
|
|
1719
|
+
retry_attempts=retry_attempts,
|
|
1720
|
+
role=role,
|
|
1721
|
+
)
|
|
1722
|
+
|
|
1723
|
+
jsii.create(self.__class__, self, [pipeline, props])
|
|
1724
|
+
|
|
1725
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1726
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1727
|
+
'''
|
|
1728
|
+
:param role: -
|
|
1729
|
+
'''
|
|
1730
|
+
if __debug__:
|
|
1731
|
+
type_hints = typing.get_type_hints(_typecheckingstub__31c5911116f5629c2adf9d1968007740095affaa6dad806ac8e1672101368386)
|
|
1732
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1733
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1734
|
+
|
|
1735
|
+
|
|
1736
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
1737
|
+
class EcsRunTask(
|
|
1738
|
+
ScheduleTargetBase,
|
|
1739
|
+
metaclass=jsii.JSIIAbstractClass,
|
|
1740
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EcsRunTask",
|
|
1741
|
+
):
|
|
1742
|
+
'''Schedule an ECS Task using AWS EventBridge Scheduler.'''
|
|
1743
|
+
|
|
1744
|
+
def __init__(
|
|
1745
|
+
self,
|
|
1746
|
+
cluster: _ICluster_16cddd09,
|
|
1747
|
+
*,
|
|
1748
|
+
task_definition: _TaskDefinition_a541a103,
|
|
1749
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1750
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
1751
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
1752
|
+
group: typing.Optional[builtins.str] = None,
|
|
1753
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
1754
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
1755
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
1756
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1757
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
1758
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1759
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1760
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1761
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1762
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1763
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1764
|
+
) -> None:
|
|
1765
|
+
'''
|
|
1766
|
+
:param cluster: -
|
|
1767
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
1768
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
1769
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
1770
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
1771
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
1772
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
1773
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
1774
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
1775
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
1776
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
1777
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
1778
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1779
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1780
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1781
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1782
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1783
|
+
'''
|
|
1784
|
+
if __debug__:
|
|
1785
|
+
type_hints = typing.get_type_hints(_typecheckingstub__7ddc91e6308e91fc95fa167254f8538961d19df122eeefb13d6881448afdc147)
|
|
1786
|
+
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
1787
|
+
props = EcsRunTaskBaseProps(
|
|
1788
|
+
task_definition=task_definition,
|
|
1789
|
+
capacity_provider_strategies=capacity_provider_strategies,
|
|
1790
|
+
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
1791
|
+
enable_execute_command=enable_execute_command,
|
|
1792
|
+
group=group,
|
|
1793
|
+
propagate_tags=propagate_tags,
|
|
1794
|
+
reference_id=reference_id,
|
|
1795
|
+
security_groups=security_groups,
|
|
1796
|
+
tags=tags,
|
|
1797
|
+
task_count=task_count,
|
|
1798
|
+
vpc_subnets=vpc_subnets,
|
|
1799
|
+
dead_letter_queue=dead_letter_queue,
|
|
1800
|
+
input=input,
|
|
1801
|
+
max_event_age=max_event_age,
|
|
1802
|
+
retry_attempts=retry_attempts,
|
|
1803
|
+
role=role,
|
|
1804
|
+
)
|
|
1805
|
+
|
|
1806
|
+
jsii.create(self.__class__, self, [cluster, props])
|
|
1807
|
+
|
|
1808
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
1809
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
1810
|
+
'''
|
|
1811
|
+
:param role: -
|
|
1812
|
+
'''
|
|
1813
|
+
if __debug__:
|
|
1814
|
+
type_hints = typing.get_type_hints(_typecheckingstub__79f6648875df7112d642839162e2032e0cc5691244ea631e24984dc06b70af68)
|
|
1815
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1816
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
1817
|
+
|
|
1818
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
1819
|
+
def _bind_base_target_config(
|
|
1820
|
+
self,
|
|
1821
|
+
_schedule: _ISchedule_4a32574d,
|
|
1822
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
1823
|
+
'''
|
|
1824
|
+
:param _schedule: -
|
|
1825
|
+
'''
|
|
1826
|
+
if __debug__:
|
|
1827
|
+
type_hints = typing.get_type_hints(_typecheckingstub__658a297adc726b826b6ad0f740dd1153f7cd0ec47ab734b7e0c3748d30bd5285)
|
|
1828
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
1829
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
1830
|
+
|
|
1831
|
+
@builtins.property
|
|
1832
|
+
@jsii.member(jsii_name="cluster")
|
|
1833
|
+
def _cluster(self) -> _ICluster_16cddd09:
|
|
1834
|
+
return typing.cast(_ICluster_16cddd09, jsii.get(self, "cluster"))
|
|
1835
|
+
|
|
1836
|
+
@builtins.property
|
|
1837
|
+
@jsii.member(jsii_name="props")
|
|
1838
|
+
def _props(self) -> "EcsRunTaskBaseProps":
|
|
1839
|
+
return typing.cast("EcsRunTaskBaseProps", jsii.get(self, "props"))
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
class _EcsRunTaskProxy(
|
|
1843
|
+
EcsRunTask,
|
|
1844
|
+
jsii.proxy_for(ScheduleTargetBase), # type: ignore[misc]
|
|
1845
|
+
):
|
|
1846
|
+
pass
|
|
1847
|
+
|
|
1848
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
|
|
1849
|
+
typing.cast(typing.Any, EcsRunTask).__jsii_proxy_class__ = lambda : _EcsRunTaskProxy
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
@jsii.data_type(
|
|
1853
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EcsRunTaskBaseProps",
|
|
1854
|
+
jsii_struct_bases=[ScheduleTargetBaseProps],
|
|
1855
|
+
name_mapping={
|
|
1856
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
1857
|
+
"input": "input",
|
|
1858
|
+
"max_event_age": "maxEventAge",
|
|
1859
|
+
"retry_attempts": "retryAttempts",
|
|
1860
|
+
"role": "role",
|
|
1861
|
+
"task_definition": "taskDefinition",
|
|
1862
|
+
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
1863
|
+
"enable_ecs_managed_tags": "enableEcsManagedTags",
|
|
1864
|
+
"enable_execute_command": "enableExecuteCommand",
|
|
1865
|
+
"group": "group",
|
|
1866
|
+
"propagate_tags": "propagateTags",
|
|
1867
|
+
"reference_id": "referenceId",
|
|
1868
|
+
"security_groups": "securityGroups",
|
|
1869
|
+
"tags": "tags",
|
|
1870
|
+
"task_count": "taskCount",
|
|
1871
|
+
"vpc_subnets": "vpcSubnets",
|
|
1872
|
+
},
|
|
1873
|
+
)
|
|
1874
|
+
class EcsRunTaskBaseProps(ScheduleTargetBaseProps):
|
|
1875
|
+
def __init__(
|
|
1876
|
+
self,
|
|
1877
|
+
*,
|
|
1878
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1879
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
1880
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1881
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
1882
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1883
|
+
task_definition: _TaskDefinition_a541a103,
|
|
1884
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1885
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
1886
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
1887
|
+
group: typing.Optional[builtins.str] = None,
|
|
1888
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
1889
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
1890
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
1891
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1892
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
1893
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1894
|
+
) -> None:
|
|
1895
|
+
'''Parameters for scheduling ECS Run Task (common to EC2 and Fargate launch types).
|
|
1896
|
+
|
|
1897
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1898
|
+
:param input: Input passed to the target. Default: - no input.
|
|
1899
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1900
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
1901
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
1902
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
1903
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
1904
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
1905
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
1906
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
1907
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
1908
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
1909
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
1910
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
1911
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
1912
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
1913
|
+
|
|
1914
|
+
:exampleMetadata: fixture=_generated
|
|
1915
|
+
|
|
1916
|
+
Example::
|
|
1917
|
+
|
|
1918
|
+
# The code below shows an example of how to instantiate this type.
|
|
1919
|
+
# The values are placeholders you should change.
|
|
1920
|
+
import aws_cdk as cdk
|
|
1921
|
+
from aws_cdk import aws_ec2 as ec2
|
|
1922
|
+
from aws_cdk import aws_ecs as ecs
|
|
1923
|
+
from aws_cdk import aws_iam as iam
|
|
1924
|
+
from aws_cdk import aws_scheduler as scheduler
|
|
1925
|
+
from aws_cdk import aws_scheduler_targets as scheduler_targets
|
|
1926
|
+
from aws_cdk import aws_sqs as sqs
|
|
1927
|
+
|
|
1928
|
+
# queue: sqs.Queue
|
|
1929
|
+
# role: iam.Role
|
|
1930
|
+
# schedule_target_input: scheduler.ScheduleTargetInput
|
|
1931
|
+
# security_group: ec2.SecurityGroup
|
|
1932
|
+
# subnet: ec2.Subnet
|
|
1933
|
+
# subnet_filter: ec2.SubnetFilter
|
|
1934
|
+
# task_definition: ecs.TaskDefinition
|
|
1935
|
+
|
|
1936
|
+
ecs_run_task_base_props = scheduler_targets.EcsRunTaskBaseProps(
|
|
1937
|
+
task_definition=task_definition,
|
|
1938
|
+
|
|
1939
|
+
# the properties below are optional
|
|
1940
|
+
capacity_provider_strategies=[ecs.CapacityProviderStrategy(
|
|
1941
|
+
capacity_provider="capacityProvider",
|
|
1942
|
+
|
|
1943
|
+
# the properties below are optional
|
|
1944
|
+
base=123,
|
|
1945
|
+
weight=123
|
|
1946
|
+
)],
|
|
1947
|
+
dead_letter_queue=queue,
|
|
1948
|
+
enable_ecs_managed_tags=False,
|
|
1949
|
+
enable_execute_command=False,
|
|
1950
|
+
group="group",
|
|
1951
|
+
input=schedule_target_input,
|
|
1952
|
+
max_event_age=cdk.Duration.minutes(30),
|
|
1953
|
+
propagate_tags=False,
|
|
1954
|
+
reference_id="referenceId",
|
|
1955
|
+
retry_attempts=123,
|
|
1956
|
+
role=role,
|
|
1957
|
+
security_groups=[security_group],
|
|
1958
|
+
tags=[scheduler_targets.Tag(
|
|
1959
|
+
key="key",
|
|
1960
|
+
value="value"
|
|
1961
|
+
)],
|
|
1962
|
+
task_count=123,
|
|
1963
|
+
vpc_subnets=ec2.SubnetSelection(
|
|
1964
|
+
availability_zones=["availabilityZones"],
|
|
1965
|
+
one_per_az=False,
|
|
1966
|
+
subnet_filters=[subnet_filter],
|
|
1967
|
+
subnet_group_name="subnetGroupName",
|
|
1968
|
+
subnets=[subnet],
|
|
1969
|
+
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
1970
|
+
)
|
|
1971
|
+
)
|
|
1972
|
+
'''
|
|
1973
|
+
if isinstance(vpc_subnets, dict):
|
|
1974
|
+
vpc_subnets = _SubnetSelection_e57d76df(**vpc_subnets)
|
|
1975
|
+
if __debug__:
|
|
1976
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c784746a1d7efa2d6a0675e480c2ab5615af6620ac4fc75d4bc282aeb3ca6632)
|
|
1977
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
1978
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
1979
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
1980
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
1981
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
1982
|
+
check_type(argname="argument task_definition", value=task_definition, expected_type=type_hints["task_definition"])
|
|
1983
|
+
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
1984
|
+
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
1985
|
+
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
1986
|
+
check_type(argname="argument group", value=group, expected_type=type_hints["group"])
|
|
1987
|
+
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
1988
|
+
check_type(argname="argument reference_id", value=reference_id, expected_type=type_hints["reference_id"])
|
|
1989
|
+
check_type(argname="argument security_groups", value=security_groups, expected_type=type_hints["security_groups"])
|
|
1990
|
+
check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
|
|
1991
|
+
check_type(argname="argument task_count", value=task_count, expected_type=type_hints["task_count"])
|
|
1992
|
+
check_type(argname="argument vpc_subnets", value=vpc_subnets, expected_type=type_hints["vpc_subnets"])
|
|
1993
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1994
|
+
"task_definition": task_definition,
|
|
1995
|
+
}
|
|
1996
|
+
if dead_letter_queue is not None:
|
|
1997
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
1998
|
+
if input is not None:
|
|
1999
|
+
self._values["input"] = input
|
|
2000
|
+
if max_event_age is not None:
|
|
2001
|
+
self._values["max_event_age"] = max_event_age
|
|
2002
|
+
if retry_attempts is not None:
|
|
2003
|
+
self._values["retry_attempts"] = retry_attempts
|
|
2004
|
+
if role is not None:
|
|
2005
|
+
self._values["role"] = role
|
|
2006
|
+
if capacity_provider_strategies is not None:
|
|
2007
|
+
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
2008
|
+
if enable_ecs_managed_tags is not None:
|
|
2009
|
+
self._values["enable_ecs_managed_tags"] = enable_ecs_managed_tags
|
|
2010
|
+
if enable_execute_command is not None:
|
|
2011
|
+
self._values["enable_execute_command"] = enable_execute_command
|
|
2012
|
+
if group is not None:
|
|
2013
|
+
self._values["group"] = group
|
|
2014
|
+
if propagate_tags is not None:
|
|
2015
|
+
self._values["propagate_tags"] = propagate_tags
|
|
2016
|
+
if reference_id is not None:
|
|
2017
|
+
self._values["reference_id"] = reference_id
|
|
2018
|
+
if security_groups is not None:
|
|
2019
|
+
self._values["security_groups"] = security_groups
|
|
2020
|
+
if tags is not None:
|
|
2021
|
+
self._values["tags"] = tags
|
|
2022
|
+
if task_count is not None:
|
|
2023
|
+
self._values["task_count"] = task_count
|
|
2024
|
+
if vpc_subnets is not None:
|
|
2025
|
+
self._values["vpc_subnets"] = vpc_subnets
|
|
2026
|
+
|
|
2027
|
+
@builtins.property
|
|
2028
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
2029
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
2030
|
+
|
|
2031
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
2032
|
+
depending on the retry policy of the target.
|
|
2033
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
2034
|
+
|
|
2035
|
+
:default: - no dead-letter queue
|
|
2036
|
+
'''
|
|
2037
|
+
result = self._values.get("dead_letter_queue")
|
|
2038
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
2039
|
+
|
|
2040
|
+
@builtins.property
|
|
2041
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
2042
|
+
'''Input passed to the target.
|
|
2043
|
+
|
|
2044
|
+
:default: - no input.
|
|
2045
|
+
'''
|
|
2046
|
+
result = self._values.get("input")
|
|
2047
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
2048
|
+
|
|
2049
|
+
@builtins.property
|
|
2050
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
2051
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
2052
|
+
|
|
2053
|
+
Minimum value of 60.
|
|
2054
|
+
Maximum value of 86400.
|
|
2055
|
+
|
|
2056
|
+
:default: Duration.hours(24)
|
|
2057
|
+
'''
|
|
2058
|
+
result = self._values.get("max_event_age")
|
|
2059
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
2060
|
+
|
|
2061
|
+
@builtins.property
|
|
2062
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
2063
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
2064
|
+
|
|
2065
|
+
Minimum value of 0.
|
|
2066
|
+
Maximum value of 185.
|
|
2067
|
+
|
|
2068
|
+
:default: 185
|
|
2069
|
+
'''
|
|
2070
|
+
result = self._values.get("retry_attempts")
|
|
2071
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2072
|
+
|
|
2073
|
+
@builtins.property
|
|
2074
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
2075
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
2076
|
+
|
|
2077
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
2078
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
2079
|
+
will grant minimal required permissions.
|
|
2080
|
+
|
|
2081
|
+
:default: - created by target
|
|
2082
|
+
'''
|
|
2083
|
+
result = self._values.get("role")
|
|
2084
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
2085
|
+
|
|
2086
|
+
@builtins.property
|
|
2087
|
+
def task_definition(self) -> _TaskDefinition_a541a103:
|
|
2088
|
+
'''The task definition to use for scheduled tasks.
|
|
2089
|
+
|
|
2090
|
+
Note: this must be TaskDefinition, and not ITaskDefinition,
|
|
2091
|
+
as it requires properties that are not known for imported task definitions
|
|
2092
|
+
If you want to run a RunTask with an imported task definition,
|
|
2093
|
+
consider using a Universal target.
|
|
2094
|
+
'''
|
|
2095
|
+
result = self._values.get("task_definition")
|
|
2096
|
+
assert result is not None, "Required property 'task_definition' is missing"
|
|
2097
|
+
return typing.cast(_TaskDefinition_a541a103, result)
|
|
2098
|
+
|
|
2099
|
+
@builtins.property
|
|
2100
|
+
def capacity_provider_strategies(
|
|
2101
|
+
self,
|
|
2102
|
+
) -> typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]]:
|
|
2103
|
+
'''The capacity provider strategy to use for the task.
|
|
2104
|
+
|
|
2105
|
+
:default: - No capacity provider strategy
|
|
2106
|
+
'''
|
|
2107
|
+
result = self._values.get("capacity_provider_strategies")
|
|
2108
|
+
return typing.cast(typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]], result)
|
|
2109
|
+
|
|
2110
|
+
@builtins.property
|
|
2111
|
+
def enable_ecs_managed_tags(self) -> typing.Optional[builtins.bool]:
|
|
2112
|
+
'''Specifies whether to enable Amazon ECS managed tags for the task.
|
|
2113
|
+
|
|
2114
|
+
:default: - false
|
|
2115
|
+
'''
|
|
2116
|
+
result = self._values.get("enable_ecs_managed_tags")
|
|
2117
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2118
|
+
|
|
2119
|
+
@builtins.property
|
|
2120
|
+
def enable_execute_command(self) -> typing.Optional[builtins.bool]:
|
|
2121
|
+
'''Whether to enable execute command functionality for the containers in this task.
|
|
2122
|
+
|
|
2123
|
+
If true, this enables execute command functionality on all containers in the task.
|
|
2124
|
+
|
|
2125
|
+
:default: - false
|
|
2126
|
+
'''
|
|
2127
|
+
result = self._values.get("enable_execute_command")
|
|
2128
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2129
|
+
|
|
2130
|
+
@builtins.property
|
|
2131
|
+
def group(self) -> typing.Optional[builtins.str]:
|
|
2132
|
+
'''Specifies an ECS task group for the task.
|
|
2133
|
+
|
|
2134
|
+
:default: - No group
|
|
2135
|
+
'''
|
|
2136
|
+
result = self._values.get("group")
|
|
2137
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2138
|
+
|
|
2139
|
+
@builtins.property
|
|
2140
|
+
def propagate_tags(self) -> typing.Optional[builtins.bool]:
|
|
2141
|
+
'''Specifies whether to propagate the tags from the task definition to the task.
|
|
2142
|
+
|
|
2143
|
+
If no value is specified, the tags are not propagated.
|
|
2144
|
+
|
|
2145
|
+
:default: - No tag propagation
|
|
2146
|
+
'''
|
|
2147
|
+
result = self._values.get("propagate_tags")
|
|
2148
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2149
|
+
|
|
2150
|
+
@builtins.property
|
|
2151
|
+
def reference_id(self) -> typing.Optional[builtins.str]:
|
|
2152
|
+
'''The reference ID to use for the task.
|
|
2153
|
+
|
|
2154
|
+
:default: - No reference ID.
|
|
2155
|
+
'''
|
|
2156
|
+
result = self._values.get("reference_id")
|
|
2157
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2158
|
+
|
|
2159
|
+
@builtins.property
|
|
2160
|
+
def security_groups(self) -> typing.Optional[typing.List[_ISecurityGroup_acf8a799]]:
|
|
2161
|
+
'''The security groups associated with the task.
|
|
2162
|
+
|
|
2163
|
+
These security groups must all be in the same VPC.
|
|
2164
|
+
Controls inbound and outbound network access for the task.
|
|
2165
|
+
|
|
2166
|
+
:default: - The security group for the VPC is used.
|
|
2167
|
+
'''
|
|
2168
|
+
result = self._values.get("security_groups")
|
|
2169
|
+
return typing.cast(typing.Optional[typing.List[_ISecurityGroup_acf8a799]], result)
|
|
2170
|
+
|
|
2171
|
+
@builtins.property
|
|
2172
|
+
def tags(self) -> typing.Optional[typing.List[Tag]]:
|
|
2173
|
+
'''The metadata that you apply to the task to help you categorize and organize them.
|
|
2174
|
+
|
|
2175
|
+
Each tag consists of a key and an optional value, both of which you define.
|
|
2176
|
+
|
|
2177
|
+
:default: - No tags
|
|
2178
|
+
'''
|
|
2179
|
+
result = self._values.get("tags")
|
|
2180
|
+
return typing.cast(typing.Optional[typing.List[Tag]], result)
|
|
2181
|
+
|
|
2182
|
+
@builtins.property
|
|
2183
|
+
def task_count(self) -> typing.Optional[jsii.Number]:
|
|
2184
|
+
'''The number of tasks to create based on TaskDefinition.
|
|
2185
|
+
|
|
2186
|
+
:default: 1
|
|
2187
|
+
'''
|
|
2188
|
+
result = self._values.get("task_count")
|
|
2189
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2190
|
+
|
|
2191
|
+
@builtins.property
|
|
2192
|
+
def vpc_subnets(self) -> typing.Optional[_SubnetSelection_e57d76df]:
|
|
2193
|
+
'''The subnets associated with the task.
|
|
2194
|
+
|
|
2195
|
+
These subnets must all be in the same VPC.
|
|
2196
|
+
The task will be launched in these subnets.
|
|
2197
|
+
|
|
2198
|
+
:default: - all private subnets of the VPC are selected.
|
|
2199
|
+
'''
|
|
2200
|
+
result = self._values.get("vpc_subnets")
|
|
2201
|
+
return typing.cast(typing.Optional[_SubnetSelection_e57d76df], result)
|
|
2202
|
+
|
|
2203
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
2204
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
2205
|
+
|
|
2206
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
2207
|
+
return not (rhs == self)
|
|
2208
|
+
|
|
2209
|
+
def __repr__(self) -> str:
|
|
2210
|
+
return "EcsRunTaskBaseProps(%s)" % ", ".join(
|
|
2211
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
2212
|
+
)
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
2216
|
+
class EventBridgePutEvents(
|
|
2217
|
+
ScheduleTargetBase,
|
|
2218
|
+
metaclass=jsii.JSIIMeta,
|
|
2219
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EventBridgePutEvents",
|
|
2220
|
+
):
|
|
2221
|
+
'''Send an event to an AWS EventBridge by AWS EventBridge Scheduler.
|
|
2222
|
+
|
|
2223
|
+
:exampleMetadata: infused
|
|
2224
|
+
|
|
2225
|
+
Example::
|
|
2226
|
+
|
|
2227
|
+
import aws_cdk.aws_events as events
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
event_bus = events.EventBus(self, "EventBus",
|
|
2231
|
+
event_bus_name="DomainEvents"
|
|
2232
|
+
)
|
|
2233
|
+
|
|
2234
|
+
event_entry = targets.EventBridgePutEventsEntry(
|
|
2235
|
+
event_bus=event_bus,
|
|
2236
|
+
source="PetService",
|
|
2237
|
+
detail=ScheduleTargetInput.from_object({"Name": "Fluffy"}),
|
|
2238
|
+
detail_type="🐶"
|
|
2239
|
+
)
|
|
2240
|
+
|
|
2241
|
+
Schedule(self, "Schedule",
|
|
2242
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
2243
|
+
target=targets.EventBridgePutEvents(event_entry)
|
|
2244
|
+
)
|
|
2245
|
+
'''
|
|
2246
|
+
|
|
2247
|
+
def __init__(
|
|
2248
|
+
self,
|
|
2249
|
+
entry: typing.Union[EventBridgePutEventsEntry, typing.Dict[builtins.str, typing.Any]],
|
|
2250
|
+
*,
|
|
2251
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2252
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2253
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2254
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2255
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2256
|
+
) -> None:
|
|
2257
|
+
'''
|
|
2258
|
+
:param entry: -
|
|
2259
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2260
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2261
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2262
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2263
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2264
|
+
'''
|
|
2265
|
+
if __debug__:
|
|
2266
|
+
type_hints = typing.get_type_hints(_typecheckingstub__9a0df4258a838e5a88cccc129492e95670a6c48a3a143968daf3304cda11b0d6)
|
|
2267
|
+
check_type(argname="argument entry", value=entry, expected_type=type_hints["entry"])
|
|
2268
|
+
props = ScheduleTargetBaseProps(
|
|
2269
|
+
dead_letter_queue=dead_letter_queue,
|
|
2270
|
+
input=input,
|
|
2271
|
+
max_event_age=max_event_age,
|
|
2272
|
+
retry_attempts=retry_attempts,
|
|
2273
|
+
role=role,
|
|
2274
|
+
)
|
|
2275
|
+
|
|
2276
|
+
jsii.create(self.__class__, self, [entry, props])
|
|
2277
|
+
|
|
2278
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
2279
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
2280
|
+
'''
|
|
2281
|
+
:param role: -
|
|
2282
|
+
'''
|
|
2283
|
+
if __debug__:
|
|
2284
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1baf9e2dc73c33da6a0e98590a98ae30c013c30b80ac84aa641d341184758895)
|
|
2285
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2286
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
2287
|
+
|
|
2288
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
2289
|
+
def _bind_base_target_config(
|
|
2290
|
+
self,
|
|
2291
|
+
_schedule: _ISchedule_4a32574d,
|
|
2292
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
2293
|
+
'''
|
|
2294
|
+
:param _schedule: -
|
|
2295
|
+
'''
|
|
2296
|
+
if __debug__:
|
|
2297
|
+
type_hints = typing.get_type_hints(_typecheckingstub__7bee2e860ddd29c71210c85b0d9356d7ffe68cb7e6730ee46e7d37cf1658eb30)
|
|
2298
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
2299
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
@jsii.data_type(
|
|
2303
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.FargateTaskProps",
|
|
2304
|
+
jsii_struct_bases=[EcsRunTaskBaseProps],
|
|
2305
|
+
name_mapping={
|
|
2306
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
2307
|
+
"input": "input",
|
|
2308
|
+
"max_event_age": "maxEventAge",
|
|
2309
|
+
"retry_attempts": "retryAttempts",
|
|
2310
|
+
"role": "role",
|
|
2311
|
+
"task_definition": "taskDefinition",
|
|
2312
|
+
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
2313
|
+
"enable_ecs_managed_tags": "enableEcsManagedTags",
|
|
2314
|
+
"enable_execute_command": "enableExecuteCommand",
|
|
2315
|
+
"group": "group",
|
|
2316
|
+
"propagate_tags": "propagateTags",
|
|
2317
|
+
"reference_id": "referenceId",
|
|
2318
|
+
"security_groups": "securityGroups",
|
|
2319
|
+
"tags": "tags",
|
|
2320
|
+
"task_count": "taskCount",
|
|
2321
|
+
"vpc_subnets": "vpcSubnets",
|
|
2322
|
+
"assign_public_ip": "assignPublicIp",
|
|
2323
|
+
"platform_version": "platformVersion",
|
|
2324
|
+
},
|
|
2325
|
+
)
|
|
2326
|
+
class FargateTaskProps(EcsRunTaskBaseProps):
|
|
2327
|
+
def __init__(
|
|
2328
|
+
self,
|
|
2329
|
+
*,
|
|
2330
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2331
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2332
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2333
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2334
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2335
|
+
task_definition: _TaskDefinition_a541a103,
|
|
2336
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
2337
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
2338
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
2339
|
+
group: typing.Optional[builtins.str] = None,
|
|
2340
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
2341
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
2342
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
2343
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
2344
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
2345
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
2346
|
+
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
2347
|
+
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
2348
|
+
) -> None:
|
|
2349
|
+
'''Properties for scheduling an ECS Fargate Task.
|
|
2350
|
+
|
|
2351
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2352
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2353
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2354
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2355
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2356
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
2357
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
2358
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
2359
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
2360
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
2361
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
2362
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
2363
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
2364
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
2365
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
2366
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
2367
|
+
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. If true, the task will receive a public IP address and be accessible from the internet. Should only be set to true when using public subnets. Default: - true if the subnet type is PUBLIC, otherwise false
|
|
2368
|
+
:param platform_version: Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. Platform versions determine the underlying runtime environment for the task. Default: - LATEST
|
|
2369
|
+
|
|
2370
|
+
:exampleMetadata: infused
|
|
2371
|
+
|
|
2372
|
+
Example::
|
|
2373
|
+
|
|
2374
|
+
import aws_cdk.aws_ecs as ecs
|
|
2375
|
+
|
|
2376
|
+
# cluster: ecs.ICluster
|
|
2377
|
+
# task_definition: ecs.FargateTaskDefinition
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
Schedule(self, "Schedule",
|
|
2381
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
2382
|
+
target=targets.EcsRunFargateTask(cluster,
|
|
2383
|
+
task_definition=task_definition
|
|
2384
|
+
)
|
|
2385
|
+
)
|
|
2386
|
+
'''
|
|
2387
|
+
if isinstance(vpc_subnets, dict):
|
|
2388
|
+
vpc_subnets = _SubnetSelection_e57d76df(**vpc_subnets)
|
|
2389
|
+
if __debug__:
|
|
2390
|
+
type_hints = typing.get_type_hints(_typecheckingstub__0044a48616a5f6b274082e4beba47a9cda8ff42476a3bbf0a62e271138d58442)
|
|
2391
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
2392
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
2393
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
2394
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
2395
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2396
|
+
check_type(argname="argument task_definition", value=task_definition, expected_type=type_hints["task_definition"])
|
|
2397
|
+
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
2398
|
+
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
2399
|
+
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
2400
|
+
check_type(argname="argument group", value=group, expected_type=type_hints["group"])
|
|
2401
|
+
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
2402
|
+
check_type(argname="argument reference_id", value=reference_id, expected_type=type_hints["reference_id"])
|
|
2403
|
+
check_type(argname="argument security_groups", value=security_groups, expected_type=type_hints["security_groups"])
|
|
2404
|
+
check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
|
|
2405
|
+
check_type(argname="argument task_count", value=task_count, expected_type=type_hints["task_count"])
|
|
2406
|
+
check_type(argname="argument vpc_subnets", value=vpc_subnets, expected_type=type_hints["vpc_subnets"])
|
|
2407
|
+
check_type(argname="argument assign_public_ip", value=assign_public_ip, expected_type=type_hints["assign_public_ip"])
|
|
2408
|
+
check_type(argname="argument platform_version", value=platform_version, expected_type=type_hints["platform_version"])
|
|
2409
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2410
|
+
"task_definition": task_definition,
|
|
2411
|
+
}
|
|
2412
|
+
if dead_letter_queue is not None:
|
|
2413
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
2414
|
+
if input is not None:
|
|
2415
|
+
self._values["input"] = input
|
|
2416
|
+
if max_event_age is not None:
|
|
2417
|
+
self._values["max_event_age"] = max_event_age
|
|
2418
|
+
if retry_attempts is not None:
|
|
2419
|
+
self._values["retry_attempts"] = retry_attempts
|
|
2420
|
+
if role is not None:
|
|
2421
|
+
self._values["role"] = role
|
|
2422
|
+
if capacity_provider_strategies is not None:
|
|
2423
|
+
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
2424
|
+
if enable_ecs_managed_tags is not None:
|
|
2425
|
+
self._values["enable_ecs_managed_tags"] = enable_ecs_managed_tags
|
|
2426
|
+
if enable_execute_command is not None:
|
|
2427
|
+
self._values["enable_execute_command"] = enable_execute_command
|
|
2428
|
+
if group is not None:
|
|
2429
|
+
self._values["group"] = group
|
|
2430
|
+
if propagate_tags is not None:
|
|
2431
|
+
self._values["propagate_tags"] = propagate_tags
|
|
2432
|
+
if reference_id is not None:
|
|
2433
|
+
self._values["reference_id"] = reference_id
|
|
2434
|
+
if security_groups is not None:
|
|
2435
|
+
self._values["security_groups"] = security_groups
|
|
2436
|
+
if tags is not None:
|
|
2437
|
+
self._values["tags"] = tags
|
|
2438
|
+
if task_count is not None:
|
|
2439
|
+
self._values["task_count"] = task_count
|
|
2440
|
+
if vpc_subnets is not None:
|
|
2441
|
+
self._values["vpc_subnets"] = vpc_subnets
|
|
2442
|
+
if assign_public_ip is not None:
|
|
2443
|
+
self._values["assign_public_ip"] = assign_public_ip
|
|
2444
|
+
if platform_version is not None:
|
|
2445
|
+
self._values["platform_version"] = platform_version
|
|
2446
|
+
|
|
2447
|
+
@builtins.property
|
|
2448
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
2449
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
2450
|
+
|
|
2451
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
2452
|
+
depending on the retry policy of the target.
|
|
2453
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
2454
|
+
|
|
2455
|
+
:default: - no dead-letter queue
|
|
2456
|
+
'''
|
|
2457
|
+
result = self._values.get("dead_letter_queue")
|
|
2458
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
2459
|
+
|
|
2460
|
+
@builtins.property
|
|
2461
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
2462
|
+
'''Input passed to the target.
|
|
2463
|
+
|
|
2464
|
+
:default: - no input.
|
|
2465
|
+
'''
|
|
2466
|
+
result = self._values.get("input")
|
|
2467
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
2468
|
+
|
|
2469
|
+
@builtins.property
|
|
2470
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
2471
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
2472
|
+
|
|
2473
|
+
Minimum value of 60.
|
|
2474
|
+
Maximum value of 86400.
|
|
2475
|
+
|
|
2476
|
+
:default: Duration.hours(24)
|
|
2477
|
+
'''
|
|
2478
|
+
result = self._values.get("max_event_age")
|
|
2479
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
2480
|
+
|
|
2481
|
+
@builtins.property
|
|
2482
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
2483
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
2484
|
+
|
|
2485
|
+
Minimum value of 0.
|
|
2486
|
+
Maximum value of 185.
|
|
2487
|
+
|
|
2488
|
+
:default: 185
|
|
2489
|
+
'''
|
|
2490
|
+
result = self._values.get("retry_attempts")
|
|
2491
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2492
|
+
|
|
2493
|
+
@builtins.property
|
|
2494
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
2495
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
2496
|
+
|
|
2497
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
2498
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
2499
|
+
will grant minimal required permissions.
|
|
2500
|
+
|
|
2501
|
+
:default: - created by target
|
|
2502
|
+
'''
|
|
2503
|
+
result = self._values.get("role")
|
|
2504
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
2505
|
+
|
|
2506
|
+
@builtins.property
|
|
2507
|
+
def task_definition(self) -> _TaskDefinition_a541a103:
|
|
2508
|
+
'''The task definition to use for scheduled tasks.
|
|
2509
|
+
|
|
2510
|
+
Note: this must be TaskDefinition, and not ITaskDefinition,
|
|
2511
|
+
as it requires properties that are not known for imported task definitions
|
|
2512
|
+
If you want to run a RunTask with an imported task definition,
|
|
2513
|
+
consider using a Universal target.
|
|
2514
|
+
'''
|
|
2515
|
+
result = self._values.get("task_definition")
|
|
2516
|
+
assert result is not None, "Required property 'task_definition' is missing"
|
|
2517
|
+
return typing.cast(_TaskDefinition_a541a103, result)
|
|
2518
|
+
|
|
2519
|
+
@builtins.property
|
|
2520
|
+
def capacity_provider_strategies(
|
|
2521
|
+
self,
|
|
2522
|
+
) -> typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]]:
|
|
2523
|
+
'''The capacity provider strategy to use for the task.
|
|
2524
|
+
|
|
2525
|
+
:default: - No capacity provider strategy
|
|
2526
|
+
'''
|
|
2527
|
+
result = self._values.get("capacity_provider_strategies")
|
|
2528
|
+
return typing.cast(typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]], result)
|
|
2529
|
+
|
|
2530
|
+
@builtins.property
|
|
2531
|
+
def enable_ecs_managed_tags(self) -> typing.Optional[builtins.bool]:
|
|
2532
|
+
'''Specifies whether to enable Amazon ECS managed tags for the task.
|
|
2533
|
+
|
|
2534
|
+
:default: - false
|
|
2535
|
+
'''
|
|
2536
|
+
result = self._values.get("enable_ecs_managed_tags")
|
|
2537
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2538
|
+
|
|
2539
|
+
@builtins.property
|
|
2540
|
+
def enable_execute_command(self) -> typing.Optional[builtins.bool]:
|
|
2541
|
+
'''Whether to enable execute command functionality for the containers in this task.
|
|
2542
|
+
|
|
2543
|
+
If true, this enables execute command functionality on all containers in the task.
|
|
2544
|
+
|
|
2545
|
+
:default: - false
|
|
2546
|
+
'''
|
|
2547
|
+
result = self._values.get("enable_execute_command")
|
|
2548
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2549
|
+
|
|
2550
|
+
@builtins.property
|
|
2551
|
+
def group(self) -> typing.Optional[builtins.str]:
|
|
2552
|
+
'''Specifies an ECS task group for the task.
|
|
2553
|
+
|
|
2554
|
+
:default: - No group
|
|
2555
|
+
'''
|
|
2556
|
+
result = self._values.get("group")
|
|
2557
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2558
|
+
|
|
2559
|
+
@builtins.property
|
|
2560
|
+
def propagate_tags(self) -> typing.Optional[builtins.bool]:
|
|
2561
|
+
'''Specifies whether to propagate the tags from the task definition to the task.
|
|
2562
|
+
|
|
2563
|
+
If no value is specified, the tags are not propagated.
|
|
2564
|
+
|
|
2565
|
+
:default: - No tag propagation
|
|
2566
|
+
'''
|
|
2567
|
+
result = self._values.get("propagate_tags")
|
|
2568
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2569
|
+
|
|
2570
|
+
@builtins.property
|
|
2571
|
+
def reference_id(self) -> typing.Optional[builtins.str]:
|
|
2572
|
+
'''The reference ID to use for the task.
|
|
2573
|
+
|
|
2574
|
+
:default: - No reference ID.
|
|
2575
|
+
'''
|
|
2576
|
+
result = self._values.get("reference_id")
|
|
2577
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2578
|
+
|
|
2579
|
+
@builtins.property
|
|
2580
|
+
def security_groups(self) -> typing.Optional[typing.List[_ISecurityGroup_acf8a799]]:
|
|
2581
|
+
'''The security groups associated with the task.
|
|
2582
|
+
|
|
2583
|
+
These security groups must all be in the same VPC.
|
|
2584
|
+
Controls inbound and outbound network access for the task.
|
|
2585
|
+
|
|
2586
|
+
:default: - The security group for the VPC is used.
|
|
2587
|
+
'''
|
|
2588
|
+
result = self._values.get("security_groups")
|
|
2589
|
+
return typing.cast(typing.Optional[typing.List[_ISecurityGroup_acf8a799]], result)
|
|
2590
|
+
|
|
2591
|
+
@builtins.property
|
|
2592
|
+
def tags(self) -> typing.Optional[typing.List[Tag]]:
|
|
2593
|
+
'''The metadata that you apply to the task to help you categorize and organize them.
|
|
2594
|
+
|
|
2595
|
+
Each tag consists of a key and an optional value, both of which you define.
|
|
2596
|
+
|
|
2597
|
+
:default: - No tags
|
|
2598
|
+
'''
|
|
2599
|
+
result = self._values.get("tags")
|
|
2600
|
+
return typing.cast(typing.Optional[typing.List[Tag]], result)
|
|
2601
|
+
|
|
2602
|
+
@builtins.property
|
|
2603
|
+
def task_count(self) -> typing.Optional[jsii.Number]:
|
|
2604
|
+
'''The number of tasks to create based on TaskDefinition.
|
|
2605
|
+
|
|
2606
|
+
:default: 1
|
|
2607
|
+
'''
|
|
2608
|
+
result = self._values.get("task_count")
|
|
2609
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2610
|
+
|
|
2611
|
+
@builtins.property
|
|
2612
|
+
def vpc_subnets(self) -> typing.Optional[_SubnetSelection_e57d76df]:
|
|
2613
|
+
'''The subnets associated with the task.
|
|
2614
|
+
|
|
2615
|
+
These subnets must all be in the same VPC.
|
|
2616
|
+
The task will be launched in these subnets.
|
|
2617
|
+
|
|
2618
|
+
:default: - all private subnets of the VPC are selected.
|
|
2619
|
+
'''
|
|
2620
|
+
result = self._values.get("vpc_subnets")
|
|
2621
|
+
return typing.cast(typing.Optional[_SubnetSelection_e57d76df], result)
|
|
2622
|
+
|
|
2623
|
+
@builtins.property
|
|
2624
|
+
def assign_public_ip(self) -> typing.Optional[builtins.bool]:
|
|
2625
|
+
'''Specifies whether the task's elastic network interface receives a public IP address.
|
|
2626
|
+
|
|
2627
|
+
If true, the task will receive a public IP address and be accessible from the internet.
|
|
2628
|
+
Should only be set to true when using public subnets.
|
|
2629
|
+
|
|
2630
|
+
:default: - true if the subnet type is PUBLIC, otherwise false
|
|
2631
|
+
'''
|
|
2632
|
+
result = self._values.get("assign_public_ip")
|
|
2633
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
2634
|
+
|
|
2635
|
+
@builtins.property
|
|
2636
|
+
def platform_version(self) -> typing.Optional[_FargatePlatformVersion_55d8be5c]:
|
|
2637
|
+
'''Specifies the platform version for the task.
|
|
2638
|
+
|
|
2639
|
+
Specify only the numeric portion of the platform version, such as 1.1.0.
|
|
2640
|
+
Platform versions determine the underlying runtime environment for the task.
|
|
2641
|
+
|
|
2642
|
+
:default: - LATEST
|
|
2643
|
+
'''
|
|
2644
|
+
result = self._values.get("platform_version")
|
|
2645
|
+
return typing.cast(typing.Optional[_FargatePlatformVersion_55d8be5c], result)
|
|
2646
|
+
|
|
2647
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
2648
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
2649
|
+
|
|
2650
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
2651
|
+
return not (rhs == self)
|
|
2652
|
+
|
|
2653
|
+
def __repr__(self) -> str:
|
|
2654
|
+
return "FargateTaskProps(%s)" % ", ".join(
|
|
2655
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
2656
|
+
)
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
2660
|
+
class FirehosePutRecord(
|
|
2661
|
+
ScheduleTargetBase,
|
|
2662
|
+
metaclass=jsii.JSIIMeta,
|
|
2663
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.FirehosePutRecord",
|
|
2664
|
+
):
|
|
2665
|
+
'''Use an Amazon Data Firehose as a target for AWS EventBridge Scheduler.
|
|
2666
|
+
|
|
2667
|
+
:exampleMetadata: infused
|
|
2668
|
+
|
|
2669
|
+
Example::
|
|
2670
|
+
|
|
2671
|
+
import aws_cdk.aws_kinesisfirehose as firehose
|
|
2672
|
+
# delivery_stream: firehose.IDeliveryStream
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
payload = {
|
|
2676
|
+
"Data": "record"
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
Schedule(self, "Schedule",
|
|
2680
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
2681
|
+
target=targets.FirehosePutRecord(delivery_stream,
|
|
2682
|
+
input=ScheduleTargetInput.from_object(payload)
|
|
2683
|
+
)
|
|
2684
|
+
)
|
|
2685
|
+
'''
|
|
2686
|
+
|
|
2687
|
+
def __init__(
|
|
2688
|
+
self,
|
|
2689
|
+
delivery_stream: _IDeliveryStream_8f118861,
|
|
2690
|
+
*,
|
|
2691
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2692
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2693
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2694
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2695
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2696
|
+
) -> None:
|
|
2697
|
+
'''
|
|
2698
|
+
:param delivery_stream: -
|
|
2699
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2700
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2701
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2702
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2703
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2704
|
+
'''
|
|
2705
|
+
if __debug__:
|
|
2706
|
+
type_hints = typing.get_type_hints(_typecheckingstub__530a834e1b0aa54fcdcc7fc227e7d1c3328b1fe4d8b7a8b2c737ee83541bde6f)
|
|
2707
|
+
check_type(argname="argument delivery_stream", value=delivery_stream, expected_type=type_hints["delivery_stream"])
|
|
2708
|
+
props = ScheduleTargetBaseProps(
|
|
2709
|
+
dead_letter_queue=dead_letter_queue,
|
|
2710
|
+
input=input,
|
|
2711
|
+
max_event_age=max_event_age,
|
|
2712
|
+
retry_attempts=retry_attempts,
|
|
2713
|
+
role=role,
|
|
2714
|
+
)
|
|
2715
|
+
|
|
2716
|
+
jsii.create(self.__class__, self, [delivery_stream, props])
|
|
2717
|
+
|
|
2718
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
2719
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
2720
|
+
'''
|
|
2721
|
+
:param role: -
|
|
2722
|
+
'''
|
|
2723
|
+
if __debug__:
|
|
2724
|
+
type_hints = typing.get_type_hints(_typecheckingstub__12ef15c1799d86a7551586a9a9e97d06dd1a9ac00d3ff8f956b86ee6936fa7ea)
|
|
2725
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2726
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
2730
|
+
class InspectorStartAssessmentRun(
|
|
2731
|
+
ScheduleTargetBase,
|
|
2732
|
+
metaclass=jsii.JSIIMeta,
|
|
2733
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.InspectorStartAssessmentRun",
|
|
2734
|
+
):
|
|
2735
|
+
'''Use an Amazon Inspector as a target for AWS EventBridge Scheduler.
|
|
2736
|
+
|
|
2737
|
+
:exampleMetadata: infused
|
|
2738
|
+
|
|
2739
|
+
Example::
|
|
2740
|
+
|
|
2741
|
+
import aws_cdk.aws_inspector as inspector
|
|
2742
|
+
|
|
2743
|
+
# cfn_assessment_template: inspector.CfnAssessmentTemplate
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
assessment_template = inspector.AssessmentTemplate.from_cfn_assessment_template(self, "MyAssessmentTemplate", cfn_assessment_template)
|
|
2747
|
+
|
|
2748
|
+
Schedule(self, "Schedule",
|
|
2749
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
2750
|
+
target=targets.InspectorStartAssessmentRun(assessment_template)
|
|
2751
|
+
)
|
|
2752
|
+
'''
|
|
2753
|
+
|
|
2754
|
+
def __init__(
|
|
2755
|
+
self,
|
|
2756
|
+
template: _IAssessmentTemplate_495c2d4e,
|
|
2757
|
+
*,
|
|
2758
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2759
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2760
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2761
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2762
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2763
|
+
) -> None:
|
|
2764
|
+
'''
|
|
2765
|
+
:param template: -
|
|
2766
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2767
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2768
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2769
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2770
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2771
|
+
'''
|
|
2772
|
+
if __debug__:
|
|
2773
|
+
type_hints = typing.get_type_hints(_typecheckingstub__827e380295982b1bf320134c0d482e805db91e38e0a4e6207c777b292c586409)
|
|
2774
|
+
check_type(argname="argument template", value=template, expected_type=type_hints["template"])
|
|
2775
|
+
props = ScheduleTargetBaseProps(
|
|
2776
|
+
dead_letter_queue=dead_letter_queue,
|
|
2777
|
+
input=input,
|
|
2778
|
+
max_event_age=max_event_age,
|
|
2779
|
+
retry_attempts=retry_attempts,
|
|
2780
|
+
role=role,
|
|
2781
|
+
)
|
|
2782
|
+
|
|
2783
|
+
jsii.create(self.__class__, self, [template, props])
|
|
2784
|
+
|
|
2785
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
2786
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
2787
|
+
'''
|
|
2788
|
+
:param role: -
|
|
2789
|
+
'''
|
|
2790
|
+
if __debug__:
|
|
2791
|
+
type_hints = typing.get_type_hints(_typecheckingstub__7b0a5298c5996dd44a33a53ddb1de44b183dab3534ae35332944ef46add41c3c)
|
|
2792
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2793
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
2797
|
+
class KinesisStreamPutRecord(
|
|
2798
|
+
ScheduleTargetBase,
|
|
2799
|
+
metaclass=jsii.JSIIMeta,
|
|
2800
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.KinesisStreamPutRecord",
|
|
2801
|
+
):
|
|
2802
|
+
'''Use an Amazon Kinesis Data Streams as a target for AWS EventBridge Scheduler.
|
|
2803
|
+
|
|
2804
|
+
:exampleMetadata: infused
|
|
2805
|
+
|
|
2806
|
+
Example::
|
|
2807
|
+
|
|
2808
|
+
import aws_cdk.aws_kinesis as kinesis
|
|
2809
|
+
|
|
2810
|
+
|
|
2811
|
+
stream = kinesis.Stream(self, "MyStream")
|
|
2812
|
+
|
|
2813
|
+
Schedule(self, "Schedule",
|
|
2814
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
2815
|
+
target=targets.KinesisStreamPutRecord(stream,
|
|
2816
|
+
partition_key="key"
|
|
2817
|
+
)
|
|
2818
|
+
)
|
|
2819
|
+
'''
|
|
2820
|
+
|
|
2821
|
+
def __init__(
|
|
2822
|
+
self,
|
|
2823
|
+
stream: _IStream_4e2457d2,
|
|
2824
|
+
*,
|
|
2825
|
+
partition_key: builtins.str,
|
|
2826
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2827
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2828
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2829
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2830
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2831
|
+
) -> None:
|
|
2832
|
+
'''
|
|
2833
|
+
:param stream: -
|
|
2834
|
+
:param partition_key: The shard to which EventBridge Scheduler sends the event. The length must be between 1 and 256.
|
|
2835
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2836
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2837
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2838
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2839
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2840
|
+
'''
|
|
2841
|
+
if __debug__:
|
|
2842
|
+
type_hints = typing.get_type_hints(_typecheckingstub__844d4109ae2a35450c62ac93b6c125635f2ea9d42ffb8e4860d25d1e02b1064a)
|
|
2843
|
+
check_type(argname="argument stream", value=stream, expected_type=type_hints["stream"])
|
|
2844
|
+
props = KinesisStreamPutRecordProps(
|
|
2845
|
+
partition_key=partition_key,
|
|
2846
|
+
dead_letter_queue=dead_letter_queue,
|
|
2847
|
+
input=input,
|
|
2848
|
+
max_event_age=max_event_age,
|
|
2849
|
+
retry_attempts=retry_attempts,
|
|
2850
|
+
role=role,
|
|
2851
|
+
)
|
|
2852
|
+
|
|
2853
|
+
jsii.create(self.__class__, self, [stream, props])
|
|
2854
|
+
|
|
2855
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
2856
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
2857
|
+
'''
|
|
2858
|
+
:param role: -
|
|
2859
|
+
'''
|
|
2860
|
+
if __debug__:
|
|
2861
|
+
type_hints = typing.get_type_hints(_typecheckingstub__8f68362f38606eda9d16e9f454710bd99b8cd843f84c5c0019bf2ea0a83d96d0)
|
|
2862
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2863
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
2864
|
+
|
|
2865
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
2866
|
+
def _bind_base_target_config(
|
|
2867
|
+
self,
|
|
2868
|
+
_schedule: _ISchedule_4a32574d,
|
|
2869
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
2870
|
+
'''
|
|
2871
|
+
:param _schedule: -
|
|
2872
|
+
'''
|
|
2873
|
+
if __debug__:
|
|
2874
|
+
type_hints = typing.get_type_hints(_typecheckingstub__13086e22bbba8b22a5916cdb6de3619bfa3160b4ffb06dd0b18358feff854092)
|
|
2875
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
2876
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
2877
|
+
|
|
2878
|
+
|
|
2879
|
+
@jsii.data_type(
|
|
2880
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.KinesisStreamPutRecordProps",
|
|
2881
|
+
jsii_struct_bases=[ScheduleTargetBaseProps],
|
|
2882
|
+
name_mapping={
|
|
2883
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
2884
|
+
"input": "input",
|
|
2885
|
+
"max_event_age": "maxEventAge",
|
|
2886
|
+
"retry_attempts": "retryAttempts",
|
|
2887
|
+
"role": "role",
|
|
2888
|
+
"partition_key": "partitionKey",
|
|
2889
|
+
},
|
|
2890
|
+
)
|
|
2891
|
+
class KinesisStreamPutRecordProps(ScheduleTargetBaseProps):
|
|
2892
|
+
def __init__(
|
|
2893
|
+
self,
|
|
2894
|
+
*,
|
|
2895
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
2896
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
2897
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
2898
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
2899
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
2900
|
+
partition_key: builtins.str,
|
|
2901
|
+
) -> None:
|
|
2902
|
+
'''Properties for a Kinesis Data Streams Target.
|
|
2903
|
+
|
|
2904
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
2905
|
+
:param input: Input passed to the target. Default: - no input.
|
|
2906
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
2907
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
2908
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
2909
|
+
:param partition_key: The shard to which EventBridge Scheduler sends the event. The length must be between 1 and 256.
|
|
2910
|
+
|
|
2911
|
+
:exampleMetadata: infused
|
|
2912
|
+
|
|
2913
|
+
Example::
|
|
2914
|
+
|
|
2915
|
+
import aws_cdk.aws_kinesis as kinesis
|
|
2916
|
+
|
|
2917
|
+
|
|
2918
|
+
stream = kinesis.Stream(self, "MyStream")
|
|
2919
|
+
|
|
2920
|
+
Schedule(self, "Schedule",
|
|
2921
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
2922
|
+
target=targets.KinesisStreamPutRecord(stream,
|
|
2923
|
+
partition_key="key"
|
|
2924
|
+
)
|
|
2925
|
+
)
|
|
2926
|
+
'''
|
|
2927
|
+
if __debug__:
|
|
2928
|
+
type_hints = typing.get_type_hints(_typecheckingstub__567db217f348a6c029d70c629fc520a2f785e26b04a4275cad20a047e712f916)
|
|
2929
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
2930
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
2931
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
2932
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
2933
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
2934
|
+
check_type(argname="argument partition_key", value=partition_key, expected_type=type_hints["partition_key"])
|
|
2935
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2936
|
+
"partition_key": partition_key,
|
|
2937
|
+
}
|
|
2938
|
+
if dead_letter_queue is not None:
|
|
2939
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
2940
|
+
if input is not None:
|
|
2941
|
+
self._values["input"] = input
|
|
2942
|
+
if max_event_age is not None:
|
|
2943
|
+
self._values["max_event_age"] = max_event_age
|
|
2944
|
+
if retry_attempts is not None:
|
|
2945
|
+
self._values["retry_attempts"] = retry_attempts
|
|
2946
|
+
if role is not None:
|
|
2947
|
+
self._values["role"] = role
|
|
2948
|
+
|
|
2949
|
+
@builtins.property
|
|
2950
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
2951
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
2952
|
+
|
|
2953
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
2954
|
+
depending on the retry policy of the target.
|
|
2955
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
2956
|
+
|
|
2957
|
+
:default: - no dead-letter queue
|
|
2958
|
+
'''
|
|
2959
|
+
result = self._values.get("dead_letter_queue")
|
|
2960
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
2961
|
+
|
|
2962
|
+
@builtins.property
|
|
2963
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
2964
|
+
'''Input passed to the target.
|
|
2965
|
+
|
|
2966
|
+
:default: - no input.
|
|
2967
|
+
'''
|
|
2968
|
+
result = self._values.get("input")
|
|
2969
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
2970
|
+
|
|
2971
|
+
@builtins.property
|
|
2972
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
2973
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
2974
|
+
|
|
2975
|
+
Minimum value of 60.
|
|
2976
|
+
Maximum value of 86400.
|
|
2977
|
+
|
|
2978
|
+
:default: Duration.hours(24)
|
|
2979
|
+
'''
|
|
2980
|
+
result = self._values.get("max_event_age")
|
|
2981
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
2982
|
+
|
|
2983
|
+
@builtins.property
|
|
2984
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
2985
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
2986
|
+
|
|
2987
|
+
Minimum value of 0.
|
|
2988
|
+
Maximum value of 185.
|
|
2989
|
+
|
|
2990
|
+
:default: 185
|
|
2991
|
+
'''
|
|
2992
|
+
result = self._values.get("retry_attempts")
|
|
2993
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2994
|
+
|
|
2995
|
+
@builtins.property
|
|
2996
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
2997
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
2998
|
+
|
|
2999
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
3000
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
3001
|
+
will grant minimal required permissions.
|
|
3002
|
+
|
|
3003
|
+
:default: - created by target
|
|
3004
|
+
'''
|
|
3005
|
+
result = self._values.get("role")
|
|
3006
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
3007
|
+
|
|
3008
|
+
@builtins.property
|
|
3009
|
+
def partition_key(self) -> builtins.str:
|
|
3010
|
+
'''The shard to which EventBridge Scheduler sends the event.
|
|
3011
|
+
|
|
3012
|
+
The length must be between 1 and 256.
|
|
3013
|
+
|
|
3014
|
+
:see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-kinesisparameters.html
|
|
3015
|
+
'''
|
|
3016
|
+
result = self._values.get("partition_key")
|
|
3017
|
+
assert result is not None, "Required property 'partition_key' is missing"
|
|
3018
|
+
return typing.cast(builtins.str, result)
|
|
3019
|
+
|
|
3020
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3021
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3022
|
+
|
|
3023
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3024
|
+
return not (rhs == self)
|
|
3025
|
+
|
|
3026
|
+
def __repr__(self) -> str:
|
|
3027
|
+
return "KinesisStreamPutRecordProps(%s)" % ", ".join(
|
|
3028
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3029
|
+
)
|
|
3030
|
+
|
|
3031
|
+
|
|
3032
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
3033
|
+
class LambdaInvoke(
|
|
3034
|
+
ScheduleTargetBase,
|
|
3035
|
+
metaclass=jsii.JSIIMeta,
|
|
3036
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.LambdaInvoke",
|
|
3037
|
+
):
|
|
3038
|
+
'''Use an AWS Lambda function as a target for AWS EventBridge Scheduler.
|
|
3039
|
+
|
|
3040
|
+
:exampleMetadata: infused
|
|
3041
|
+
|
|
3042
|
+
Example::
|
|
3043
|
+
|
|
3044
|
+
import aws_cdk.aws_lambda as lambda_
|
|
3045
|
+
|
|
3046
|
+
|
|
3047
|
+
fn = lambda_.Function(self, "MyFunc",
|
|
3048
|
+
runtime=lambda_.Runtime.NODEJS_LATEST,
|
|
3049
|
+
handler="index.handler",
|
|
3050
|
+
code=lambda_.Code.from_inline("exports.handler = handler.toString()")
|
|
3051
|
+
)
|
|
3052
|
+
|
|
3053
|
+
dlq = sqs.Queue(self, "DLQ",
|
|
3054
|
+
queue_name="MyDLQ"
|
|
3055
|
+
)
|
|
3056
|
+
|
|
3057
|
+
target = targets.LambdaInvoke(fn,
|
|
3058
|
+
dead_letter_queue=dlq,
|
|
3059
|
+
max_event_age=Duration.minutes(1),
|
|
3060
|
+
retry_attempts=3,
|
|
3061
|
+
input=ScheduleTargetInput.from_object({
|
|
3062
|
+
"payload": "useful"
|
|
3063
|
+
})
|
|
3064
|
+
)
|
|
3065
|
+
|
|
3066
|
+
schedule = Schedule(self, "Schedule",
|
|
3067
|
+
schedule=ScheduleExpression.rate(Duration.hours(1)),
|
|
3068
|
+
target=target
|
|
3069
|
+
)
|
|
3070
|
+
'''
|
|
3071
|
+
|
|
3072
|
+
def __init__(
|
|
3073
|
+
self,
|
|
3074
|
+
func: _IFunction_6adb0ab8,
|
|
3075
|
+
*,
|
|
3076
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3077
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3078
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3079
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3080
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3081
|
+
) -> None:
|
|
3082
|
+
'''
|
|
3083
|
+
:param func: -
|
|
3084
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3085
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3086
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3087
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3088
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3089
|
+
'''
|
|
3090
|
+
if __debug__:
|
|
3091
|
+
type_hints = typing.get_type_hints(_typecheckingstub__2dd794e954362778258936b279d00e4ee11901171e9167c30c46af0264354987)
|
|
3092
|
+
check_type(argname="argument func", value=func, expected_type=type_hints["func"])
|
|
3093
|
+
props = ScheduleTargetBaseProps(
|
|
3094
|
+
dead_letter_queue=dead_letter_queue,
|
|
3095
|
+
input=input,
|
|
3096
|
+
max_event_age=max_event_age,
|
|
3097
|
+
retry_attempts=retry_attempts,
|
|
3098
|
+
role=role,
|
|
3099
|
+
)
|
|
3100
|
+
|
|
3101
|
+
jsii.create(self.__class__, self, [func, props])
|
|
3102
|
+
|
|
3103
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
3104
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
3105
|
+
'''
|
|
3106
|
+
:param role: -
|
|
3107
|
+
'''
|
|
3108
|
+
if __debug__:
|
|
3109
|
+
type_hints = typing.get_type_hints(_typecheckingstub__26671fb6a31106b3127d1e1ee335ad2e53f34baa3f498ccf404d68a494683324)
|
|
3110
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3111
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
3112
|
+
|
|
3113
|
+
|
|
3114
|
+
@jsii.implements(_IScheduleTarget_46344d95)
|
|
3115
|
+
class SageMakerStartPipelineExecution(
|
|
3116
|
+
ScheduleTargetBase,
|
|
3117
|
+
metaclass=jsii.JSIIMeta,
|
|
3118
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SageMakerStartPipelineExecution",
|
|
3119
|
+
):
|
|
3120
|
+
'''Use a SageMaker pipeline as a target for AWS EventBridge Scheduler.
|
|
3121
|
+
|
|
3122
|
+
:exampleMetadata: infused
|
|
3123
|
+
|
|
3124
|
+
Example::
|
|
3125
|
+
|
|
3126
|
+
import aws_cdk.aws_sagemaker as sagemaker
|
|
3127
|
+
|
|
3128
|
+
# pipeline: sagemaker.IPipeline
|
|
3129
|
+
|
|
3130
|
+
|
|
3131
|
+
Schedule(self, "Schedule",
|
|
3132
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
3133
|
+
target=targets.SageMakerStartPipelineExecution(pipeline,
|
|
3134
|
+
pipeline_parameter_list=[targets.SageMakerPipelineParameter(
|
|
3135
|
+
name="parameter-name",
|
|
3136
|
+
value="parameter-value"
|
|
3137
|
+
)]
|
|
3138
|
+
)
|
|
3139
|
+
)
|
|
3140
|
+
'''
|
|
3141
|
+
|
|
3142
|
+
def __init__(
|
|
3143
|
+
self,
|
|
3144
|
+
pipeline: _IPipeline_3f0dad92,
|
|
3145
|
+
*,
|
|
3146
|
+
pipeline_parameter_list: typing.Optional[typing.Sequence[typing.Union[SageMakerPipelineParameter, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3147
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3148
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3149
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3150
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3151
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3152
|
+
) -> None:
|
|
3153
|
+
'''
|
|
3154
|
+
:param pipeline: -
|
|
3155
|
+
:param pipeline_parameter_list: List of parameter names and values to use when executing the SageMaker Model Building Pipeline. The length must be between 0 and 200. Default: - no pipeline parameter list
|
|
3156
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3157
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3158
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3159
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3160
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3161
|
+
'''
|
|
3162
|
+
if __debug__:
|
|
3163
|
+
type_hints = typing.get_type_hints(_typecheckingstub__8b4d5d553374833e946836908362ee222905ef0a763dcb21589a9af03c37b17b)
|
|
3164
|
+
check_type(argname="argument pipeline", value=pipeline, expected_type=type_hints["pipeline"])
|
|
3165
|
+
props = SageMakerStartPipelineExecutionProps(
|
|
3166
|
+
pipeline_parameter_list=pipeline_parameter_list,
|
|
3167
|
+
dead_letter_queue=dead_letter_queue,
|
|
3168
|
+
input=input,
|
|
3169
|
+
max_event_age=max_event_age,
|
|
3170
|
+
retry_attempts=retry_attempts,
|
|
3171
|
+
role=role,
|
|
3172
|
+
)
|
|
3173
|
+
|
|
3174
|
+
jsii.create(self.__class__, self, [pipeline, props])
|
|
3175
|
+
|
|
3176
|
+
@jsii.member(jsii_name="addTargetActionToRole")
|
|
3177
|
+
def _add_target_action_to_role(self, role: _IRole_235f5d8e) -> None:
|
|
3178
|
+
'''
|
|
3179
|
+
:param role: -
|
|
3180
|
+
'''
|
|
3181
|
+
if __debug__:
|
|
3182
|
+
type_hints = typing.get_type_hints(_typecheckingstub__ae0f7cdeb8aec78a69856eda18285d709f05365e1ff2cd96bf0165c868a6e7fb)
|
|
3183
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3184
|
+
return typing.cast(None, jsii.invoke(self, "addTargetActionToRole", [role]))
|
|
3185
|
+
|
|
3186
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
3187
|
+
def _bind_base_target_config(
|
|
3188
|
+
self,
|
|
3189
|
+
schedule: _ISchedule_4a32574d,
|
|
3190
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
3191
|
+
'''
|
|
3192
|
+
:param schedule: -
|
|
3193
|
+
'''
|
|
3194
|
+
if __debug__:
|
|
3195
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1d9975ba29adcd67e9e835e8a8a9b18c31ac8ad5864fa85ddfb1051ca2290643)
|
|
3196
|
+
check_type(argname="argument schedule", value=schedule, expected_type=type_hints["schedule"])
|
|
3197
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [schedule]))
|
|
3198
|
+
|
|
3199
|
+
|
|
3200
|
+
@jsii.data_type(
|
|
3201
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.SageMakerStartPipelineExecutionProps",
|
|
3202
|
+
jsii_struct_bases=[ScheduleTargetBaseProps],
|
|
3203
|
+
name_mapping={
|
|
3204
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
3205
|
+
"input": "input",
|
|
3206
|
+
"max_event_age": "maxEventAge",
|
|
3207
|
+
"retry_attempts": "retryAttempts",
|
|
3208
|
+
"role": "role",
|
|
3209
|
+
"pipeline_parameter_list": "pipelineParameterList",
|
|
3210
|
+
},
|
|
3211
|
+
)
|
|
3212
|
+
class SageMakerStartPipelineExecutionProps(ScheduleTargetBaseProps):
|
|
3213
|
+
def __init__(
|
|
3214
|
+
self,
|
|
3215
|
+
*,
|
|
3216
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3217
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3218
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3219
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3220
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3221
|
+
pipeline_parameter_list: typing.Optional[typing.Sequence[typing.Union[SageMakerPipelineParameter, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3222
|
+
) -> None:
|
|
3223
|
+
'''Properties for a SageMaker Target.
|
|
3224
|
+
|
|
3225
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3226
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3227
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3228
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3229
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3230
|
+
:param pipeline_parameter_list: List of parameter names and values to use when executing the SageMaker Model Building Pipeline. The length must be between 0 and 200. Default: - no pipeline parameter list
|
|
3231
|
+
|
|
3232
|
+
:exampleMetadata: infused
|
|
3233
|
+
|
|
3234
|
+
Example::
|
|
3235
|
+
|
|
3236
|
+
import aws_cdk.aws_sagemaker as sagemaker
|
|
3237
|
+
|
|
3238
|
+
# pipeline: sagemaker.IPipeline
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
Schedule(self, "Schedule",
|
|
3242
|
+
schedule=ScheduleExpression.rate(Duration.minutes(60)),
|
|
3243
|
+
target=targets.SageMakerStartPipelineExecution(pipeline,
|
|
3244
|
+
pipeline_parameter_list=[targets.SageMakerPipelineParameter(
|
|
3245
|
+
name="parameter-name",
|
|
3246
|
+
value="parameter-value"
|
|
3247
|
+
)]
|
|
3248
|
+
)
|
|
3249
|
+
)
|
|
3250
|
+
'''
|
|
3251
|
+
if __debug__:
|
|
3252
|
+
type_hints = typing.get_type_hints(_typecheckingstub__e472e64e333014fc5530dd24fc7c0935430768f0699ea44f2dfd3d955bf20bc2)
|
|
3253
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
3254
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
3255
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
3256
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
3257
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3258
|
+
check_type(argname="argument pipeline_parameter_list", value=pipeline_parameter_list, expected_type=type_hints["pipeline_parameter_list"])
|
|
3259
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
3260
|
+
if dead_letter_queue is not None:
|
|
3261
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
3262
|
+
if input is not None:
|
|
3263
|
+
self._values["input"] = input
|
|
3264
|
+
if max_event_age is not None:
|
|
3265
|
+
self._values["max_event_age"] = max_event_age
|
|
3266
|
+
if retry_attempts is not None:
|
|
3267
|
+
self._values["retry_attempts"] = retry_attempts
|
|
3268
|
+
if role is not None:
|
|
3269
|
+
self._values["role"] = role
|
|
3270
|
+
if pipeline_parameter_list is not None:
|
|
3271
|
+
self._values["pipeline_parameter_list"] = pipeline_parameter_list
|
|
3272
|
+
|
|
3273
|
+
@builtins.property
|
|
3274
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
3275
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
3276
|
+
|
|
3277
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
3278
|
+
depending on the retry policy of the target.
|
|
3279
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
3280
|
+
|
|
3281
|
+
:default: - no dead-letter queue
|
|
3282
|
+
'''
|
|
3283
|
+
result = self._values.get("dead_letter_queue")
|
|
3284
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
3285
|
+
|
|
3286
|
+
@builtins.property
|
|
3287
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
3288
|
+
'''Input passed to the target.
|
|
3289
|
+
|
|
3290
|
+
:default: - no input.
|
|
3291
|
+
'''
|
|
3292
|
+
result = self._values.get("input")
|
|
3293
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
3294
|
+
|
|
3295
|
+
@builtins.property
|
|
3296
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
3297
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
3298
|
+
|
|
3299
|
+
Minimum value of 60.
|
|
3300
|
+
Maximum value of 86400.
|
|
3301
|
+
|
|
3302
|
+
:default: Duration.hours(24)
|
|
3303
|
+
'''
|
|
3304
|
+
result = self._values.get("max_event_age")
|
|
3305
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
3306
|
+
|
|
3307
|
+
@builtins.property
|
|
3308
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
3309
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
3310
|
+
|
|
3311
|
+
Minimum value of 0.
|
|
3312
|
+
Maximum value of 185.
|
|
3313
|
+
|
|
3314
|
+
:default: 185
|
|
3315
|
+
'''
|
|
3316
|
+
result = self._values.get("retry_attempts")
|
|
3317
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3318
|
+
|
|
3319
|
+
@builtins.property
|
|
3320
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
3321
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
3322
|
+
|
|
3323
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
3324
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
3325
|
+
will grant minimal required permissions.
|
|
3326
|
+
|
|
3327
|
+
:default: - created by target
|
|
3328
|
+
'''
|
|
3329
|
+
result = self._values.get("role")
|
|
3330
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
3331
|
+
|
|
3332
|
+
@builtins.property
|
|
3333
|
+
def pipeline_parameter_list(
|
|
3334
|
+
self,
|
|
3335
|
+
) -> typing.Optional[typing.List[SageMakerPipelineParameter]]:
|
|
3336
|
+
'''List of parameter names and values to use when executing the SageMaker Model Building Pipeline.
|
|
3337
|
+
|
|
3338
|
+
The length must be between 0 and 200.
|
|
3339
|
+
|
|
3340
|
+
:default: - no pipeline parameter list
|
|
3341
|
+
|
|
3342
|
+
:see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-scheduler-schedule-sagemakerpipelineparameters.html#cfn-scheduler-schedule-sagemakerpipelineparameters-pipelineparameterlist
|
|
3343
|
+
'''
|
|
3344
|
+
result = self._values.get("pipeline_parameter_list")
|
|
3345
|
+
return typing.cast(typing.Optional[typing.List[SageMakerPipelineParameter]], result)
|
|
3346
|
+
|
|
3347
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3348
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3349
|
+
|
|
3350
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3351
|
+
return not (rhs == self)
|
|
3352
|
+
|
|
3353
|
+
def __repr__(self) -> str:
|
|
3354
|
+
return "SageMakerStartPipelineExecutionProps(%s)" % ", ".join(
|
|
3355
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3356
|
+
)
|
|
3357
|
+
|
|
3358
|
+
|
|
3359
|
+
@jsii.data_type(
|
|
3360
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.Ec2TaskProps",
|
|
3361
|
+
jsii_struct_bases=[EcsRunTaskBaseProps],
|
|
3362
|
+
name_mapping={
|
|
3363
|
+
"dead_letter_queue": "deadLetterQueue",
|
|
3364
|
+
"input": "input",
|
|
3365
|
+
"max_event_age": "maxEventAge",
|
|
3366
|
+
"retry_attempts": "retryAttempts",
|
|
3367
|
+
"role": "role",
|
|
3368
|
+
"task_definition": "taskDefinition",
|
|
3369
|
+
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
3370
|
+
"enable_ecs_managed_tags": "enableEcsManagedTags",
|
|
3371
|
+
"enable_execute_command": "enableExecuteCommand",
|
|
3372
|
+
"group": "group",
|
|
3373
|
+
"propagate_tags": "propagateTags",
|
|
3374
|
+
"reference_id": "referenceId",
|
|
3375
|
+
"security_groups": "securityGroups",
|
|
3376
|
+
"tags": "tags",
|
|
3377
|
+
"task_count": "taskCount",
|
|
3378
|
+
"vpc_subnets": "vpcSubnets",
|
|
3379
|
+
"placement_constraints": "placementConstraints",
|
|
3380
|
+
"placement_strategies": "placementStrategies",
|
|
3381
|
+
},
|
|
3382
|
+
)
|
|
3383
|
+
class Ec2TaskProps(EcsRunTaskBaseProps):
|
|
3384
|
+
def __init__(
|
|
3385
|
+
self,
|
|
3386
|
+
*,
|
|
3387
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3388
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3389
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3390
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3391
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3392
|
+
task_definition: _TaskDefinition_a541a103,
|
|
3393
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3394
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
3395
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
3396
|
+
group: typing.Optional[builtins.str] = None,
|
|
3397
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
3398
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
3399
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
3400
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3401
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
3402
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
3403
|
+
placement_constraints: typing.Optional[typing.Sequence[_PlacementConstraint_11d82a52]] = None,
|
|
3404
|
+
placement_strategies: typing.Optional[typing.Sequence[_PlacementStrategy_2bb6c232]] = None,
|
|
3405
|
+
) -> None:
|
|
3406
|
+
'''Properties for scheduling an ECS Task on EC2.
|
|
3407
|
+
|
|
3408
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3409
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3410
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3411
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3412
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3413
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
3414
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
3415
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
3416
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
3417
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
3418
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
3419
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
3420
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
3421
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
3422
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
3423
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
3424
|
+
:param placement_constraints: The rules that must be met in order to place a task on a container instance. Default: - No placement constraints.
|
|
3425
|
+
:param placement_strategies: The algorithm for selecting container instances for task placement. Default: - No placement strategies.
|
|
3426
|
+
|
|
3427
|
+
:exampleMetadata: infused
|
|
3428
|
+
|
|
3429
|
+
Example::
|
|
3430
|
+
|
|
3431
|
+
import aws_cdk.aws_ecs as ecs
|
|
3432
|
+
|
|
3433
|
+
# cluster: ecs.ICluster
|
|
3434
|
+
# task_definition: ecs.Ec2TaskDefinition
|
|
3435
|
+
|
|
3436
|
+
|
|
3437
|
+
Schedule(self, "Schedule",
|
|
3438
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
3439
|
+
target=targets.EcsRunEc2Task(cluster,
|
|
3440
|
+
task_definition=task_definition
|
|
3441
|
+
)
|
|
3442
|
+
)
|
|
3443
|
+
'''
|
|
3444
|
+
if isinstance(vpc_subnets, dict):
|
|
3445
|
+
vpc_subnets = _SubnetSelection_e57d76df(**vpc_subnets)
|
|
3446
|
+
if __debug__:
|
|
3447
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1411b21d63f24c8e116e80d07b271db391e0744a2d90d4aa94f5d32c29e37c72)
|
|
3448
|
+
check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
|
|
3449
|
+
check_type(argname="argument input", value=input, expected_type=type_hints["input"])
|
|
3450
|
+
check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
|
|
3451
|
+
check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
|
|
3452
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3453
|
+
check_type(argname="argument task_definition", value=task_definition, expected_type=type_hints["task_definition"])
|
|
3454
|
+
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
3455
|
+
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
3456
|
+
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
3457
|
+
check_type(argname="argument group", value=group, expected_type=type_hints["group"])
|
|
3458
|
+
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
3459
|
+
check_type(argname="argument reference_id", value=reference_id, expected_type=type_hints["reference_id"])
|
|
3460
|
+
check_type(argname="argument security_groups", value=security_groups, expected_type=type_hints["security_groups"])
|
|
3461
|
+
check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
|
|
3462
|
+
check_type(argname="argument task_count", value=task_count, expected_type=type_hints["task_count"])
|
|
3463
|
+
check_type(argname="argument vpc_subnets", value=vpc_subnets, expected_type=type_hints["vpc_subnets"])
|
|
3464
|
+
check_type(argname="argument placement_constraints", value=placement_constraints, expected_type=type_hints["placement_constraints"])
|
|
3465
|
+
check_type(argname="argument placement_strategies", value=placement_strategies, expected_type=type_hints["placement_strategies"])
|
|
3466
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
3467
|
+
"task_definition": task_definition,
|
|
3468
|
+
}
|
|
3469
|
+
if dead_letter_queue is not None:
|
|
3470
|
+
self._values["dead_letter_queue"] = dead_letter_queue
|
|
3471
|
+
if input is not None:
|
|
3472
|
+
self._values["input"] = input
|
|
3473
|
+
if max_event_age is not None:
|
|
3474
|
+
self._values["max_event_age"] = max_event_age
|
|
3475
|
+
if retry_attempts is not None:
|
|
3476
|
+
self._values["retry_attempts"] = retry_attempts
|
|
3477
|
+
if role is not None:
|
|
3478
|
+
self._values["role"] = role
|
|
3479
|
+
if capacity_provider_strategies is not None:
|
|
3480
|
+
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
3481
|
+
if enable_ecs_managed_tags is not None:
|
|
3482
|
+
self._values["enable_ecs_managed_tags"] = enable_ecs_managed_tags
|
|
3483
|
+
if enable_execute_command is not None:
|
|
3484
|
+
self._values["enable_execute_command"] = enable_execute_command
|
|
3485
|
+
if group is not None:
|
|
3486
|
+
self._values["group"] = group
|
|
3487
|
+
if propagate_tags is not None:
|
|
3488
|
+
self._values["propagate_tags"] = propagate_tags
|
|
3489
|
+
if reference_id is not None:
|
|
3490
|
+
self._values["reference_id"] = reference_id
|
|
3491
|
+
if security_groups is not None:
|
|
3492
|
+
self._values["security_groups"] = security_groups
|
|
3493
|
+
if tags is not None:
|
|
3494
|
+
self._values["tags"] = tags
|
|
3495
|
+
if task_count is not None:
|
|
3496
|
+
self._values["task_count"] = task_count
|
|
3497
|
+
if vpc_subnets is not None:
|
|
3498
|
+
self._values["vpc_subnets"] = vpc_subnets
|
|
3499
|
+
if placement_constraints is not None:
|
|
3500
|
+
self._values["placement_constraints"] = placement_constraints
|
|
3501
|
+
if placement_strategies is not None:
|
|
3502
|
+
self._values["placement_strategies"] = placement_strategies
|
|
3503
|
+
|
|
3504
|
+
@builtins.property
|
|
3505
|
+
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
3506
|
+
'''The SQS queue to be used as deadLetterQueue.
|
|
3507
|
+
|
|
3508
|
+
The events not successfully delivered are automatically retried for a specified period of time,
|
|
3509
|
+
depending on the retry policy of the target.
|
|
3510
|
+
If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
|
|
3511
|
+
|
|
3512
|
+
:default: - no dead-letter queue
|
|
3513
|
+
'''
|
|
3514
|
+
result = self._values.get("dead_letter_queue")
|
|
3515
|
+
return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
|
|
3516
|
+
|
|
3517
|
+
@builtins.property
|
|
3518
|
+
def input(self) -> typing.Optional[_ScheduleTargetInput_dd30d070]:
|
|
3519
|
+
'''Input passed to the target.
|
|
3520
|
+
|
|
3521
|
+
:default: - no input.
|
|
3522
|
+
'''
|
|
3523
|
+
result = self._values.get("input")
|
|
3524
|
+
return typing.cast(typing.Optional[_ScheduleTargetInput_dd30d070], result)
|
|
3525
|
+
|
|
3526
|
+
@builtins.property
|
|
3527
|
+
def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
3528
|
+
'''The maximum age of a request that Scheduler sends to a target for processing.
|
|
3529
|
+
|
|
3530
|
+
Minimum value of 60.
|
|
3531
|
+
Maximum value of 86400.
|
|
3532
|
+
|
|
3533
|
+
:default: Duration.hours(24)
|
|
3534
|
+
'''
|
|
3535
|
+
result = self._values.get("max_event_age")
|
|
3536
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
3537
|
+
|
|
3538
|
+
@builtins.property
|
|
3539
|
+
def retry_attempts(self) -> typing.Optional[jsii.Number]:
|
|
3540
|
+
'''The maximum number of times to retry when the target returns an error.
|
|
3541
|
+
|
|
3542
|
+
Minimum value of 0.
|
|
3543
|
+
Maximum value of 185.
|
|
3544
|
+
|
|
3545
|
+
:default: 185
|
|
3546
|
+
'''
|
|
3547
|
+
result = self._values.get("retry_attempts")
|
|
3548
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3549
|
+
|
|
3550
|
+
@builtins.property
|
|
3551
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
3552
|
+
'''An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
|
|
3553
|
+
|
|
3554
|
+
If none provided templates target will automatically create an IAM role with all the minimum necessary
|
|
3555
|
+
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
|
|
3556
|
+
will grant minimal required permissions.
|
|
3557
|
+
|
|
3558
|
+
:default: - created by target
|
|
3559
|
+
'''
|
|
3560
|
+
result = self._values.get("role")
|
|
3561
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
3562
|
+
|
|
3563
|
+
@builtins.property
|
|
3564
|
+
def task_definition(self) -> _TaskDefinition_a541a103:
|
|
3565
|
+
'''The task definition to use for scheduled tasks.
|
|
3566
|
+
|
|
3567
|
+
Note: this must be TaskDefinition, and not ITaskDefinition,
|
|
3568
|
+
as it requires properties that are not known for imported task definitions
|
|
3569
|
+
If you want to run a RunTask with an imported task definition,
|
|
3570
|
+
consider using a Universal target.
|
|
3571
|
+
'''
|
|
3572
|
+
result = self._values.get("task_definition")
|
|
3573
|
+
assert result is not None, "Required property 'task_definition' is missing"
|
|
3574
|
+
return typing.cast(_TaskDefinition_a541a103, result)
|
|
3575
|
+
|
|
3576
|
+
@builtins.property
|
|
3577
|
+
def capacity_provider_strategies(
|
|
3578
|
+
self,
|
|
3579
|
+
) -> typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]]:
|
|
3580
|
+
'''The capacity provider strategy to use for the task.
|
|
3581
|
+
|
|
3582
|
+
:default: - No capacity provider strategy
|
|
3583
|
+
'''
|
|
3584
|
+
result = self._values.get("capacity_provider_strategies")
|
|
3585
|
+
return typing.cast(typing.Optional[typing.List[_CapacityProviderStrategy_8d7b6657]], result)
|
|
3586
|
+
|
|
3587
|
+
@builtins.property
|
|
3588
|
+
def enable_ecs_managed_tags(self) -> typing.Optional[builtins.bool]:
|
|
3589
|
+
'''Specifies whether to enable Amazon ECS managed tags for the task.
|
|
3590
|
+
|
|
3591
|
+
:default: - false
|
|
3592
|
+
'''
|
|
3593
|
+
result = self._values.get("enable_ecs_managed_tags")
|
|
3594
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
3595
|
+
|
|
3596
|
+
@builtins.property
|
|
3597
|
+
def enable_execute_command(self) -> typing.Optional[builtins.bool]:
|
|
3598
|
+
'''Whether to enable execute command functionality for the containers in this task.
|
|
3599
|
+
|
|
3600
|
+
If true, this enables execute command functionality on all containers in the task.
|
|
3601
|
+
|
|
3602
|
+
:default: - false
|
|
3603
|
+
'''
|
|
3604
|
+
result = self._values.get("enable_execute_command")
|
|
3605
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
3606
|
+
|
|
3607
|
+
@builtins.property
|
|
3608
|
+
def group(self) -> typing.Optional[builtins.str]:
|
|
3609
|
+
'''Specifies an ECS task group for the task.
|
|
3610
|
+
|
|
3611
|
+
:default: - No group
|
|
3612
|
+
'''
|
|
3613
|
+
result = self._values.get("group")
|
|
3614
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3615
|
+
|
|
3616
|
+
@builtins.property
|
|
3617
|
+
def propagate_tags(self) -> typing.Optional[builtins.bool]:
|
|
3618
|
+
'''Specifies whether to propagate the tags from the task definition to the task.
|
|
3619
|
+
|
|
3620
|
+
If no value is specified, the tags are not propagated.
|
|
3621
|
+
|
|
3622
|
+
:default: - No tag propagation
|
|
3623
|
+
'''
|
|
3624
|
+
result = self._values.get("propagate_tags")
|
|
3625
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
3626
|
+
|
|
3627
|
+
@builtins.property
|
|
3628
|
+
def reference_id(self) -> typing.Optional[builtins.str]:
|
|
3629
|
+
'''The reference ID to use for the task.
|
|
3630
|
+
|
|
3631
|
+
:default: - No reference ID.
|
|
3632
|
+
'''
|
|
3633
|
+
result = self._values.get("reference_id")
|
|
3634
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3635
|
+
|
|
3636
|
+
@builtins.property
|
|
3637
|
+
def security_groups(self) -> typing.Optional[typing.List[_ISecurityGroup_acf8a799]]:
|
|
3638
|
+
'''The security groups associated with the task.
|
|
3639
|
+
|
|
3640
|
+
These security groups must all be in the same VPC.
|
|
3641
|
+
Controls inbound and outbound network access for the task.
|
|
3642
|
+
|
|
3643
|
+
:default: - The security group for the VPC is used.
|
|
3644
|
+
'''
|
|
3645
|
+
result = self._values.get("security_groups")
|
|
3646
|
+
return typing.cast(typing.Optional[typing.List[_ISecurityGroup_acf8a799]], result)
|
|
3647
|
+
|
|
3648
|
+
@builtins.property
|
|
3649
|
+
def tags(self) -> typing.Optional[typing.List[Tag]]:
|
|
3650
|
+
'''The metadata that you apply to the task to help you categorize and organize them.
|
|
3651
|
+
|
|
3652
|
+
Each tag consists of a key and an optional value, both of which you define.
|
|
3653
|
+
|
|
3654
|
+
:default: - No tags
|
|
3655
|
+
'''
|
|
3656
|
+
result = self._values.get("tags")
|
|
3657
|
+
return typing.cast(typing.Optional[typing.List[Tag]], result)
|
|
3658
|
+
|
|
3659
|
+
@builtins.property
|
|
3660
|
+
def task_count(self) -> typing.Optional[jsii.Number]:
|
|
3661
|
+
'''The number of tasks to create based on TaskDefinition.
|
|
3662
|
+
|
|
3663
|
+
:default: 1
|
|
3664
|
+
'''
|
|
3665
|
+
result = self._values.get("task_count")
|
|
3666
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3667
|
+
|
|
3668
|
+
@builtins.property
|
|
3669
|
+
def vpc_subnets(self) -> typing.Optional[_SubnetSelection_e57d76df]:
|
|
3670
|
+
'''The subnets associated with the task.
|
|
3671
|
+
|
|
3672
|
+
These subnets must all be in the same VPC.
|
|
3673
|
+
The task will be launched in these subnets.
|
|
3674
|
+
|
|
3675
|
+
:default: - all private subnets of the VPC are selected.
|
|
3676
|
+
'''
|
|
3677
|
+
result = self._values.get("vpc_subnets")
|
|
3678
|
+
return typing.cast(typing.Optional[_SubnetSelection_e57d76df], result)
|
|
3679
|
+
|
|
3680
|
+
@builtins.property
|
|
3681
|
+
def placement_constraints(
|
|
3682
|
+
self,
|
|
3683
|
+
) -> typing.Optional[typing.List[_PlacementConstraint_11d82a52]]:
|
|
3684
|
+
'''The rules that must be met in order to place a task on a container instance.
|
|
3685
|
+
|
|
3686
|
+
:default: - No placement constraints.
|
|
3687
|
+
'''
|
|
3688
|
+
result = self._values.get("placement_constraints")
|
|
3689
|
+
return typing.cast(typing.Optional[typing.List[_PlacementConstraint_11d82a52]], result)
|
|
3690
|
+
|
|
3691
|
+
@builtins.property
|
|
3692
|
+
def placement_strategies(
|
|
3693
|
+
self,
|
|
3694
|
+
) -> typing.Optional[typing.List[_PlacementStrategy_2bb6c232]]:
|
|
3695
|
+
'''The algorithm for selecting container instances for task placement.
|
|
3696
|
+
|
|
3697
|
+
:default: - No placement strategies.
|
|
3698
|
+
'''
|
|
3699
|
+
result = self._values.get("placement_strategies")
|
|
3700
|
+
return typing.cast(typing.Optional[typing.List[_PlacementStrategy_2bb6c232]], result)
|
|
3701
|
+
|
|
3702
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3703
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3704
|
+
|
|
3705
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3706
|
+
return not (rhs == self)
|
|
3707
|
+
|
|
3708
|
+
def __repr__(self) -> str:
|
|
3709
|
+
return "Ec2TaskProps(%s)" % ", ".join(
|
|
3710
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3711
|
+
)
|
|
3712
|
+
|
|
3713
|
+
|
|
3714
|
+
class EcsRunEc2Task(
|
|
3715
|
+
EcsRunTask,
|
|
3716
|
+
metaclass=jsii.JSIIMeta,
|
|
3717
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EcsRunEc2Task",
|
|
3718
|
+
):
|
|
3719
|
+
'''Schedule an ECS Task on EC2 using AWS EventBridge Scheduler.
|
|
3720
|
+
|
|
3721
|
+
:exampleMetadata: infused
|
|
3722
|
+
|
|
3723
|
+
Example::
|
|
3724
|
+
|
|
3725
|
+
import aws_cdk.aws_ecs as ecs
|
|
3726
|
+
|
|
3727
|
+
# cluster: ecs.ICluster
|
|
3728
|
+
# task_definition: ecs.Ec2TaskDefinition
|
|
3729
|
+
|
|
3730
|
+
|
|
3731
|
+
Schedule(self, "Schedule",
|
|
3732
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
3733
|
+
target=targets.EcsRunEc2Task(cluster,
|
|
3734
|
+
task_definition=task_definition
|
|
3735
|
+
)
|
|
3736
|
+
)
|
|
3737
|
+
'''
|
|
3738
|
+
|
|
3739
|
+
def __init__(
|
|
3740
|
+
self,
|
|
3741
|
+
cluster: _ICluster_16cddd09,
|
|
3742
|
+
*,
|
|
3743
|
+
placement_constraints: typing.Optional[typing.Sequence[_PlacementConstraint_11d82a52]] = None,
|
|
3744
|
+
placement_strategies: typing.Optional[typing.Sequence[_PlacementStrategy_2bb6c232]] = None,
|
|
3745
|
+
task_definition: _TaskDefinition_a541a103,
|
|
3746
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3747
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
3748
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
3749
|
+
group: typing.Optional[builtins.str] = None,
|
|
3750
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
3751
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
3752
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
3753
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3754
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
3755
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
3756
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3757
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3758
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3759
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3760
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3761
|
+
) -> None:
|
|
3762
|
+
'''
|
|
3763
|
+
:param cluster: -
|
|
3764
|
+
:param placement_constraints: The rules that must be met in order to place a task on a container instance. Default: - No placement constraints.
|
|
3765
|
+
:param placement_strategies: The algorithm for selecting container instances for task placement. Default: - No placement strategies.
|
|
3766
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
3767
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
3768
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
3769
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
3770
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
3771
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
3772
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
3773
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
3774
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
3775
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
3776
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
3777
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3778
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3779
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3780
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3781
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3782
|
+
'''
|
|
3783
|
+
if __debug__:
|
|
3784
|
+
type_hints = typing.get_type_hints(_typecheckingstub__746d976dc3c24e8de8cadcf42b961c78853df37a7880455598cfcde142867902)
|
|
3785
|
+
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
3786
|
+
props = Ec2TaskProps(
|
|
3787
|
+
placement_constraints=placement_constraints,
|
|
3788
|
+
placement_strategies=placement_strategies,
|
|
3789
|
+
task_definition=task_definition,
|
|
3790
|
+
capacity_provider_strategies=capacity_provider_strategies,
|
|
3791
|
+
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
3792
|
+
enable_execute_command=enable_execute_command,
|
|
3793
|
+
group=group,
|
|
3794
|
+
propagate_tags=propagate_tags,
|
|
3795
|
+
reference_id=reference_id,
|
|
3796
|
+
security_groups=security_groups,
|
|
3797
|
+
tags=tags,
|
|
3798
|
+
task_count=task_count,
|
|
3799
|
+
vpc_subnets=vpc_subnets,
|
|
3800
|
+
dead_letter_queue=dead_letter_queue,
|
|
3801
|
+
input=input,
|
|
3802
|
+
max_event_age=max_event_age,
|
|
3803
|
+
retry_attempts=retry_attempts,
|
|
3804
|
+
role=role,
|
|
3805
|
+
)
|
|
3806
|
+
|
|
3807
|
+
jsii.create(self.__class__, self, [cluster, props])
|
|
3808
|
+
|
|
3809
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
3810
|
+
def _bind_base_target_config(
|
|
3811
|
+
self,
|
|
3812
|
+
_schedule: _ISchedule_4a32574d,
|
|
3813
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
3814
|
+
'''
|
|
3815
|
+
:param _schedule: -
|
|
3816
|
+
'''
|
|
3817
|
+
if __debug__:
|
|
3818
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c048ed62488b8de83127af7a33e8932cd4af11ae2b50e4c9515301957758a6c7)
|
|
3819
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
3820
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
3821
|
+
|
|
3822
|
+
|
|
3823
|
+
class EcsRunFargateTask(
|
|
3824
|
+
EcsRunTask,
|
|
3825
|
+
metaclass=jsii.JSIIMeta,
|
|
3826
|
+
jsii_type="aws-cdk-lib.aws_scheduler_targets.EcsRunFargateTask",
|
|
3827
|
+
):
|
|
3828
|
+
'''Schedule an ECS Task on Fargate using AWS EventBridge Scheduler.
|
|
3829
|
+
|
|
3830
|
+
:exampleMetadata: infused
|
|
3831
|
+
|
|
3832
|
+
Example::
|
|
3833
|
+
|
|
3834
|
+
import aws_cdk.aws_ecs as ecs
|
|
3835
|
+
|
|
3836
|
+
# cluster: ecs.ICluster
|
|
3837
|
+
# task_definition: ecs.FargateTaskDefinition
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
Schedule(self, "Schedule",
|
|
3841
|
+
schedule=ScheduleExpression.rate(cdk.Duration.minutes(60)),
|
|
3842
|
+
target=targets.EcsRunFargateTask(cluster,
|
|
3843
|
+
task_definition=task_definition
|
|
3844
|
+
)
|
|
3845
|
+
)
|
|
3846
|
+
'''
|
|
3847
|
+
|
|
3848
|
+
def __init__(
|
|
3849
|
+
self,
|
|
3850
|
+
cluster: _ICluster_16cddd09,
|
|
3851
|
+
*,
|
|
3852
|
+
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
3853
|
+
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
3854
|
+
task_definition: _TaskDefinition_a541a103,
|
|
3855
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3856
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
3857
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
3858
|
+
group: typing.Optional[builtins.str] = None,
|
|
3859
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
3860
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
3861
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
3862
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3863
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
3864
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
3865
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
3866
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
3867
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
3868
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
3869
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3870
|
+
) -> None:
|
|
3871
|
+
'''
|
|
3872
|
+
:param cluster: -
|
|
3873
|
+
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. If true, the task will receive a public IP address and be accessible from the internet. Should only be set to true when using public subnets. Default: - true if the subnet type is PUBLIC, otherwise false
|
|
3874
|
+
:param platform_version: Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. Platform versions determine the underlying runtime environment for the task. Default: - LATEST
|
|
3875
|
+
:param task_definition: The task definition to use for scheduled tasks. Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
|
|
3876
|
+
:param capacity_provider_strategies: The capacity provider strategy to use for the task. Default: - No capacity provider strategy
|
|
3877
|
+
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the task. Default: - false
|
|
3878
|
+
:param enable_execute_command: Whether to enable execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
3879
|
+
:param group: Specifies an ECS task group for the task. Default: - No group
|
|
3880
|
+
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - No tag propagation
|
|
3881
|
+
:param reference_id: The reference ID to use for the task. Default: - No reference ID.
|
|
3882
|
+
:param security_groups: The security groups associated with the task. These security groups must all be in the same VPC. Controls inbound and outbound network access for the task. Default: - The security group for the VPC is used.
|
|
3883
|
+
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No tags
|
|
3884
|
+
:param task_count: The number of tasks to create based on TaskDefinition. Default: 1
|
|
3885
|
+
:param vpc_subnets: The subnets associated with the task. These subnets must all be in the same VPC. The task will be launched in these subnets. Default: - all private subnets of the VPC are selected.
|
|
3886
|
+
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
3887
|
+
:param input: Input passed to the target. Default: - no input.
|
|
3888
|
+
:param max_event_age: The maximum age of a request that Scheduler sends to a target for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
3889
|
+
:param retry_attempts: The maximum number of times to retry when the target returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
3890
|
+
:param role: An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf. If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions. Default: - created by target
|
|
3891
|
+
'''
|
|
3892
|
+
if __debug__:
|
|
3893
|
+
type_hints = typing.get_type_hints(_typecheckingstub__78c355ce63d9e4845ecd3f3fb90d1a3fe8ebc7a6e515996d93a54cbf09be582d)
|
|
3894
|
+
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
3895
|
+
props = FargateTaskProps(
|
|
3896
|
+
assign_public_ip=assign_public_ip,
|
|
3897
|
+
platform_version=platform_version,
|
|
3898
|
+
task_definition=task_definition,
|
|
3899
|
+
capacity_provider_strategies=capacity_provider_strategies,
|
|
3900
|
+
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
3901
|
+
enable_execute_command=enable_execute_command,
|
|
3902
|
+
group=group,
|
|
3903
|
+
propagate_tags=propagate_tags,
|
|
3904
|
+
reference_id=reference_id,
|
|
3905
|
+
security_groups=security_groups,
|
|
3906
|
+
tags=tags,
|
|
3907
|
+
task_count=task_count,
|
|
3908
|
+
vpc_subnets=vpc_subnets,
|
|
3909
|
+
dead_letter_queue=dead_letter_queue,
|
|
3910
|
+
input=input,
|
|
3911
|
+
max_event_age=max_event_age,
|
|
3912
|
+
retry_attempts=retry_attempts,
|
|
3913
|
+
role=role,
|
|
3914
|
+
)
|
|
3915
|
+
|
|
3916
|
+
jsii.create(self.__class__, self, [cluster, props])
|
|
3917
|
+
|
|
3918
|
+
@jsii.member(jsii_name="bindBaseTargetConfig")
|
|
3919
|
+
def _bind_base_target_config(
|
|
3920
|
+
self,
|
|
3921
|
+
_schedule: _ISchedule_4a32574d,
|
|
3922
|
+
) -> _ScheduleTargetConfig_74216353:
|
|
3923
|
+
'''
|
|
3924
|
+
:param _schedule: -
|
|
3925
|
+
'''
|
|
3926
|
+
if __debug__:
|
|
3927
|
+
type_hints = typing.get_type_hints(_typecheckingstub__922a85e32cff3eab12f4b0f6b998b5d7e2370b966dbee4458874c3806ebde41e)
|
|
3928
|
+
check_type(argname="argument _schedule", value=_schedule, expected_type=type_hints["_schedule"])
|
|
3929
|
+
return typing.cast(_ScheduleTargetConfig_74216353, jsii.invoke(self, "bindBaseTargetConfig", [_schedule]))
|
|
3930
|
+
|
|
3931
|
+
|
|
3932
|
+
__all__ = [
|
|
3933
|
+
"CodeBuildStartBuild",
|
|
3934
|
+
"CodePipelineStartPipelineExecution",
|
|
3935
|
+
"Ec2TaskProps",
|
|
3936
|
+
"EcsRunEc2Task",
|
|
3937
|
+
"EcsRunFargateTask",
|
|
3938
|
+
"EcsRunTask",
|
|
3939
|
+
"EcsRunTaskBaseProps",
|
|
3940
|
+
"EventBridgePutEvents",
|
|
3941
|
+
"EventBridgePutEventsEntry",
|
|
3942
|
+
"FargateTaskProps",
|
|
3943
|
+
"FirehosePutRecord",
|
|
3944
|
+
"InspectorStartAssessmentRun",
|
|
3945
|
+
"KinesisStreamPutRecord",
|
|
3946
|
+
"KinesisStreamPutRecordProps",
|
|
3947
|
+
"LambdaInvoke",
|
|
3948
|
+
"SageMakerPipelineParameter",
|
|
3949
|
+
"SageMakerStartPipelineExecution",
|
|
3950
|
+
"SageMakerStartPipelineExecutionProps",
|
|
3951
|
+
"ScheduleTargetBase",
|
|
3952
|
+
"ScheduleTargetBaseProps",
|
|
3953
|
+
"SnsPublish",
|
|
3954
|
+
"SqsSendMessage",
|
|
3955
|
+
"SqsSendMessageProps",
|
|
3956
|
+
"StepFunctionsStartExecution",
|
|
3957
|
+
"Tag",
|
|
3958
|
+
"Universal",
|
|
3959
|
+
"UniversalTargetProps",
|
|
3960
|
+
]
|
|
3961
|
+
|
|
3962
|
+
publication.publish()
|
|
3963
|
+
|
|
3964
|
+
def _typecheckingstub__c20ea1ffb2760df785aee8014a687654066d35e08ebf631810b29af40f20952b(
|
|
3965
|
+
*,
|
|
3966
|
+
detail: _ScheduleTargetInput_dd30d070,
|
|
3967
|
+
detail_type: builtins.str,
|
|
3968
|
+
event_bus: _IEventBus_88d13111,
|
|
3969
|
+
source: builtins.str,
|
|
3970
|
+
) -> None:
|
|
3971
|
+
"""Type checking stubs"""
|
|
3972
|
+
pass
|
|
3973
|
+
|
|
3974
|
+
def _typecheckingstub__a9b88d9119f8045f4c3b695d8ed58b7f5b8833e798cbc2660e4c8ba59fc95cb1(
|
|
3975
|
+
*,
|
|
3976
|
+
name: builtins.str,
|
|
3977
|
+
value: builtins.str,
|
|
3978
|
+
) -> None:
|
|
3979
|
+
"""Type checking stubs"""
|
|
3980
|
+
pass
|
|
3981
|
+
|
|
3982
|
+
def _typecheckingstub__8d830072c02aa1c93302e9c28e7f88fb42c5a6a2a9deec3c567a7179aebb7d89(
|
|
3983
|
+
base_props: typing.Union[ScheduleTargetBaseProps, typing.Dict[builtins.str, typing.Any]],
|
|
3984
|
+
target_arn: builtins.str,
|
|
3985
|
+
) -> None:
|
|
3986
|
+
"""Type checking stubs"""
|
|
3987
|
+
pass
|
|
3988
|
+
|
|
3989
|
+
def _typecheckingstub__01737bee0bf8db4b920430443ea84a27c1c2f6246bd71927150a4fb28accc32d(
|
|
3990
|
+
schedule: _ISchedule_4a32574d,
|
|
3991
|
+
) -> None:
|
|
3992
|
+
"""Type checking stubs"""
|
|
3993
|
+
pass
|
|
3994
|
+
|
|
3995
|
+
def _typecheckingstub__bd8a5015bbf00d1130163ba73634014dc8420ec6c2484ca7ca7e2d9776b12c60(
|
|
3996
|
+
_schedule: _ISchedule_4a32574d,
|
|
3997
|
+
) -> None:
|
|
3998
|
+
"""Type checking stubs"""
|
|
3999
|
+
pass
|
|
4000
|
+
|
|
4001
|
+
def _typecheckingstub__13ff83395a9b3dcc596bc1aa8b656c8638facf50a6854e6d21772607443b3efc(
|
|
4002
|
+
role: _IRole_235f5d8e,
|
|
4003
|
+
) -> None:
|
|
4004
|
+
"""Type checking stubs"""
|
|
4005
|
+
pass
|
|
4006
|
+
|
|
4007
|
+
def _typecheckingstub__29dad4add4695787b706ed4741ddf63b9b8130a1bdf3339dff7939d0917e60de(
|
|
4008
|
+
*,
|
|
4009
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4010
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4011
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4012
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4013
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4014
|
+
) -> None:
|
|
4015
|
+
"""Type checking stubs"""
|
|
4016
|
+
pass
|
|
4017
|
+
|
|
4018
|
+
def _typecheckingstub__961b73901f7c52b4629b4552b6be3585368cfc6c4de258420a2e2c4c9108b398(
|
|
4019
|
+
topic: _ITopic_9eca4852,
|
|
4020
|
+
*,
|
|
4021
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4022
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4023
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4024
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4025
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4026
|
+
) -> None:
|
|
4027
|
+
"""Type checking stubs"""
|
|
4028
|
+
pass
|
|
4029
|
+
|
|
4030
|
+
def _typecheckingstub__6302629a59c54cd7dafc566171c4a283657f72f44a44767384888df0e6012021(
|
|
4031
|
+
role: _IRole_235f5d8e,
|
|
4032
|
+
) -> None:
|
|
4033
|
+
"""Type checking stubs"""
|
|
4034
|
+
pass
|
|
4035
|
+
|
|
4036
|
+
def _typecheckingstub__a86c2fb46323ac8851887e951da0704b179c89e96fbc73b43048720c09f816d0(
|
|
4037
|
+
queue: _IQueue_7ed6f679,
|
|
4038
|
+
*,
|
|
4039
|
+
message_group_id: typing.Optional[builtins.str] = None,
|
|
4040
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4041
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4042
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4043
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4044
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4045
|
+
) -> None:
|
|
4046
|
+
"""Type checking stubs"""
|
|
4047
|
+
pass
|
|
4048
|
+
|
|
4049
|
+
def _typecheckingstub__eef58dbd8df5d2551bec19ddf4779f0177025eb93b55e41899b7c2ad6298258b(
|
|
4050
|
+
role: _IRole_235f5d8e,
|
|
4051
|
+
) -> None:
|
|
4052
|
+
"""Type checking stubs"""
|
|
4053
|
+
pass
|
|
4054
|
+
|
|
4055
|
+
def _typecheckingstub__cc4c92c6b396957e8236f2f491374f5459edff0144a288b6c967faa0660c413d(
|
|
4056
|
+
_schedule: _ISchedule_4a32574d,
|
|
4057
|
+
) -> None:
|
|
4058
|
+
"""Type checking stubs"""
|
|
4059
|
+
pass
|
|
4060
|
+
|
|
4061
|
+
def _typecheckingstub__f9b071d098054dd80fee122aca519dd583724dcca2e31d39c850498cbc64a259(
|
|
4062
|
+
*,
|
|
4063
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4064
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4065
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4066
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4067
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4068
|
+
message_group_id: typing.Optional[builtins.str] = None,
|
|
4069
|
+
) -> None:
|
|
4070
|
+
"""Type checking stubs"""
|
|
4071
|
+
pass
|
|
4072
|
+
|
|
4073
|
+
def _typecheckingstub__f6f72a14975c4b50622c65c3545124a5a40541c99ee789b2764dd89dbe6db65e(
|
|
4074
|
+
state_machine: _IStateMachine_73e8d2b0,
|
|
4075
|
+
*,
|
|
4076
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4077
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4078
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4079
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4080
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4081
|
+
) -> None:
|
|
4082
|
+
"""Type checking stubs"""
|
|
4083
|
+
pass
|
|
4084
|
+
|
|
4085
|
+
def _typecheckingstub__bdb74e28e429f1b8574596c9b7d69dbbe6d4a87709fe0afeee3a982c558eefa6(
|
|
4086
|
+
role: _IRole_235f5d8e,
|
|
4087
|
+
) -> None:
|
|
4088
|
+
"""Type checking stubs"""
|
|
4089
|
+
pass
|
|
4090
|
+
|
|
4091
|
+
def _typecheckingstub__8d7e0165c9edbeca9c1f67729ca5e04e783483e5161d761577189cfb4595daf8(
|
|
4092
|
+
*,
|
|
4093
|
+
key: builtins.str,
|
|
4094
|
+
value: builtins.str,
|
|
4095
|
+
) -> None:
|
|
4096
|
+
"""Type checking stubs"""
|
|
4097
|
+
pass
|
|
4098
|
+
|
|
4099
|
+
def _typecheckingstub__198e835ff77413b2cbd7a9aad16223af355077748c1e61e3dc51f2c3390c66ca(
|
|
4100
|
+
role: _IRole_235f5d8e,
|
|
4101
|
+
) -> None:
|
|
4102
|
+
"""Type checking stubs"""
|
|
4103
|
+
pass
|
|
4104
|
+
|
|
4105
|
+
def _typecheckingstub__7aebf9e651de63ef570a11970d3762c22b62acdcb5386c5ba69076181e926f71(
|
|
4106
|
+
*,
|
|
4107
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4108
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4109
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4110
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4111
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4112
|
+
action: builtins.str,
|
|
4113
|
+
service: builtins.str,
|
|
4114
|
+
policy_statements: typing.Optional[typing.Sequence[_PolicyStatement_0fe33853]] = None,
|
|
4115
|
+
) -> None:
|
|
4116
|
+
"""Type checking stubs"""
|
|
4117
|
+
pass
|
|
4118
|
+
|
|
4119
|
+
def _typecheckingstub__eacc4f0e06890a24c88fe0c8814a8e396c6c6442e38857fee0168c08fca876ea(
|
|
4120
|
+
project: _IProject_aafae30a,
|
|
4121
|
+
*,
|
|
4122
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4123
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4124
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4125
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4126
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4127
|
+
) -> None:
|
|
4128
|
+
"""Type checking stubs"""
|
|
4129
|
+
pass
|
|
4130
|
+
|
|
4131
|
+
def _typecheckingstub__7638691fb0294fb00596be4967a0508a1091ee4b552678b943b548af397963ba(
|
|
4132
|
+
role: _IRole_235f5d8e,
|
|
4133
|
+
) -> None:
|
|
4134
|
+
"""Type checking stubs"""
|
|
4135
|
+
pass
|
|
4136
|
+
|
|
4137
|
+
def _typecheckingstub__f972d090ad80411fc0dff42233ee8b4ff2a48be68b7d646d1c7606a3cfb7fe56(
|
|
4138
|
+
pipeline: _IPipeline_0931f838,
|
|
4139
|
+
*,
|
|
4140
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4141
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4142
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4143
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4144
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4145
|
+
) -> None:
|
|
4146
|
+
"""Type checking stubs"""
|
|
4147
|
+
pass
|
|
4148
|
+
|
|
4149
|
+
def _typecheckingstub__31c5911116f5629c2adf9d1968007740095affaa6dad806ac8e1672101368386(
|
|
4150
|
+
role: _IRole_235f5d8e,
|
|
4151
|
+
) -> None:
|
|
4152
|
+
"""Type checking stubs"""
|
|
4153
|
+
pass
|
|
4154
|
+
|
|
4155
|
+
def _typecheckingstub__7ddc91e6308e91fc95fa167254f8538961d19df122eeefb13d6881448afdc147(
|
|
4156
|
+
cluster: _ICluster_16cddd09,
|
|
4157
|
+
*,
|
|
4158
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4159
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4160
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4161
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4162
|
+
group: typing.Optional[builtins.str] = None,
|
|
4163
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4164
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4165
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4166
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4167
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4168
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4169
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4170
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4171
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4172
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4173
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4174
|
+
) -> None:
|
|
4175
|
+
"""Type checking stubs"""
|
|
4176
|
+
pass
|
|
4177
|
+
|
|
4178
|
+
def _typecheckingstub__79f6648875df7112d642839162e2032e0cc5691244ea631e24984dc06b70af68(
|
|
4179
|
+
role: _IRole_235f5d8e,
|
|
4180
|
+
) -> None:
|
|
4181
|
+
"""Type checking stubs"""
|
|
4182
|
+
pass
|
|
4183
|
+
|
|
4184
|
+
def _typecheckingstub__658a297adc726b826b6ad0f740dd1153f7cd0ec47ab734b7e0c3748d30bd5285(
|
|
4185
|
+
_schedule: _ISchedule_4a32574d,
|
|
4186
|
+
) -> None:
|
|
4187
|
+
"""Type checking stubs"""
|
|
4188
|
+
pass
|
|
4189
|
+
|
|
4190
|
+
def _typecheckingstub__c784746a1d7efa2d6a0675e480c2ab5615af6620ac4fc75d4bc282aeb3ca6632(
|
|
4191
|
+
*,
|
|
4192
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4193
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4194
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4195
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4196
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4197
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4198
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4199
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4200
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4201
|
+
group: typing.Optional[builtins.str] = None,
|
|
4202
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4203
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4204
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4205
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4206
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4207
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4208
|
+
) -> None:
|
|
4209
|
+
"""Type checking stubs"""
|
|
4210
|
+
pass
|
|
4211
|
+
|
|
4212
|
+
def _typecheckingstub__9a0df4258a838e5a88cccc129492e95670a6c48a3a143968daf3304cda11b0d6(
|
|
4213
|
+
entry: typing.Union[EventBridgePutEventsEntry, typing.Dict[builtins.str, typing.Any]],
|
|
4214
|
+
*,
|
|
4215
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4216
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4217
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4218
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4219
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4220
|
+
) -> None:
|
|
4221
|
+
"""Type checking stubs"""
|
|
4222
|
+
pass
|
|
4223
|
+
|
|
4224
|
+
def _typecheckingstub__1baf9e2dc73c33da6a0e98590a98ae30c013c30b80ac84aa641d341184758895(
|
|
4225
|
+
role: _IRole_235f5d8e,
|
|
4226
|
+
) -> None:
|
|
4227
|
+
"""Type checking stubs"""
|
|
4228
|
+
pass
|
|
4229
|
+
|
|
4230
|
+
def _typecheckingstub__7bee2e860ddd29c71210c85b0d9356d7ffe68cb7e6730ee46e7d37cf1658eb30(
|
|
4231
|
+
_schedule: _ISchedule_4a32574d,
|
|
4232
|
+
) -> None:
|
|
4233
|
+
"""Type checking stubs"""
|
|
4234
|
+
pass
|
|
4235
|
+
|
|
4236
|
+
def _typecheckingstub__0044a48616a5f6b274082e4beba47a9cda8ff42476a3bbf0a62e271138d58442(
|
|
4237
|
+
*,
|
|
4238
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4239
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4240
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4241
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4242
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4243
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4244
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4245
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4246
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4247
|
+
group: typing.Optional[builtins.str] = None,
|
|
4248
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4249
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4250
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4251
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4252
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4253
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4254
|
+
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
4255
|
+
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
4256
|
+
) -> None:
|
|
4257
|
+
"""Type checking stubs"""
|
|
4258
|
+
pass
|
|
4259
|
+
|
|
4260
|
+
def _typecheckingstub__530a834e1b0aa54fcdcc7fc227e7d1c3328b1fe4d8b7a8b2c737ee83541bde6f(
|
|
4261
|
+
delivery_stream: _IDeliveryStream_8f118861,
|
|
4262
|
+
*,
|
|
4263
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4264
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4265
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4266
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4267
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4268
|
+
) -> None:
|
|
4269
|
+
"""Type checking stubs"""
|
|
4270
|
+
pass
|
|
4271
|
+
|
|
4272
|
+
def _typecheckingstub__12ef15c1799d86a7551586a9a9e97d06dd1a9ac00d3ff8f956b86ee6936fa7ea(
|
|
4273
|
+
role: _IRole_235f5d8e,
|
|
4274
|
+
) -> None:
|
|
4275
|
+
"""Type checking stubs"""
|
|
4276
|
+
pass
|
|
4277
|
+
|
|
4278
|
+
def _typecheckingstub__827e380295982b1bf320134c0d482e805db91e38e0a4e6207c777b292c586409(
|
|
4279
|
+
template: _IAssessmentTemplate_495c2d4e,
|
|
4280
|
+
*,
|
|
4281
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4282
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4283
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4284
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4285
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4286
|
+
) -> None:
|
|
4287
|
+
"""Type checking stubs"""
|
|
4288
|
+
pass
|
|
4289
|
+
|
|
4290
|
+
def _typecheckingstub__7b0a5298c5996dd44a33a53ddb1de44b183dab3534ae35332944ef46add41c3c(
|
|
4291
|
+
role: _IRole_235f5d8e,
|
|
4292
|
+
) -> None:
|
|
4293
|
+
"""Type checking stubs"""
|
|
4294
|
+
pass
|
|
4295
|
+
|
|
4296
|
+
def _typecheckingstub__844d4109ae2a35450c62ac93b6c125635f2ea9d42ffb8e4860d25d1e02b1064a(
|
|
4297
|
+
stream: _IStream_4e2457d2,
|
|
4298
|
+
*,
|
|
4299
|
+
partition_key: builtins.str,
|
|
4300
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4301
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4302
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4303
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4304
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4305
|
+
) -> None:
|
|
4306
|
+
"""Type checking stubs"""
|
|
4307
|
+
pass
|
|
4308
|
+
|
|
4309
|
+
def _typecheckingstub__8f68362f38606eda9d16e9f454710bd99b8cd843f84c5c0019bf2ea0a83d96d0(
|
|
4310
|
+
role: _IRole_235f5d8e,
|
|
4311
|
+
) -> None:
|
|
4312
|
+
"""Type checking stubs"""
|
|
4313
|
+
pass
|
|
4314
|
+
|
|
4315
|
+
def _typecheckingstub__13086e22bbba8b22a5916cdb6de3619bfa3160b4ffb06dd0b18358feff854092(
|
|
4316
|
+
_schedule: _ISchedule_4a32574d,
|
|
4317
|
+
) -> None:
|
|
4318
|
+
"""Type checking stubs"""
|
|
4319
|
+
pass
|
|
4320
|
+
|
|
4321
|
+
def _typecheckingstub__567db217f348a6c029d70c629fc520a2f785e26b04a4275cad20a047e712f916(
|
|
4322
|
+
*,
|
|
4323
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4324
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4325
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4326
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4327
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4328
|
+
partition_key: builtins.str,
|
|
4329
|
+
) -> None:
|
|
4330
|
+
"""Type checking stubs"""
|
|
4331
|
+
pass
|
|
4332
|
+
|
|
4333
|
+
def _typecheckingstub__2dd794e954362778258936b279d00e4ee11901171e9167c30c46af0264354987(
|
|
4334
|
+
func: _IFunction_6adb0ab8,
|
|
4335
|
+
*,
|
|
4336
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4337
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4338
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4339
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4340
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4341
|
+
) -> None:
|
|
4342
|
+
"""Type checking stubs"""
|
|
4343
|
+
pass
|
|
4344
|
+
|
|
4345
|
+
def _typecheckingstub__26671fb6a31106b3127d1e1ee335ad2e53f34baa3f498ccf404d68a494683324(
|
|
4346
|
+
role: _IRole_235f5d8e,
|
|
4347
|
+
) -> None:
|
|
4348
|
+
"""Type checking stubs"""
|
|
4349
|
+
pass
|
|
4350
|
+
|
|
4351
|
+
def _typecheckingstub__8b4d5d553374833e946836908362ee222905ef0a763dcb21589a9af03c37b17b(
|
|
4352
|
+
pipeline: _IPipeline_3f0dad92,
|
|
4353
|
+
*,
|
|
4354
|
+
pipeline_parameter_list: typing.Optional[typing.Sequence[typing.Union[SageMakerPipelineParameter, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4355
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4356
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4357
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4358
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4359
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4360
|
+
) -> None:
|
|
4361
|
+
"""Type checking stubs"""
|
|
4362
|
+
pass
|
|
4363
|
+
|
|
4364
|
+
def _typecheckingstub__ae0f7cdeb8aec78a69856eda18285d709f05365e1ff2cd96bf0165c868a6e7fb(
|
|
4365
|
+
role: _IRole_235f5d8e,
|
|
4366
|
+
) -> None:
|
|
4367
|
+
"""Type checking stubs"""
|
|
4368
|
+
pass
|
|
4369
|
+
|
|
4370
|
+
def _typecheckingstub__1d9975ba29adcd67e9e835e8a8a9b18c31ac8ad5864fa85ddfb1051ca2290643(
|
|
4371
|
+
schedule: _ISchedule_4a32574d,
|
|
4372
|
+
) -> None:
|
|
4373
|
+
"""Type checking stubs"""
|
|
4374
|
+
pass
|
|
4375
|
+
|
|
4376
|
+
def _typecheckingstub__e472e64e333014fc5530dd24fc7c0935430768f0699ea44f2dfd3d955bf20bc2(
|
|
4377
|
+
*,
|
|
4378
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4379
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4380
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4381
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4382
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4383
|
+
pipeline_parameter_list: typing.Optional[typing.Sequence[typing.Union[SageMakerPipelineParameter, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4384
|
+
) -> None:
|
|
4385
|
+
"""Type checking stubs"""
|
|
4386
|
+
pass
|
|
4387
|
+
|
|
4388
|
+
def _typecheckingstub__1411b21d63f24c8e116e80d07b271db391e0744a2d90d4aa94f5d32c29e37c72(
|
|
4389
|
+
*,
|
|
4390
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4391
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4392
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4393
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4394
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4395
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4396
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4397
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4398
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4399
|
+
group: typing.Optional[builtins.str] = None,
|
|
4400
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4401
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4402
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4403
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4404
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4405
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4406
|
+
placement_constraints: typing.Optional[typing.Sequence[_PlacementConstraint_11d82a52]] = None,
|
|
4407
|
+
placement_strategies: typing.Optional[typing.Sequence[_PlacementStrategy_2bb6c232]] = None,
|
|
4408
|
+
) -> None:
|
|
4409
|
+
"""Type checking stubs"""
|
|
4410
|
+
pass
|
|
4411
|
+
|
|
4412
|
+
def _typecheckingstub__746d976dc3c24e8de8cadcf42b961c78853df37a7880455598cfcde142867902(
|
|
4413
|
+
cluster: _ICluster_16cddd09,
|
|
4414
|
+
*,
|
|
4415
|
+
placement_constraints: typing.Optional[typing.Sequence[_PlacementConstraint_11d82a52]] = None,
|
|
4416
|
+
placement_strategies: typing.Optional[typing.Sequence[_PlacementStrategy_2bb6c232]] = None,
|
|
4417
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4418
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4419
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4420
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4421
|
+
group: typing.Optional[builtins.str] = None,
|
|
4422
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4423
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4424
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4425
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4426
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4427
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4428
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4429
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4430
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4431
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4432
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4433
|
+
) -> None:
|
|
4434
|
+
"""Type checking stubs"""
|
|
4435
|
+
pass
|
|
4436
|
+
|
|
4437
|
+
def _typecheckingstub__c048ed62488b8de83127af7a33e8932cd4af11ae2b50e4c9515301957758a6c7(
|
|
4438
|
+
_schedule: _ISchedule_4a32574d,
|
|
4439
|
+
) -> None:
|
|
4440
|
+
"""Type checking stubs"""
|
|
4441
|
+
pass
|
|
4442
|
+
|
|
4443
|
+
def _typecheckingstub__78c355ce63d9e4845ecd3f3fb90d1a3fe8ebc7a6e515996d93a54cbf09be582d(
|
|
4444
|
+
cluster: _ICluster_16cddd09,
|
|
4445
|
+
*,
|
|
4446
|
+
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
4447
|
+
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
4448
|
+
task_definition: _TaskDefinition_a541a103,
|
|
4449
|
+
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[_CapacityProviderStrategy_8d7b6657, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4450
|
+
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
4451
|
+
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4452
|
+
group: typing.Optional[builtins.str] = None,
|
|
4453
|
+
propagate_tags: typing.Optional[builtins.bool] = None,
|
|
4454
|
+
reference_id: typing.Optional[builtins.str] = None,
|
|
4455
|
+
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
4456
|
+
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4457
|
+
task_count: typing.Optional[jsii.Number] = None,
|
|
4458
|
+
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4459
|
+
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
4460
|
+
input: typing.Optional[_ScheduleTargetInput_dd30d070] = None,
|
|
4461
|
+
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
4462
|
+
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
4463
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4464
|
+
) -> None:
|
|
4465
|
+
"""Type checking stubs"""
|
|
4466
|
+
pass
|
|
4467
|
+
|
|
4468
|
+
def _typecheckingstub__922a85e32cff3eab12f4b0f6b998b5d7e2370b966dbee4458874c3806ebde41e(
|
|
4469
|
+
_schedule: _ISchedule_4a32574d,
|
|
4470
|
+
) -> None:
|
|
4471
|
+
"""Type checking stubs"""
|
|
4472
|
+
pass
|