Efs
Reference doc for the `sst.aws.Efs` component.
The Efs
component lets you add Amazon Elastic File System (EFS) to your app.
Create the file system
This needs a VPC.
Attach it to a Lambda function
This is now mounted at /mnt/efs
in the Lambda function.
Attach it to a container
Mounted at /mnt/efs
in the container.
Cost
By default this component uses Regional (Multi-AZ) with Elastic Throughput. The pricing is pay-per-use.
- For storage: $0.30 per GB per month
- For reads: $0.03 per GB per month
- For writes: $0.06 per GB per month
The above are rough estimates for us-east-1, check out the EFS pricing for more details.
Constructor
Parameters
-
name
string
-
args
EfsArgs
-
opts?
ComponentResourceOptions
EfsArgs
performance?
Type Input
<
“
general-purpose
”
|
“
max-io
”
>
Default “general-purpose”
The performance mode for the EFS file system.
The max-io
mode can support higher throughput, but with slightly higher latency. It’s
recommended for larger workloads like data analysis or meadia processing.
Both the modes are priced the same, but general-purpose
is recommended for most use cases.
throughput?
Type Input
<
“
provisioned
”
|
“
bursting
”
|
“
elastic
”
>
Default “elastic”
The throughput mode for the EFS file system.
The default elastic
mode scales up or down based on the workload. However, if you know
your access patterns, you can use provisioned
to have a fixed throughput.
Or you can use bursting
to scale with the amount of storage you’re using. It also
supports bursting to higher levels for up to 12 hours per day.
transform?
Type Object
Transform how this component creates its underlying resources.
transform.accessPoint?
Type AccessPointArgs
|
(
args
:
AccessPointArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the EFS access point.
transform.fileSystem?
Type FileSystemArgs
|
(
args
:
FileSystemArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the EFS file system.
vpc
Type Input
<
Vpc
|
Object
>
The VPC to use for the EFS file system.
Create a VPC component.
And pass it in.
Or pass in a custom VPC configuration.
vpc.subnets
Type Input
<
Input
<
string
>
[]
>
A list of subnet IDs in the VPC to create the EFS mount targets in.
Properties
accessPoint
Type Output
<
string
>
The ID of the EFS access point.
id
Type Output
<
string
>
The ID of the EFS file system.
nodes
Type Object
The underlying resources this component creates.
nodes.accessPoint
Type Output
<
AccessPoint
>
The Amazon EFS access point.
nodes.fileSystem
Type Output
<
FileSystem
>
The Amazon EFS file system.
Methods
static get
Parameters
The name of the component.name
string
The ID of the existing EFS file system.fileSystemID
Input
<
string
>
-
opts?
ComponentResourceOptions
Returns Efs
Reference an existing EFS file system with the given file system ID. This is useful when you create a EFS file system in one stage and want to share it in another. It avoids having to create a new EFS file system in the other stage.
Imagine you create a EFS file system in the dev
stage. And in your personal stage
frank
, instead of creating a new file system, you want to share the same file system
from dev
.
Here app-dev-myefs
is the ID of the file system created in the dev
stage.
You can find this by outputting the file system ID in the dev
stage.