aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
68 stars 13 forks source link

Allow version description to be specified when running `aws lambda update-function-code` with `--publish` option #509

Closed eoeoms closed 1 year ago

eoeoms commented 1 year ago

Describe the feature

aws lambda publish-version supports the --description option to override the description in the function configuration.

However, for aws lambda update-function-code command, while it supports the --publish option to publish a new version of the function after updating the code, (which has the same effect as calling PublishVersion separately) there's no way to provide the version description for overriding the description in the function configuration. It'll always just use the description of the function as the version description.

It'd be nice to be able to provide a version description when running aws lambda update-function-code with the --publish option.

Use Case

This is related to aws/aws-cli#6585.

I was also running the aws lambda update-function-code and aws lambda publish-version back to back in my CI/CD pipeline, which sometimes failed because the previous update didn't complete yet.

I fully understand why this is happening, and some ways to properly get around it, (like checking for the LastUpdateStatus of the function using aws lambda get-function or aws lambda get-function-configuration before making another update) but I just thought it'd be nice if I didn't have to implement any extra logic to wait until the previous update is completed, especially since aws cli already supports updating the function code and publishing a version with a single command that presumably handles checking for the LastUpdateStatus under the hood.

Proposed Solution

Add support for --description option to the aws lambda update-function-code command that works similarly to that of the aws lambda publish-version command.

Other Information

Technically, for my use case, adding a feature to the aws lambda update-function-code command where users can provide it an option to make the command complete the execution only when the LastUpdateStatus changes to Successful or Failed would work out too.

And this alternative solution could be a more versatile solution that can also be applied to any of the other commands that updates a function, like update-function-configuration and publish-version.

Acknowledgements

CLI version used

2.11.6

Environment details (OS name and version, etc.)

Windows

tim-finnigan commented 1 year ago

Thanks @eoeoms for the feature request. This would be a request for the Lambda team, as they own the UpdateFunctionCode API. I'll go ahead and transfer this issue to our cross-SDK repository and reach out to the Lambda team for further review.

tim-finnigan commented 1 year ago

P84820090

tim-finnigan commented 1 year ago

I was advised that a support case was created for this. We can continue tracking the request via that ticket.

github-actions[bot] commented 1 year ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.