-
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
ECS task definition does not allow you to set linuxParameters
, it is read only
#2380
Closed
nathanpeck opened this issue
Apr 25, 2019
· 1 comment
· Fixed by #2397 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Closed
ECS task definition does not allow you to set linuxParameters
, it is read only
#2380
nathanpeck opened this issue
Apr 25, 2019
· 1 comment
· Fixed by #2397 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
Comments
I found a workaround for now if anyone else encounters this: // Define the worker application.
this.workerDefinition = new ecs.Ec2TaskDefinition(this, 'worker-definition', {
cpu: '2048',
memoryMiB: '4096'
});
this.container = this.workerDefinition.addContainer('worker', {
image: ecs.ContainerImage.fromAsset(this, 'worker-image', {
directory: './worker'
}),
memoryLimitMiB: 4096,
privileged: true,
cpu: 2048
});
this.container.linuxParameters = new ecs.LinuxParameters();
// Headless chrome requires more shared memory for rendering large pages
this.container.linuxParameters.sharedMemorySize = 2048;
// Headless chrome uses sandboxing which requires system admin capability
this.container.linuxParameters.addCapabilities('SYS_ADMIN'); Although the constructor doesn't accept linuxParameters, if you are using JavaScript instead of TypeScript you can ignore the readonly status of the property and just overwrite the properties into the task defition that you need. |
SoManyHs
added a commit
to SoManyHs/aws-cdk
that referenced
this issue
Apr 30, 2019
4 tasks
SoManyHs
added a commit
to SoManyHs/aws-cdk
that referenced
this issue
Apr 30, 2019
SoManyHs
added a commit
to SoManyHs/aws-cdk
that referenced
this issue
Apr 30, 2019
rix0rrr
pushed a commit
that referenced
this issue
May 7, 2019
SanderKnape
pushed a commit
to SanderKnape/aws-cdk
that referenced
this issue
May 14, 2019
This was referenced Aug 22, 2019
This was referenced Dec 12, 2019
This was referenced Dec 13, 2019
This was referenced Jan 20, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no way to set the
linuxParameters
on an ECS task definition. It is present on the underlying CfnTaskDefinition.ContainerDefinitionProperty but is a readonly property on the actual CDK construct, with no way to set itSee the official ECS docs here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_linuxparameters
And the corresponding CFN docs here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html
The text was updated successfully, but these errors were encountered: