Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

amazon web services - Problem trying to use env variables in my severless.yml

I have a problem trying to use env variables in my severless.yml

I have an env.yml with the env var called BUCKET_UPLOADS which sits under dev

In the serveless.yml I am trying to use this variable like so:

"arn:aws:s3:::${process.env.BUCKET_UPLOADS}/*"

But when trying to deploy I get:

Bucket name should not contain uppercase characters.

There are no capitols in the variable value so I think it's taking the above literally but as far as I can see it should be using the variable instead given the markup ${...}

Any help would be greatly appreciated! Thanks

question from:https://stackoverflow.com/questions/66064212/problem-trying-to-use-env-variables-in-my-severless-yml

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The following rules apply for naming S3 buckets.

  • Bucket names must be between 3 and 63 characters long.
  • Bucket names can consist only of lowercase letters, numbers, dots (.), and hyphens (-).

S3_HTML_TEMPLATES: ${self:service}-html-templates-s7adnjfnabbfvai7 S3_LANGUAGE_TEMPLATES: ${self:service}-language-templates-12747dhadgdva S3_STATIC_WEBSITE: '${self:service}-static-website-asjdu29ehq1i2'

  • Bucket names must begin and end with a letter or number.
  • Bucket names must not be formatted as an IP address (for example, 192.168.5.4).
  • Bucket names can't begin with xn-- (for buckets created after February 2020).
  • Bucket names must be unique within a partition. A partition is a grouping of Regions. AWS currently has three partitions: aws (Standard Regions), aws-cn (China Regions), and aws-us-gov (AWS GovCloud [US] Regions).
  • Buckets used with Amazon S3 Transfer Acceleration can't have dots (.) in their names. For more information about transfer acceleration, see Amazon S3 Transfer Acceleration.

You can follow this doc to make it done. Thank's


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...