Skip to content

Latest commit

 

History

History
269 lines (162 loc) · 9.38 KB

File metadata and controls

269 lines (162 loc) · 9.38 KB

API Reference

Constructs

S3UploadPresignedUrlApi

Initializers

import { S3UploadPresignedUrlApi } from 'cdk-s3-upload-presignedurl-api'

new S3UploadPresignedUrlApi(scope: Construct, id: string, props?: IS3UploadSignedUrlApiProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props IS3UploadSignedUrlApiProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { S3UploadPresignedUrlApi } from 'cdk-s3-upload-presignedurl-api'

S3UploadPresignedUrlApi.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
bucket aws-cdk-lib.aws_s3.Bucket No description.
restApi aws-cdk-lib.aws_apigateway.RestApi No description.
userPool any No description.
userPoolClient any No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


bucketRequired
public readonly bucket: Bucket;
  • Type: aws-cdk-lib.aws_s3.Bucket

restApiRequired
public readonly restApi: RestApi;
  • Type: aws-cdk-lib.aws_apigateway.RestApi

userPoolOptional
public readonly userPool: any;
  • Type: any

userPoolClientOptional
public readonly userPoolClient: any;
  • Type: any

Protocols

IS3UploadSignedUrlApiProps

Properties

Name Type Description
allowedOrigins string[] Optional CORS allowedOrigins.
apiGatewayProps any Optional user provided props to override the default props for the API Gateway.
existingBucketObj aws-cdk-lib.aws_s3.Bucket Optional bucket where files should be uploaded to.
existingUserPoolObj aws-cdk-lib.aws_cognito.UserPool Optional Cognito User Pool to secure the API.
expiration number Optional expiration time in second.
logRetention aws-cdk-lib.aws_logs.RetentionDays Optional log retention time for Lambda and API Gateway.
secured boolean Optional boolean to specify if the API is secured (with Cognito) or publicly open.

allowedOriginsOptional
public readonly allowedOrigins: string[];
  • Type: string[]
  • Default: ['*']

Optional CORS allowedOrigins.

Should allow your domain(s) as allowed origin to request the API


apiGatewayPropsOptional
public readonly apiGatewayProps: any;
  • Type: any
  • Default: Default props are used

Optional user provided props to override the default props for the API Gateway.


existingBucketObjOptional
public readonly existingBucketObj: Bucket;
  • Type: aws-cdk-lib.aws_s3.Bucket
  • Default: Default Bucket is created

Optional bucket where files should be uploaded to.

Should contains the CORS properties


existingUserPoolObjOptional
public readonly existingUserPoolObj: UserPool;
  • Type: aws-cdk-lib.aws_cognito.UserPool
  • Default: Default User Pool (and User Pool Client) are created

Optional Cognito User Pool to secure the API.

You should have created a User Pool Client too.


expirationOptional
public readonly expiration: number;
  • Type: number
  • Default: 300

Optional expiration time in second.

Time before the presigned url expires.


logRetentionOptional
public readonly logRetention: RetentionDays;
  • Type: aws-cdk-lib.aws_logs.RetentionDays
  • Default: one week

Optional log retention time for Lambda and API Gateway.


securedOptional
public readonly secured: boolean;
  • Type: boolean
  • Default: true

Optional boolean to specify if the API is secured (with Cognito) or publicly open.