mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
30 lines
880 B
Markdown
30 lines
880 B
Markdown
<!--
|
|
title: Serverless Framework - Variables - S3 Objects
|
|
menuText: AWS S3 Objects
|
|
menuOrder: 10
|
|
description: How to reference AWS S3 Objects
|
|
layout: Doc
|
|
-->
|
|
|
|
<!-- DOCS-SITE-LINK:START automatically generated -->
|
|
|
|
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/guides/variables/s3)
|
|
|
|
<!-- DOCS-SITE-LINK:END -->
|
|
|
|
# Reference AWS S3 Objects
|
|
|
|
You can reference S3 values as the source of your variables to use in your service with the `s3:bucketName/key` syntax. For example:
|
|
|
|
```yml
|
|
service: new-service
|
|
provider: aws
|
|
functions:
|
|
hello:
|
|
name: ${s3:myBucket/myKey}-hello
|
|
handler: handler.hello
|
|
```
|
|
|
|
In the above example, the value for `myKey` in the `myBucket` S3 bucket will be looked up and used to populate the variable.
|
|
Buckets from all regions can be used without any additional specification due to AWS S3 global strategy.
|