aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

fix(stepfunctions-tasks): allow passing apiEndpoint as intrinsic function #32139

Open MathieuGilbert opened 21 hours ago

MathieuGilbert commented 21 hours ago

Issue #29925

Closes #29925, #30749.

Reason for this change

The apiEndpoint prop currently only works when it's a string (ie. TaskInput.fromText('some/text')), with the task failing when passed as a reference (ie. TaskInput.fromText(JsonPath.format('some/text/{}', '123')). This is needed to allow for dynamic parts in the path.

Description of changes

Description of how you validated changes

    const httpInvokeTask = new HttpInvoke(this, 'HttpInvoke', {
      apiRoot: api.url,
      apiEndpoint: TaskInput.fromJsonPathAt('$.endpointName'),
      method: TaskInput.fromText('GET'),
      connection,
      outputPath: '$.ResponseBody',
    })

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

codecov[bot] commented 21 hours ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.19%. Comparing base (6bb142e) to head (efb44cb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #32139 +/- ## ======================================= Coverage 77.19% 77.19% ======================================= Files 105 105 Lines 7164 7164 Branches 1311 1311 ======================================= Hits 5530 5530 Misses 1454 1454 Partials 180 180 ``` | [Flag](https://app.codecov.io/gh/aws/aws-cdk/pull/32139/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | Coverage Δ | | |---|---|---| | [suite.unit](https://app.codecov.io/gh/aws/aws-cdk/pull/32139/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | `77.19% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/aws/aws-cdk/pull/32139/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | Coverage Δ | | |---|---|---| | [packages/aws-cdk](https://app.codecov.io/gh/aws/aws-cdk/pull/32139/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | `77.19% <ø> (ø)` | |
MathieuGilbert commented 16 hours ago

Thanks for your help in getting these changes to green @ePak. I think it was the npm test after running the old tests that got it to pass. Unfortunately I don't get much time to work on this, so it's been dragging on.

aws-cdk-automation commented 16 hours ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository