@aws-cdk_aws-s3objectlambda-alpha.AccessPoint

class AccessPoint (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.S3ObjectLambda.Alpha.AccessPoint
Gogithub.com/aws/aws-cdk-go/awscdks3objectlambdaalpha/v2#AccessPoint
Javasoftware.amazon.awscdk.services.s3objectlambda.alpha.AccessPoint
Pythonaws_cdk.aws_s3objectlambda_alpha.AccessPoint
TypeScript (source)@aws-cdk/aws-s3objectlambda-alpha ยป AccessPoint

Implements IConstruct, IDependable, IResource, IAccessPoint

An S3 object lambda access point for intercepting and transforming GetObject requests.

Example

import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as s3objectlambda from '@aws-cdk/aws-s3objectlambda-alpha';
import * as cdk from 'aws-cdk-lib';

const stack = new cdk.Stack();
const bucket = new s3.Bucket(stack, 'MyBucket');
const handler = new lambda.Function(stack, 'MyFunction', {
    runtime: lambda.Runtime.NODEJS_14_X,
    handler: 'index.handler',
    code: lambda.Code.fromAsset('lambda.zip'),
});
new s3objectlambda.AccessPoint(stack, 'MyObjectLambda', {
    bucket,
    handler,
    accessPointName: 'my-access-point',
    payload: {
        prop: "value",
    },
});

Initializer

new AccessPoint(scope: Construct, id: string, props: AccessPointProps)

Parameters

  • scope Construct
  • id string
  • props AccessPointProps

Construct Props

NameTypeDescription
bucket๐Ÿ”นIBucketThe bucket to which this access point belongs.
handler๐Ÿ”นIFunctionThe Lambda function used to transform objects.
accessPointName?๐Ÿ”นstringThe name of the S3 object lambda access point.
cloudWatchMetricsEnabled?๐Ÿ”นbooleanWhether CloudWatch metrics are enabled for the access point.
payload?๐Ÿ”น{ [string]: any }Additional JSON that provides supplemental data passed to the Lambda function on every request.
supportsGetObjectPartNumber?๐Ÿ”นbooleanWhether the Lambda function can process GetObject-PartNumber requests.
supportsGetObjectRange?๐Ÿ”นbooleanWhether the Lambda function can process GetObject-Range requests.

bucket๐Ÿ”น

Type: IBucket

The bucket to which this access point belongs.


handler๐Ÿ”น

Type: IFunction

The Lambda function used to transform objects.


accessPointName?๐Ÿ”น

Type: string (optional, default: a unique name will be generated)

The name of the S3 object lambda access point.


cloudWatchMetricsEnabled?๐Ÿ”น

Type: boolean (optional, default: false)

Whether CloudWatch metrics are enabled for the access point.


payload?๐Ÿ”น

Type: { [string]: any } (optional, default: No data.)

Additional JSON that provides supplemental data passed to the Lambda function on every request.


supportsGetObjectPartNumber?๐Ÿ”น

Type: boolean (optional, default: false)

Whether the Lambda function can process GetObject-PartNumber requests.


supportsGetObjectRange?๐Ÿ”น

Type: boolean (optional, default: false)

Whether the Lambda function can process GetObject-Range requests.

Properties

NameTypeDescription
accessPointArn๐Ÿ”นstringThe ARN of the access point.
accessPointCreationDate๐Ÿ”นstringThe creation data of the access point.
accessPointName๐Ÿ”นstringThe ARN of the access point.
domainName๐Ÿ”นstringImplement the IAccessPoint.domainName field.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
regionalDomainName๐Ÿ”นstringImplement the IAccessPoint.regionalDomainName field.
stack๐Ÿ”นStackThe stack in which this resource is defined.

accessPointArn๐Ÿ”น

Type: string

The ARN of the access point.


accessPointCreationDate๐Ÿ”น

Type: string

The creation data of the access point.


accessPointName๐Ÿ”น

Type: string

The ARN of the access point.


domainName๐Ÿ”น

Type: string

Implement the IAccessPoint.domainName field.


env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


regionalDomainName๐Ÿ”น

Type: string

Implement the IAccessPoint.regionalDomainName field.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
virtualHostedUrlForObject(key?, options?)๐Ÿ”นImplement the IAccessPoint.virtualHostedUrlForObject method.
static fromAccessPointAttributes(scope, id, attrs)๐Ÿ”นReference an existing AccessPoint defined outside of the CDK code.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


virtualHostedUrlForObject(key?, options?)๐Ÿ”น

public virtualHostedUrlForObject(key?: string, options?: VirtualHostedStyleUrlOptions): string

Parameters

  • key string
  • options VirtualHostedStyleUrlOptions

Returns

  • string

Implement the IAccessPoint.virtualHostedUrlForObject method.


static fromAccessPointAttributes(scope, id, attrs)๐Ÿ”น

public static fromAccessPointAttributes(scope: Construct, id: string, attrs: AccessPointAttributes): IAccessPoint

Parameters

  • scope Construct
  • id string
  • attrs AccessPointAttributes

Returns

  • IAccessPoint

Reference an existing AccessPoint defined outside of the CDK code.