Skip to content

Access EFS storage from within container #360

@WinstonN

Description

@WinstonN

Hello

With EFS available in Lambda I want to use this storage

I have setup EFS, and inside the lambda I can see it. To do this I just import the OS module, and print a listdir

# Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module with handler used in the lambda function."""

import faassupervisor.supervisor as supervisor
import os

def lambda_handler(event, context):
    print(os.listdir('/mnt/'))
    """Launches the supervisor and returns its output."""
    return supervisor.main(event=event, context=context)

Inside the logs I can see my "efs" storage

2020-07-14T12:03:05.757+12:00 | ['efs']

But when I send the command df -h as documented here: https://scar.readthedocs.io/en/latest/advanced_usage.html#executing-custom-commands-and-arguments

I don't see this storage, or inside /mnt

❯❯❯ python3 scar/scarcli.py run -n cypress-lambda-ubuntu df -h
Request Id: 4a5e162d-e817-4e83-a584-e812a0030a67
Log Group Name: /aws/lambda/cypress-lambda-ubuntu
Log Stream Name: 2020/07/14/[$LATEST]9918805ef7cf4ce899e4330f2fae57ba
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       526M  509M  5.9M  99% /
/dev/vdb        1.5G   20M  1.4G   2% /dev

❯❯❯ python3 scar/scarcli.py run -n cypress-lambda-ubuntu ls -la /mnt/
Request Id: bbb75834-b518-483c-b71d-de6c75eeb5c4
Log Group Name: /aws/lambda/cypress-lambda-ubuntu
Log Stream Name: 2020/07/14/[$LATEST]9538f62f4a96409caa915faeaac26f84
total 8
drwxr-xr-x  2 sbx_user1051 sbx_user1051 4096 May 26 13:40 .
drwxrwxr-x 21 sbx_user1051 sbx_user1051 4096 Jul 14 00:15 ..

Can you point me in the right direction please?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions