Make the description dependent on the deployment environment #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently noticed that in my AWS Lambda Console, the descriptions of my Lambda functions deployed by Sidecar didn't have the right description.
For example, I had :
MyAPP [testing]: Sidecar function 'LambdaFunction'
for a function deployed for the production environment.After investigating, I realised that the function generating this description was based on the current execution environment at the time the deploy command was used, and not on the potential environment defined with --env= in cases where they are different.
If we take the case of a final CI/CD Pipeline where we execute a final set of tests before deploying a potential new version of our Lambda Functions and finally deploying our code (with a vapor command or other script), we end up with a description corresponding to the test environment, even if the command was :
php artisan sidecar deploy --env=production
To counter this problem :
Updated
description
function to make it useSidecar::getEnvironment()
instead ofconfig('app.env')
Allows the right environment to be used every time.
Modified the documentation to add a reference to possible customization of the description
In addition to the name and prefix already present in the doc
Thank you for this package 🚀