AccessPoint

class aws_cdk.aws_s3objectlambda.AccessPoint(scope, id, *, bucket, handler, access_point_name=None, cloud_watch_metrics_enabled=None, payload=None, supports_get_object_part_number=None, supports_get_object_range=None)

Bases: Resource

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

Stability

experimental

ExampleMetadata

infused

Example:

import aws_cdk.aws_lambda as lambda_
import aws_cdk.aws_s3 as s3
import aws_cdk.aws_s3objectlambda as s3objectlambda
import aws_cdk.core as cdk

stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_14_X,
    handler="index.handler",
    code=lambda_.Code.from_asset("lambda.zip")
)
s3objectlambda.AccessPoint(stack, "MyObjectLambda",
    bucket=bucket,
    handler=handler,
    access_point_name="my-access-point",
    payload={
        "prop": "value"
    }
)
Parameters
  • scope (Construct) –

  • id (str) –

  • bucket (IBucket) – (experimental) The bucket to which this access point belongs.

  • handler (IFunction) – (experimental) The Lambda function used to transform objects.

  • access_point_name (Optional[str]) – (experimental) The name of the S3 object lambda access point. Default: a unique name will be generated

  • cloud_watch_metrics_enabled (Optional[bool]) – (experimental) Whether CloudWatch metrics are enabled for the access point. Default: false

  • payload (Optional[Mapping[str, Any]]) – (experimental) Additional JSON that provides supplemental data passed to the Lambda function on every request. Default: - No data.

  • supports_get_object_part_number (Optional[bool]) – (experimental) Whether the Lambda function can process GetObject-PartNumber requests. Default: false

  • supports_get_object_range (Optional[bool]) – (experimental) Whether the Lambda function can process GetObject-Range requests. Default: false

Stability

experimental

Methods

apply_removal_policy(policy)

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).

Parameters

policy (RemovalPolicy) –

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

virtual_hosted_url_for_object(key=None, *, regional=None)

(experimental) Implement the {@link IAccessPoint.virtualHostedUrlForObject} method.

Parameters
  • key (Optional[str]) –

  • regional (Optional[bool]) – Specifies the URL includes the region. Default: - true

Stability

experimental

Return type

str

Attributes

access_point_arn

(experimental) The ARN of the access point.

Stability

experimental

Attribute

true

Return type

str

access_point_creation_date

(experimental) The creation data of the access point.

Stability

experimental

Attribute

true

Return type

str

access_point_name

(experimental) The ARN of the access point.

Stability

experimental

Return type

str

domain_name

(experimental) Implement the {@link IAccessPoint.domainName} field.

Stability

experimental

Return type

str

env

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.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

regional_domain_name

(experimental) Implement the {@link IAccessPoint.regionalDomainName} field.

Stability

experimental

Return type

str

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_access_point_attributes(scope, id, *, access_point_arn, access_point_creation_date)

(experimental) Reference an existing AccessPoint defined outside of the CDK code.

Parameters
  • scope (Construct) –

  • id (str) –

  • access_point_arn (str) – (experimental) The ARN of the access point.

  • access_point_creation_date (str) – (experimental) The creation data of the access point.

Stability

experimental

Return type

IAccessPoint

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters

construct (IConstruct) –

Return type

bool