Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition.
When using capacity provider of 'FARGATE', a task-level 'cpu' field is required.
This field is supposed to accept 'number', such as value 10.
Actual Behavior
Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition.
When using capacity provider of 'FARGATE', a task-level 'cpu' field is required.
This field accepts 'string', as provided by 'EcsTaskDefinitionConfig' interface.
When providing a string value, such as "10", terraform throws 'Invalid 'cpu' setting for task.'.
Steps to Reproduce
Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition.
When using capacity provider of 'FARGATE', a task-level 'cpu' field is required.
This field is supposed to accept 'number', but the interface 'EcsTaskDefinitionConfig' is expecting a string.
When providing a string value, such as "10", terraform throws 'Invalid 'cpu' setting for task.'.
I changed to 'number' manually in node_modules, and it worked.
in EcsTaskDefinitionConfig interface, change cpu type from 'string' to 'number'
Workarounds
manually change the cdktf library file typescript/node_modules/@cdktf/provider-aws/lib/ecs-task-definition/index.d.ts
to accept number instead.
Anything Else?
No response
References
No response
Help Wanted
[X] I'm interested in contributing a fix myself
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Expected Behavior
Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition. When using capacity provider of 'FARGATE', a task-level 'cpu' field is required. This field is supposed to accept 'number', such as value 10.
Actual Behavior
Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition. When using capacity provider of 'FARGATE', a task-level 'cpu' field is required. This field accepts 'string', as provided by 'EcsTaskDefinitionConfig' interface. When providing a string value, such as "10", terraform throws 'Invalid 'cpu' setting for task.'.
Steps to Reproduce
Happens when working in typescript with awsEcs resources, specifically with EcsTaskDefinition. When using capacity provider of 'FARGATE', a task-level 'cpu' field is required. This field is supposed to accept 'number', but the interface 'EcsTaskDefinitionConfig' is expecting a string. When providing a string value, such as "10", terraform throws 'Invalid 'cpu' setting for task.'. I changed to 'number' manually in node_modules, and it worked.
Versions
language: typescript cdktf-cli: 0.20.8 node: v20.17.0 cdktf: 0.20.8 constructs: 10.3.0 jsii: null terraform: 1.9.5 arch: x64 os: linux 5.15.153.1-microsoft-standard-WSL2 providers aws@undefined (LOCAL) terraform provider version: 5.65.0 @cdktf/provider-aws (PREBUILT) terraform provider version: 5.64.0 prebuilt provider version: 19.32.0 cdktf version: ^0.20.0
Providers
┌───────────────┬──────────────────┬─────────┬────────────┬─────────────────────┬─────────────────┐ │ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │ ├───────────────┼──────────────────┼─────────┼────────────┼─────────────────────┼─────────────────┤ │ aws │ 5.65.0 │ │ │ │ │ ├───────────────┼──────────────────┼─────────┼────────────┼─────────────────────┼─────────────────┤ │ aws │ 5.64.0 │ ^0.20.0 │ │ @cdktf/provider-aws │ 19.32.0 │ └───────────────┴──────────────────┴─────────┴────────────┴─────────────────────┴─────────────────┘
Gist
No response
Possible Solutions
in EcsTaskDefinitionConfig interface, change cpu type from 'string' to 'number'
Workarounds
manually change the cdktf library file typescript/node_modules/@cdktf/provider-aws/lib/ecs-task-definition/index.d.ts to accept number instead.
Anything Else?
No response
References
No response
Help Wanted
Community Note