Class S3

A wrapper for AWS Simple Storage Service.

Constructors

Properties

DEFAULT_DOWNLOAD_BUCKET: string = 'idea-downloads'
DEFAULT_DOWNLOAD_BUCKET_PREFIX: string = 'common'
DEFAULT_DOWNLOAD_BUCKET_SEC_TO_EXP: number = 180
DEFAULT_UPLOAD_BUCKET_SEC_TO_EXP: number = 300
client: S3Client
logger: LambdaLogger = ...

Methods

  • Make a copy of an object of the bucket.

    Parameters

    Returns Promise<void>

  • Create a download link of a piece of data (through S3). Practically, it uploads the file on an S3 bucket, generating and returning a url to it.

    Parameters

    Returns Promise<SignedURL>

  • Delete an object from an S3 bucket.

    Parameters

    Returns Promise<PutObjectOutput>

  • Check whether an object exists in an S3 bucket.

    Parameters

    Returns Promise<boolean>

  • Get an object from a S3 bucket.

    Parameters

    Returns Promise<GetObjectCommandOutput>

  • Get an object from a S3 bucket and parse the content as a JSON object.

    Parameters

    Returns Promise<any>

  • Get an object from a S3 bucket and convert the content to string.

    Parameters

    Returns Promise<string>

  • List the objects of an S3 bucket.

    Parameters

    Returns Promise<ListObjectsOutput>

  • List the objects keys of an S3 bucket.

    Parameters

    Returns Promise<string[]>

  • Put an object in a S3 bucket.

    Parameters

    Returns Promise<PutObjectOutput>

  • Get a signed URL to get a file on a S3 bucket.

    Parameters

    Returns Promise<SignedURL>

  • Get a signed URL to put a file on a S3 bucket.

    Parameters

    Returns Promise<SignedURL>