-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
DeploymentBucket parameters not being replaced #8951
Comments
Hello @mcshiz 👋 Thanks a lot for reporting and sorry to hear that you've run into trouble with it. At the moment, we're not supporting |
I spun my wheels quite a bit today on the same issue. When I restore the deprecated |
Hello @jwthomp - did you have issue with |
Mine was trying to use !Sub in the custom parameters for serverless-plugin-datadog plugin. Specifically: I wound up having to re-enable serverless-pseudo-parameters to get #{AWS::AccountId} to work. |
Hello @jwthomp - thanks for the explanation, the built-in notation for pseudo-params is a bit different: https://www.serverless.com/framework/docs/providers/aws/guide/variables/#pseudo-parameters-reference did you try that one as well? Additionally, what error did you experience? Did it come from the plugin directly? |
I experience a similar issue when I try to set the
Serverless then simply ignores this setting and tries to create its own |
Hello @HaaLeo, what version of Framework are you using? |
v2.34.0 Updated my previous comment |
Thank you @HaaLeo - I've just tried to reproduce your issue but I'm observing correct behavior on my side. Could you provide a reproducible example with minimal |
My setup is the following
The deployment was failing. Therefore, I only checked those logs 🤦🏼♂️. However, taking a closer look at the packaging step it indeed warns me about the missing parameter:
So my mistake was to set the environment variable during the deploy step but not for the packaging step where it is actually needed. Changing this fixed my issue. Sorry @pgrzesik for over eagerly commenting on this issue. |
No worries @HaaLeo, happy to hear you've been able to resolve your issue 👍 |
I'm having the same issue. Trying to use the AWS account id in the deployment bucket name so that the bucket is unique across accounts. Is there any way to achieve this? @pgrzesik you mentioned "you'll need to supply AccountID in some other way", can you suggest any other way to do it? |
@mahendraramesh you can for example pass it via env variable and use that variable during resolution |
I have the same issue:
Then I Got: Could not locate deployment bucket. Error: The specified bucket is not valid. NB: Everything was fine until I update serverless version |
Hey @lludovic - what version of the Framework were you using previously? |
|
Thanks for sharing, could you also share to which value is |
The previous resolved value was dev-artifacts-storage the now it's ${cf:dev-artifacts.ArtifactBucketName} |
Thanks for sharing all that additional information - it looks like it's specific to the use case where variable is defined as a part of ENV VAR - during dotenv resolution, it tries to expand the value but fails to do so which alters the original value. Expansion change has been introduced recently as a part of this PR #9615 I believe the only way to support this would be to either make the variable expansion via |
I'm going to close this ticket as original issue has been clarified and there's a way to achieve that now with |
I've noticed that when I try and do parameter replacement for the
provider.deploymentBucket
orprovider.deploymentBucket.name
property I am getting errors.I receive these error with and without the serverless-psuedo-parameters plugin.
Configuration: (Same error when nesting
name
or omitting it or usingFn::Sub
)Result:
Configuration warning at 'provider.deploymentBucket.name': should be string
Configuration:
Result:
Configuration warning at 'provider.deploymentBucket': should match pattern "(?!^(\d{1,3}\.){3}\d{1,3}$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)"
Configuration Where
${self:custom.accountId}
=${AWS::AccountId}
Result
This is what wound up in the
.serverless/serverless-state.json
file which looks like it should work BUT I get a fatal error from serverlessCould not locate deployment bucket. Error: str.indexOf is not a function
However this works, so I believe the issue lies in the recent integration of serverless pseudo parameters.
Framework Core: 2.23.0 (local)
Plugin: 4.4.2
SDK: 2.3.2
Components: 3.6.2
Command used to run
sls deploy --stage development --region us-east-1 --aws-profile me
The text was updated successfully, but these errors were encountered: