@fly/cdn
Version:
Fly's TypeScript CDN
34 lines (33 loc) • 857 B
TypeScript
/**
* @module Backends
*/
import { Credentials } from '../aws';
import { ProxyFunction } from 'src/proxy';
/**
* AWS S3 bucket options
*/
export interface AwsS3Options {
bucket: string;
region?: string;
credentials?: Credentials;
}
/**
* Creates a fetch-like proxy function for making requests to AWS S3.
*
* Example:
*
* ```typescript
* import { awsS3 } from "./src/backends";
* const backend = awsS3({
* bucket: "flyio-test-website",
* // region: "us-east-1"
* // credentials: { // for private S3 buckets
* // accessKeyId: app.config.aws_access_key_id,
* // secretAccessKey: app.config.aws_secret_access_key, // store this as a secret
* // }
* });
* ```
* @param options AWS S3 bucket to proxy to
* @module Backends
*/
export declare function awsS3(options: AwsS3Options | string): ProxyFunction<AwsS3Options>;