ScheduledFargateTaskProps¶
-
class
aws_cdk.aws_ecs_patterns.
ScheduledFargateTaskProps
(*, schedule, cluster=None, desired_task_count=None, enabled=None, rule_name=None, security_groups=None, subnet_selection=None, vpc=None, platform_version=None, scheduled_fargate_task_definition_options=None, scheduled_fargate_task_image_options=None)¶ Bases:
aws_cdk.aws_ecs_patterns.ScheduledTaskBaseProps
The properties for the ScheduledFargateTask task.
- Parameters
schedule (
Schedule
) – The schedule or rate (frequency) that determines when CloudWatch Events runs the rule. For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.cluster (
Optional
[ICluster
]) – The name of the cluster that hosts the service. If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc. Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.desired_task_count (
Union
[int
,float
,None
]) – The desired number of instantiations of the task definition to keep running on the service. Default: 1enabled (
Optional
[bool
]) – Indicates whether the rule is enabled. Default: truerule_name (
Optional
[str
]) – A name for the rule. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.security_groups (
Optional
[Sequence
[ISecurityGroup
]]) – Existing security groups to use for your service. Default: - a new security group will be created.subnet_selection (
Optional
[SubnetSelection
]) – In what subnets to place the task’s ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking) Default: Private subnetsvpc (
Optional
[IVpc
]) – The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed. If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster. Default: - uses the VPC defined in the cluster or creates a new VPC.platform_version (
Optional
[FargatePlatformVersion
]) – The platform version on which to run your service. If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide. Default: Latestscheduled_fargate_task_definition_options (
Optional
[ScheduledFargateTaskDefinitionOptions
]) – The properties to define if using an existing TaskDefinition in this construct. ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both. Default: nonescheduled_fargate_task_image_options (
Optional
[ScheduledFargateTaskImageOptions
]) – The properties to define if the construct is to create a TaskDefinition. ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both. Default: none
- ExampleMetadata
infused
Example:
# cluster: ecs.Cluster scheduled_fargate_task = ecs_patterns.ScheduledFargateTask(self, "ScheduledFargateTask", cluster=cluster, scheduled_fargate_task_image_options=ecsPatterns.ScheduledFargateTaskImageOptions( image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"), memory_limit_mi_b=512 ), schedule=appscaling.Schedule.expression("rate(1 minute)"), platform_version=ecs.FargatePlatformVersion.LATEST )
Attributes
-
cluster
¶ The name of the cluster that hosts the service.
If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
- Default
create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
- Return type
Optional
[ICluster
]
-
desired_task_count
¶ The desired number of instantiations of the task definition to keep running on the service.
- Default
1
- Return type
Union
[int
,float
,None
]
-
enabled
¶ Indicates whether the rule is enabled.
- Default
true
- Return type
Optional
[bool
]
-
platform_version
¶ The platform version on which to run your service.
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
- Default
Latest
- Return type
Optional
[FargatePlatformVersion
]
-
rule_name
¶ A name for the rule.
- Default
AWS CloudFormation generates a unique physical ID and uses that ID
for the rule name. For more information, see Name Type.
- Return type
Optional
[str
]
-
schedule
¶ The schedule or rate (frequency) that determines when CloudWatch Events runs the rule.
For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.
- Return type
-
scheduled_fargate_task_definition_options
¶ The properties to define if using an existing TaskDefinition in this construct.
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
- Default
none
- Return type
Optional
[ScheduledFargateTaskDefinitionOptions
]
-
scheduled_fargate_task_image_options
¶ The properties to define if the construct is to create a TaskDefinition.
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
- Default
none
- Return type
Optional
[ScheduledFargateTaskImageOptions
]
-
security_groups
¶ Existing security groups to use for your service.
- Default
a new security group will be created.
- Return type
Optional
[List
[ISecurityGroup
]]
-
subnet_selection
¶ In what subnets to place the task’s ENIs.
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
- Default
Private subnets
- Return type
Optional
[SubnetSelection
]
-
vpc
¶ The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
- Default
uses the VPC defined in the cluster or creates a new VPC.
- Return type
Optional
[IVpc
]