(ecs-patterns): ScheduledFargateTask - runtime platform ignored
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
The runtime platform on the pattern top level is getting ignored when set, for example as LINUX ARM64.
```
const scheduledTask = new ecsPatterns.ScheduledFargateTask(this, 'ScheduledTask', {
cluster: cluster,
schedule: Schedule.expression('cron(*/1 * * * ? *)'),
subnetSelection: subnetsSelection,
scheduledFargateTaskImageOptions: {
image: ecs.ContainerImage.fromDockerImageAsset(dockerAsset),
memoryLimitMiB: 512,
cpu: 256,
command: ['python', 'manage.py'],
logDriver: new ecs.AwsLogDriver({streamPrefix: 'ScheduledTask'}),
environment: {
DEBUG: "1",
},
secrets: {
...secrets,
},
},
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.ARM64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
});
```
### Expected Behavior
The task definition should have the image arch set to LINUX/ARM64
### Current Behavior
The task definition should have the image arch is not set. Therefore defaults to LINUX/X86_64 during deployment
### Reproduction Steps
```
const scheduledTask = new ecsPatterns.ScheduledFargateTask(this, 'ScheduledTask', {
cluster: cluster,
schedule: Schedule.expression('cron(*/1 * * * ? *)'),
subnetSelection: subnetsSelection,
scheduledFargateTaskImageOptions: {
image: ecs.ContainerImage.fromDockerImageAsset(dockerAsset),
memoryLimitMiB: 512,
cpu: 256,
command: ['python', 'manage.py'],
logDriver: new ecs.AwsLogDriver({streamPrefix: 'ScheduledTask'}),
environment: {
DEBUG: "1",
},
secrets: {
...secrets,
},
},
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.ARM64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
});
```
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.100
### Framework Version
_No response_
### Node.js Version
20.8
### OS
Mac
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start at the ScheduledFargateTask entry point and trace how the supplied runtimePlatform reaches the generated task definition. Reproduce the issue with the provided Linux/ARM64 configuration, then add coverage showing that the task definition preserves both settings and run the focused tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100