Skip to main content

AwsS3StorageServiceModuleSchema

AwsS3StorageServiceModuleSchema is the input schema for the AwsS3StorageServiceModule module: a private bucket, the key prefixes servers are granted, its CORS and expiry rules, and any local files uploaded into it.

@group

Modules/Service/AwsS3StorageService

@see

AwsS3StorageServiceModule to learn more about the AwsS3StorageServiceModule module.

Index

Properties

optionalaccessPrefixes

accessPrefixes?: string[] = []

Key prefixes within the bucket, e.g. uploads, that a server can be granted access to through AwsServerModule's s3. A prefix creates nothing in the bucket; it only names what may be granted.

optionalblockPublicAccess

blockPublicAccess?: boolean = true

Whether AWS refuses every public ACL and public policy on the bucket. Leave it on unless something outside octo must make objects public; AwsCloudFrontServiceModule serves the bucket with it on.

bucketName

bucketName: string

The bucket's name, unique across every AWS account: 3 to 63 lowercase letters, digits, dots and hyphens. A name anyone already holds is refused.

optionalcorsRules

corsRules?: S3StorageCorsRuleSchema[] = []

Rules letting a page on another origin call the bucket from a browser, such as one uploading through a presigned URL, or reading a range of an object, which sends Range. Without rules, a browser refuses every cross-origin response from the bucket.

Changing the rules updates the bucket in place.

optionaldirectoryPath

directoryPath?: string | null = null

A local directory whose files are uploaded into the bucket, relative to the project root. The uploaded files are kept in step with it: a new or changed file is uploaded, and a removed one is deleted from the bucket. Left out, octo uploads nothing.

optionalfilter

filter?: (filePath: string) => boolean | null = null

A function choosing which files under the directory are uploaded: given a file's path, it returns true to upload it, e.g. to leave out .DS_Store. Only TypeScript can pass a function; octo.yaml cannot.

optionallifecycleRules

lifecycleRules?: S3StorageLifecycleRuleSchema[] = []

Rules expiring the bucket's objects some days after each was written. A rule matches the objects under its prefix that carry every one of its tags, or the whole bucket with neither. Without rules, the bucket keeps every object until it is deleted.

Changing the rules updates the bucket in place.

region

region: Region

The region the bucket is created in, as produced by any of the AWS region modules.

optionalsubDirectoryOrFilePath

subDirectoryOrFilePath?: string | null = null

One directory or file within directoryPath to upload instead of all of it. Its path is kept in its key: subdirectory/file.html uploads only that file, under the key subdirectory/file.html.

optionaltransform

transform?: (filePath: string) => string | null = null

A function giving each uploaded file its key in the bucket: given the file's path, it returns the key, e.g. to drop an .html extension. Only TypeScript can pass a function; octo.yaml cannot.