Skip to content

Commit

Permalink
update readme with an example for ScheduledEc2Task
Browse files Browse the repository at this point in the history
  • Loading branch information
moelasmar committed May 28, 2024
1 parent efcafd8 commit 8cb678b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/aws-cdk-lib/aws-ecs-patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,24 @@ const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'Schedul
});
```

### Customize Container Name for ScheduledEc2Task

```ts
declare const cluster: ecs.Cluster;
const ecsScheduledTask = new ecsPatterns.ScheduledEc2Task(this, 'ScheduledTask', {
cluster,
scheduledEc2TaskImageOptions: {
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
containerName: 'customContainerName',
memoryLimitMiB: 256,
environment: { name: 'TRIGGER', value: 'CloudWatch Events' },
},
schedule: appscaling.Schedule.expression('rate(1 minute)'),
enabled: true,
ruleName: 'sample-scheduled-task-rule',
});
```

### Set PlatformVersion for ScheduledFargateTask

```ts
Expand Down

0 comments on commit 8cb678b

Please sign in to comment.