ScheduledEc2TaskDefinitionOptions Struct
The properties for the ScheduledEc2Task using a task definition.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_ecs_patterns as ecs_patterns } from 'aws-cdk-lib';
declare const ec2TaskDefinition: ecs.Ec2TaskDefinition;
const scheduledEc2TaskDefinitionOptions: ecs_patterns.ScheduledEc2TaskDefinitionOptions = {
taskDefinition: ec2TaskDefinition,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_ecs_patterns as ecs_patterns
# ec2_task_definition: ecs.Ec2TaskDefinition
scheduled_ec2_task_definition_options = ecs_patterns.ScheduledEc2TaskDefinitionOptions(
task_definition=ec2_task_definition
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.ecs.patterns.*;
Ec2TaskDefinition ec2TaskDefinition;
ScheduledEc2TaskDefinitionOptions scheduledEc2TaskDefinitionOptions = ScheduledEc2TaskDefinitionOptions.builder()
.taskDefinition(ec2TaskDefinition)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.ECS.Patterns;
Ec2TaskDefinition ec2TaskDefinition;
var scheduledEc2TaskDefinitionOptions = new ScheduledEc2TaskDefinitionOptions {
TaskDefinition = ec2TaskDefinition
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var ec2TaskDefinition Ec2TaskDefinition
scheduledEc2TaskDefinitionOptions := &ScheduledEc2TaskDefinitionOptions{
TaskDefinition: ec2TaskDefinition,
}
Properties
taskDefinitionEc2TaskDefinitiontask_definitionEc2TaskDefinitiontaskDefinitionEc2TaskDefinitionTaskDefinitionEc2TaskDefinitionTaskDefinitionEc2TaskDefinition= nonerequired#The task definition to use for tasks in the service. One of image or taskDefinition must be specified.
[disable-awslint:ref-via-interface]