Skip to content
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

EcsTaskDefinition: typescript: cpu expects string instead of number #3731

Open
1 task done
staswiner opened this issue Sep 21, 2024 · 0 comments
Open
1 task done

EcsTaskDefinition: typescript: cpu expects string instead of number #3731

staswiner opened this issue Sep 21, 2024 · 0 comments
Labels
bug Something isn't working new Un-triaged issue

Comments

@staswiner
Copy link

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

  • 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
@staswiner staswiner added bug Something isn't working new Un-triaged issue labels Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant