-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-ecs): support RuntimePlatform Property at TaskDefinition class for create windows OperatingSystem #17242
Comments
Thanks for submitting this feature request @neilkuan, The underlying taskDefinition doesn't get created with this property. aws-cdk/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts Lines 420 to 448 in 9c094ae
CloudFormation docs on RuntimePlatform To work around this before we officially support it, you should be able to use an escape hatch to apply this property as needed. Contributions are welcome as well 😃 |
yes, I already did that :). const vpc = ec2.Vpc.fromLookup(this, 'VPC', { isDefault: true });
const cluster = new ecs.Cluster(this, 'Cluster', {
vpc,
enableFargateCapacityProviders: true,
});
const taskdef = new ecs.TaskDefinition(this, 'TaskDef', { compatibility: ecs.Compatibility.FARGATE, memoryMiB: '2048', cpu: '1024' });
taskdef.addContainer('Container', {
logging: ecs.LogDriver.awsLogs({ streamPrefix: 'win-iis-on-fargate' }),
portMappings: [{ containerPort: 80 }],
image: ecs.ContainerImage.fromRegistry('mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019'),
});
(taskdef.node.defaultChild as ecs.CfnTaskDefinition).addPropertyOverride('RuntimePlatform', {
OperatingSystemFamily: 'WINDOWS_SERVER_2019_CORE',
});
const fargateWindowsService = new ecs.FargateService(this, 'Service', {
taskDefinition: taskdef,
cluster,
assignPublicIp: true,
});
ecs.WindowsOptimizedVersion.SERVER_2019;
fargateWindowsService.connections.allowFrom(ec2.Peer.ipv4(`${process.env.MYIP}/32`), ec2.Port.tcp(80)); |
Looks like v46 spec has the |
For python, we can do the same task_definition = ecs.TaskDefinition(
.....
)
# Import resource as cfn resource
cfn_task_definition = task_definition.node.find_child("Resource")
# Override cfn resource property
cfn_task_definition.add_override(
"Properties.RuntimePlatform.OperatingSystemFamily", "WINDOWS_SERVER_2019_CORE") |
Could you please share any docs to help me start contributing. |
Thanks for your interest @suresh26k, please check out CONTRIBUTING.md. Let me know if you have any further questions 🙂 |
|
Description
support
RuntimePlatform
Property atTaskDefinition
class for create windows OperatingSystem.Use Case
Windows support for AWS Fargate on Amazon ECS on 28 OCT 2021 .
https://aws.amazon.com/tw/blogs/containers/running-windows-containers-with-amazon-ecs-on-aws-fargate/
Proposed Solution
support RuntimePlatform Property at TaskDefinition class.
Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: