-
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-cdk: Duration.parse() does not handle units larger then days #29572
Labels
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
package/tools
Related to AWS CDK Tools or CLI
Comments
mattaschmann
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 21, 2024
Thank you for the report. And @msambol thanks for your PR as always! |
pahud
added
p2
effort/medium
Medium work item – several days of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 22, 2024
mergify bot
pushed a commit
that referenced
this issue
Mar 22, 2024
Closes #29572. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
jun1-t
pushed a commit
to jun1-t/aws-cdk
that referenced
this issue
Mar 23, 2024
Closes aws#29572. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
ahammond
pushed a commit
to ahammond/aws-cdk
that referenced
this issue
Mar 26, 2024
Closes aws#29572. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
package/tools
Related to AWS CDK Tools or CLI
Describe the bug
While trying to use
cdk.Duration.parse()
with the stringsP1Y
andP1M
it threw errors. Looking at the source (aws-cdk/packages/aws-cdk-lib/core/lib/duration.ts
Lines 69 to 89 in 43e681e
Expected Behavior
As the documentation for this message states:
It should correctly handle all valid ISO 8601 strings. Either that, or the documentation needs to indicate it doesn't handled anything larger then days.
Current Behavior
Throws an error on any unit larger then a day.
Reproduction Steps
import * as cdk from 'aws-cdk-lib'
cdk.Duration.parse('P1Y')
cdk.Duration.parse('P1M')
Possible Solution
Add larger units to the regular expression and handle them, or change the documentation to indicate that they are not handled.
Additional Information/Context
No response
CDK CLI Version
2.115.0 (build 58027ee)
Framework Version
No response
Node.js Version
v18.15.0
OS
macOS: 14.3.1 (23D60)
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: