Repository navigation
Add support for aws:region and aws:accountId variables - #9662
Conversation
501c33e to
9f691e8
Compare
Codecov Report
@@ Coverage Diff @@
## master #9662 +/- ##
==========================================
+ Coverage 86.14% 86.15% +0.01%
==========================================
Files 326 327 +1
Lines 12439 12483 +44
==========================================
+ Hits 10715 10755 +40
- Misses 1724 1728 +4
Continue to review full report at Codecov.
|
medikoo
left a comment
There was a problem hiding this comment.
@pgrzesik that was fast, and that looks really good!
There's just one thing by spec it was outlined that region should also be resolved in context of aws source (in our internals it's AWS specific property, and I think it's the way it should stay)
| if (!stage) stage = 'dev'; | ||
| return { value: stage }; | ||
| } | ||
| case 'region': { |
There was a problem hiding this comment.
Region is internally considered as AWS specific. It's also the reason why it was specified to be put at aws: source
There was a problem hiding this comment.
While it's considered AWS specific, other major providers also have such concept and support it on provider level, however, I agree that it's tricky because it defaults to us-east-1 which is AWS-specific.
Azure: https://github.com/serverless/serverless-azure-functions/blob/c53f535204c467339e8ae1f6edb985c3280bc32c/src/models/serverless.ts#L39
Google: https://github.com/serverless/serverless-google-cloudfunctions/blob/master/provider/googleProvider.js#L107
Given above, do you think we should stick to region being in aws source?
There was a problem hiding this comment.
Given above, do you think we should stick to region being in aws source?
I believe so. Main reason is that different dictionaries are used in different providers. While with stage we rely on same dictionary no matter what provider is used (dev serves as default for all)
Also provider may introduce their variable source as e.g. azure:region. So we do not block anything here. We're putting it on aws to actually not collide with how region is handled in case of other providers.
be47d61 to
22a47ca
Compare
sls:region and aws:accountId variablesaws:region and aws:accountId variables
medikoo
left a comment
There was a problem hiding this comment.
Looks great. I've just spotted one typo in error message
22a47ca to
ead9316
Compare
|
Awesome, this is great! 🙌 |
|
is this usable in 2.55.0? couldn't find docs on it, but i have the following: and it gives this error: |
|
@corydorning it should work without issues. In your case it appears that new variable resolver couldn't resolve the configuration, logged the reasoning and variables got resolved by old resolver which doesn't support this source. Have you inspected why new resolver aborted ? What was the reason printed? |
|
Here's the full output: |
|
@corydorning please read presented warning, it contains the answer |
|
I did. Just doesn’t make sense to me.
…Sent from my iPhone
On Aug 24, 2021, at 10:18 AM, Mariusz Nowak ***@***.***> wrote:
@corydorning please read presented warning, it contains the answer
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
|
@corydorning I don't know your configuration so I cannot say precisely for what If you feel that message is not understood in its form, we're open for suggestions on how to improve it |
Closes: #9005