A scheduled EC2 task that will be initiated off of CloudWatch Events.
import { ScheduledEc2Task } from 'aws-cdk-lib/aws-ecs-patterns';Or use the module namespace:
import * as ecs_patterns from 'aws-cdk-lib/aws-ecs-patterns';
// ecs_patterns.ScheduledEc2TaskConfiguration passed to the constructor as ScheduledEc2TaskProps.
scheduledEc2TaskDefinitionOptionsOptionalScheduledEc2TaskDefinitionOptionsThe properties to define if using an existing TaskDefinition in this construct. ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.
Default: none
scheduledEc2TaskImageOptionsOptionalScheduledEc2TaskImageOptionsThe properties to define if the construct is to create a TaskDefinition. ScheduledEc2TaskDefinitionOptions or ScheduledEc2TaskImageOptions must be defined, but not both.
Default: none
ScheduledTaskBasePropsscheduleRequiredinherited from ScheduledTaskBasePropsScheduleThe schedule or rate (frequency) that determines when CloudWatch Events runs the rule. For more information, see [Schedule Expression Syntax for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) in the Amazon CloudWatch User Guide.
clusterOptionalinherited from ScheduledTaskBasePropsIClusterThe 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.
desiredTaskCountOptionalinherited from ScheduledTaskBasePropsnumberThe desired number of instantiations of the task definition to keep running on the service.
Default: 1
enabledOptionalinherited from ScheduledTaskBasePropsbooleanIndicates whether the rule is enabled.
Default: true
propagateTagsOptionalinherited from ScheduledTaskBasePropsPropagatedTagSourceSpecifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated.
Default: - Tags will not be propagated
ruleNameOptionalinherited from ScheduledTaskBasePropsstringA 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html).
securityGroupsOptionalinherited from ScheduledTaskBasePropsISecurityGroup[]Existing security groups to use for your service.
Default: - a new security group will be created.
subnetSelectionOptionalinherited from ScheduledTaskBasePropsSubnetSelectionIn what subnets to place the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking)
Default: Private subnets
tagsOptionalinherited from ScheduledTaskBasePropsTag[]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 are applied to the task
vpcOptionalinherited from ScheduledTaskBasePropsIVpcThe 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.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-ecs-patterns