Skip to content

Latest commit

 

History

History
3092 lines (1762 loc) · 57.3 KB

File metadata and controls

3092 lines (1762 loc) · 57.3 KB

README

@cloudcomponents/cdk-s3-antivirus

@cloudcomponents/cdk-s3-antivirus

Table of contents

Classes

Interfaces

Clamav Layer

@cloudcomponents/cdk-s3-antivirus / ClamavLayer

Class: ClamavLayer

Clamav Lambda layer.

Hierarchy

  • LayerVersion

    ClamavLayer

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ClamavLayer(scope, id)

Parameters

Name Type
scope Construct
id string

Overrides

lambda.LayerVersion.constructor

Properties

compatibleRuntimes

Optional Readonly compatibleRuntimes: Runtime[]

The runtimes compatible with this Layer.

stability stable

Inherited from

lambda.LayerVersion.compatibleRuntimes


env

Readonly env: 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.

stability stable

Inherited from

lambda.LayerVersion.env


layerVersionArn

Readonly layerVersionArn: string

The ARN of the Lambda Layer version that this Layer defines.

stability stable

Inherited from

lambda.LayerVersion.layerVersionArn


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

lambda.LayerVersion.node


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

lambda.LayerVersion.physicalName


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

lambda.LayerVersion.stack

Methods

_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

lambda.LayerVersion._enableCrossEnvironment


addPermission

addPermission(id, permission): void

Add permission for this layer version to specific entities.

Usage within the same account where the layer is defined is always allowed and does not require calling this method. Note that the principal that creates the Lambda function using the layer (for example, a CloudFormation changeset execution role) also needs to have the lambda:GetLayerVersion permission on the layer version.

stability stable

Parameters

Name Type
id string
permission LayerVersionPermission

Returns

void

Inherited from

lambda.LayerVersion.addPermission


applyRemovalPolicy

applyRemovalPolicy(policy): void

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

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

lambda.LayerVersion.applyRemovalPolicy


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

lambda.LayerVersion.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

lambda.LayerVersion.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

lambda.LayerVersion.getResourceNameAttribute


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

lambda.LayerVersion.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

lambda.LayerVersion.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

lambda.LayerVersion.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

lambda.LayerVersion.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

lambda.LayerVersion.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

lambda.LayerVersion.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

lambda.LayerVersion.validate


fromLayerVersionArn

Static fromLayerVersionArn(scope, id, layerVersionArn): ILayerVersion

Imports a layer version by ARN.

Assumes it is compatible with all Lambda runtimes.

stability stable

Parameters

Name Type
scope Construct
id string
layerVersionArn string

Returns

ILayerVersion

Inherited from

lambda.LayerVersion.fromLayerVersionArn


fromLayerVersionAttributes

Static fromLayerVersionAttributes(scope, id, attrs): ILayerVersion

Imports a Layer that has been defined externally.

stability stable

Parameters

Name Type Description
scope Construct the parent Construct that will use the imported layer.
id string the id of the imported layer in the construct tree.
attrs LayerVersionAttributes the properties of the imported layer.

Returns

ILayerVersion

Inherited from

lambda.LayerVersion.fromLayerVersionAttributes


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

lambda.LayerVersion.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

lambda.LayerVersion.isResource

Definition Bucket

@cloudcomponents/cdk-s3-antivirus / DefinitionBucket

Class: DefinitionBucket

Hierarchy

  • Bucket

    DefinitionBucket

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DefinitionBucket(scope, id, props)

Parameters

Name Type
scope Construct
id string
props DefinitionBucketProps

Overrides

Bucket.constructor

Properties

autoCreatePolicy

Protected autoCreatePolicy: boolean

Indicates if a bucket resource policy should automatically created upon the first call to addToResourcePolicy.

stability stable

Inherited from

Bucket.autoCreatePolicy


bucketArn

Readonly bucketArn: string

The ARN of the bucket.

stability stable

Inherited from

Bucket.bucketArn


bucketDomainName

Readonly bucketDomainName: string

The IPv4 DNS name of the specified bucket.

stability stable

Inherited from

Bucket.bucketDomainName


bucketDualStackDomainName

Readonly bucketDualStackDomainName: string

The IPv6 DNS name of the specified bucket.

stability stable

Inherited from

Bucket.bucketDualStackDomainName


bucketName

Readonly bucketName: string

The name of the bucket.

stability stable

Inherited from

Bucket.bucketName


bucketRegionalDomainName

Readonly bucketRegionalDomainName: string

The regional domain name of the specified bucket.

stability stable

Inherited from

Bucket.bucketRegionalDomainName


bucketWebsiteDomainName

Readonly bucketWebsiteDomainName: string

The Domain name of the static website.

stability stable

Inherited from

Bucket.bucketWebsiteDomainName


bucketWebsiteUrl

Readonly bucketWebsiteUrl: string

The URL of the static website.

stability stable

Inherited from

Bucket.bucketWebsiteUrl


disallowPublicAccess

Protected Optional disallowPublicAccess: boolean

Whether to disallow public access.

stability stable

Inherited from

Bucket.disallowPublicAccess


encryptionKey

Optional Readonly encryptionKey: IKey

Optional KMS encryption key associated with this bucket.

stability stable

Inherited from

Bucket.encryptionKey


env

Readonly env: 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.

stability stable

Inherited from

Bucket.env


isWebsite

Optional Readonly isWebsite: boolean

If this bucket has been configured for static website hosting.

stability stable

Inherited from

Bucket.isWebsite


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Bucket.node


physicalName

Protected Readonly physicalName: string

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

stability stable

Inherited from

Bucket.physicalName


policy

Optional policy: BucketPolicy

The resource policy associated with this bucket.

If autoCreatePolicy is true, a BucketPolicy will be created upon the first call to addToResourcePolicy(s).

stability stable

Inherited from

Bucket.policy


stack

Readonly stack: Stack

The stack in which this resource is defined.

stability stable

Inherited from

Bucket.stack

Accessors

putActions

Private get putActions(): any

Returns

any

Inherited from

Bucket.putActions


writeActions

Private get writeActions(): any

Returns

any

Inherited from

Bucket.writeActions

Methods

_enableCrossEnvironment

_enableCrossEnvironment(): void

Called when this resource is referenced across environments (account/region) to order to request that a physical name will be generated for this resource during synthesis, so the resource can be referenced through it's absolute name/arn.

internal

Returns

void

Inherited from

Bucket._enableCrossEnvironment


addCorsRule

addCorsRule(rule): void

Adds a cross-origin access configuration for objects in an Amazon S3 bucket.

stability stable

Parameters

Name Type Description
rule CorsRule The CORS configuration rule to add.

Returns

void

Inherited from

Bucket.addCorsRule


addEventNotification

addEventNotification(event, dest, ...filters): void

Adds a bucket notification event destination.

see https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html

stability stable

example

declare const myLambda: lambda.Function; const bucket = new s3.Bucket(this, 'MyBucket'); bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), {prefix: 'home/myusername/*'});

Parameters

Name Type Description
event EventType The event to trigger the notification.
dest IBucketNotificationDestination The notification destination (Lambda, SNS Topic or SQS Queue).
...filters NotificationKeyFilter[] S3 object key filter rules to determine which objects trigger this event.

Returns

void

Inherited from

Bucket.addEventNotification


addInventory

addInventory(inventory): void

Add an inventory configuration.

stability stable

Parameters

Name Type Description
inventory Inventory configuration to add.

Returns

void

Inherited from

Bucket.addInventory


addLifecycleRule

addLifecycleRule(rule): void

Add a lifecycle rule to the bucket.

stability stable

Parameters

Name Type Description
rule LifecycleRule The rule to add.

Returns

void

Inherited from

Bucket.addLifecycleRule


addMetric

addMetric(metric): void

Adds a metrics configuration for the CloudWatch request metrics from the bucket.

stability stable

Parameters

Name Type Description
metric BucketMetrics The metric configuration to add.

Returns

void

Inherited from

Bucket.addMetric


addObjectCreatedNotification

addObjectCreatedNotification(dest, ...filters): void

Subscribes a destination to receive notifications when an object is created in the bucket.

This is identical to calling onEvent(EventType.OBJECT_CREATED).

stability stable

Parameters

Name Type Description
dest IBucketNotificationDestination The notification destination (see onEvent).
...filters NotificationKeyFilter[] Filters (see onEvent).

Returns

void

Inherited from

Bucket.addObjectCreatedNotification


addObjectRemovedNotification

addObjectRemovedNotification(dest, ...filters): void

Subscribes a destination to receive notifications when an object is removed from the bucket.

This is identical to calling onEvent(EventType.OBJECT_REMOVED).

stability stable

Parameters

Name Type Description
dest IBucketNotificationDestination The notification destination (see onEvent).
...filters NotificationKeyFilter[] Filters (see onEvent).

Returns

void

Inherited from

Bucket.addObjectRemovedNotification


addToResourcePolicy

addToResourcePolicy(permission): AddToResourcePolicyResult

Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this bucket and/or its contents. Use bucketArn and arnForObjects(keys) to obtain ARNs for this bucket or objects.

Note that the policy statement may or may not be added to the policy. For example, when an IBucket is created from an existing bucket, it's not possible to tell whether the bucket already has a policy attached, let alone to re-use that policy to add more statements to it. So it's safest to do nothing in these cases.

stability stable

Parameters

Name Type Description
permission PolicyStatement the policy statement to be added to the bucket's policy.

Returns

AddToResourcePolicyResult

metadata about the execution of this method. If the policy was not added, the value of statementAdded will be false. You should always check this value to make sure that the operation was actually carried out. Otherwise, synthesis and deploy will terminate silently, which may be confusing.

Inherited from

Bucket.addToResourcePolicy


applyRemovalPolicy

applyRemovalPolicy(policy): void

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

stability stable

Parameters

Name Type
policy RemovalPolicy

Returns

void

Inherited from

Bucket.applyRemovalPolicy


arnForObjects

arnForObjects(keyPattern): string

Returns an ARN that represents all objects within the bucket that match the key pattern specified.

To represent all keys, specify "*".

If you need to specify a keyPattern with multiple components, concatenate them into a single string, e.g.:

arnForObjects(home/${team}/${user}/*)

stability stable

Parameters

Name Type
keyPattern string

Returns

string

Inherited from

Bucket.arnForObjects


generatePhysicalName

Protected generatePhysicalName(): string

stability stable

Returns

string

Inherited from

Bucket.generatePhysicalName


getResourceArnAttribute

Protected getResourceArnAttribute(arnAttr, arnComponents): string

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

stability stable

Parameters

Name Type Description
arnAttr string The CFN attribute which resolves to the ARN of the resource.
arnComponents ArnComponents The format of the ARN of this resource.

Returns

string

Inherited from

Bucket.getResourceArnAttribute


getResourceNameAttribute

Protected getResourceNameAttribute(nameAttr): string

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

stability stable

Parameters

Name Type Description
nameAttr string The CFN attribute which resolves to the resource's name.

Returns

string

Inherited from

Bucket.getResourceNameAttribute


grantDelete

grantDelete(identity, objectsKeyPattern?): Grant

Grants s3:DeleteObject* permission to an IAM principal for objects in this bucket.

stability stable

Parameters

Name Type Description
identity IGrantable The principal.
objectsKeyPattern? any Restrict the permission to a certain key pattern (default '*').

Returns

Grant

Inherited from

Bucket.grantDelete


grantPublicAccess

grantPublicAccess(keyPrefix?, ...allowedActions): Grant

Allows unrestricted access to objects from this bucket.

IMPORTANT: This permission allows anyone to perform actions on S3 objects in this bucket, which is useful for when you configure your bucket as a website and want everyone to be able to read objects in the bucket without needing to authenticate.

Without arguments, this method will grant read ("s3:GetObject") access to all objects ("*") in the bucket.

The method returns the iam.Grant object, which can then be modified as needed. For example, you can add a condition that will restrict access only to an IPv4 range like this:

 const grant = bucket.grantPublicAccess();
 grant.resourceStatement!.addCondition(‘IpAddress’, { “aws:SourceIp”: “54.240.143.0/24” });

Note that if this IBucket refers to an existing bucket, possibly not managed by CloudFormation, this method will have no effect, since it's impossible to modify the policy of an existing bucket.

stability stable

Parameters

Name Type Description
keyPrefix? string the prefix of S3 object keys (e.g. home/*). Default is "*".
...allowedActions string[] the set of S3 actions to allow.

Returns

Grant

Inherited from

Bucket.grantPublicAccess


grantPut

grantPut(identity, objectsKeyPattern?): Grant

Grants s3:PutObject* and s3:Abort* permissions for this bucket to an IAM principal.

If encryption is used, permission to use the key to encrypt the contents of written files will also be granted to the same principal.

stability stable

Parameters

Name Type Description
identity IGrantable The principal.
objectsKeyPattern? any Restrict the permission to a certain key pattern (default '*').

Returns

Grant

Inherited from

Bucket.grantPut


grantPutAcl

grantPutAcl(identity, objectsKeyPattern?): Grant

Grant the given IAM identity permissions to modify the ACLs of objects in the given Bucket.

If your application has the '@aws-cdk/aws-s3:grantWriteWithoutAcl' feature flag set, calling grantWrite or grantReadWrite no longer grants permissions to modify the ACLs of the objects; in this case, if you need to modify object ACLs, call this method explicitly.

stability stable

Parameters

Name Type
identity IGrantable
objectsKeyPattern? string

Returns

Grant

Inherited from

Bucket.grantPutAcl


grantRead

grantRead(identity, objectsKeyPattern?): Grant

Grant read permissions for this bucket and it's contents to an IAM principal (Role/Group/User).

If encryption is used, permission to use the key to decrypt the contents of the bucket will also be granted to the same principal.

stability stable

Parameters

Name Type Description
identity IGrantable The principal.
objectsKeyPattern? any Restrict the permission to a certain key pattern (default '*').

Returns

Grant

Inherited from

Bucket.grantRead


grantReadWrite

grantReadWrite(identity, objectsKeyPattern?): Grant

Grants read/write permissions for this bucket and it's contents to an IAM principal (Role/Group/User).

If an encryption key is used, permission to use the key for encrypt/decrypt will also be granted.

Before CDK version 1.85.0, this method granted the s3:PutObject* permission that included s3:PutObjectAcl, which could be used to grant read/write object access to IAM principals in other accounts. If you want to get rid of that behavior, update your CDK version to 1.85.0 or later, and make sure the @aws-cdk/aws-s3:grantWriteWithoutAcl feature flag is set to true in the context key of your cdk.json file. If you've already updated, but still need the principal to have permissions to modify the ACLs, use the grantPutAcl method.

stability stable

Parameters

Name Type
identity IGrantable
objectsKeyPattern? any

Returns

Grant

Inherited from

Bucket.grantReadWrite


grantWrite

grantWrite(identity, objectsKeyPattern?): Grant

Grant write permissions to this bucket to an IAM principal.

If encryption is used, permission to use the key to encrypt the contents of written files will also be granted to the same principal.

Before CDK version 1.85.0, this method granted the s3:PutObject* permission that included s3:PutObjectAcl, which could be used to grant read/write object access to IAM principals in other accounts. If you want to get rid of that behavior, update your CDK version to 1.85.0 or later, and make sure the @aws-cdk/aws-s3:grantWriteWithoutAcl feature flag is set to true in the context key of your cdk.json file. If you've already updated, but still need the principal to have permissions to modify the ACLs, use the grantPutAcl method.

stability stable

Parameters

Name Type
identity IGrantable
objectsKeyPattern? any

Returns

Grant

Inherited from

Bucket.grantWrite


onCloudTrailEvent

onCloudTrailEvent(id, options?): Rule

Define a CloudWatch event that triggers when something happens to this repository.

Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

stability stable

Parameters

Name Type Description
id string The id of the rule.
options? OnCloudTrailBucketEventOptions Options for adding the rule.

Returns

Rule

Inherited from

Bucket.onCloudTrailEvent


onCloudTrailPutObject

onCloudTrailPutObject(id, options?): Rule

Defines an AWS CloudWatch event that triggers when an object is uploaded to the specified paths (keys) in this bucket using the PutObject API call.

Note that some tools like aws s3 cp will automatically use either PutObject or the multipart upload API depending on the file size, so using onCloudTrailWriteObject may be preferable.

Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

stability stable

Parameters

Name Type Description
id string The id of the rule.
options? OnCloudTrailBucketEventOptions Options for adding the rule.

Returns

Rule

Inherited from

Bucket.onCloudTrailPutObject


onCloudTrailWriteObject

onCloudTrailWriteObject(id, options?): Rule

Defines an AWS CloudWatch event that triggers when an object at the specified paths (keys) in this bucket are written to.

This includes the events PutObject, CopyObject, and CompleteMultipartUpload.

Note that some tools like aws s3 cp will automatically use either PutObject or the multipart upload API depending on the file size, so using this method may be preferable to onCloudTrailPutObject.

Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

stability stable

Parameters

Name Type Description
id string The id of the rule.
options? OnCloudTrailBucketEventOptions Options for adding the rule.

Returns

Rule

Inherited from

Bucket.onCloudTrailWriteObject


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Bucket.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Bucket.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Bucket.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Bucket.prepare


s3UrlForObject

s3UrlForObject(key?): string

The S3 URL of an S3 object. For example:.

  • s3://onlybucket
  • s3://bucket/key

stability stable

Parameters

Name Type Description
key? string The S3 key of the object.

Returns

string

an ObjectS3Url token

Inherited from

Bucket.s3UrlForObject


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Bucket.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Bucket.toString


transferAccelerationUrlForObject

transferAccelerationUrlForObject(key?, options?): string

The https Transfer Acceleration URL of an S3 object.

Specify dualStack: true at the options for dual-stack endpoint (connect to the bucket over IPv6). For example:

  • https://bucket.s3-accelerate.amazonaws.com
  • https://bucket.s3-accelerate.amazonaws.com/key

stability stable

Parameters

Name Type Description
key? string The S3 key of the object.
options? TransferAccelerationUrlOptions Options for generating URL.

Returns

string

an TransferAccelerationUrl token

Inherited from

Bucket.transferAccelerationUrlForObject


urlForObject

urlForObject(key?): string

The https URL of an S3 object. Specify regional: false at the options for non-regional URLs. For example:.

  • https://s3.us-west-1.amazonaws.com/onlybucket
  • https://s3.us-west-1.amazonaws.com/bucket/key
  • https://s3.cn-north-1.amazonaws.com.cn/china-bucket/mykey

stability stable

Parameters

Name Type Description
key? string The S3 key of the object.

Returns

string

an ObjectS3Url token

Inherited from

Bucket.urlForObject


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

Inherited from

Bucket.validate


virtualHostedUrlForObject

virtualHostedUrlForObject(key?, options?): string

The virtual hosted-style URL of an S3 object. Specify regional: false at the options for non-regional URL. For example:.

  • https://only-bucket.s3.us-west-1.amazonaws.com
  • https://bucket.s3.us-west-1.amazonaws.com/key
  • https://bucket.s3.amazonaws.com/key
  • https://china-bucket.s3.cn-north-1.amazonaws.com.cn/mykey

stability stable

Parameters

Name Type Description
key? string The S3 key of the object.
options? VirtualHostedStyleUrlOptions Options for generating URL.

Returns

string

an ObjectS3Url token

Inherited from

Bucket.virtualHostedUrlForObject


fromBucketArn

Static fromBucketArn(scope, id, bucketArn): IBucket

stability stable

Parameters

Name Type
scope Construct
id string
bucketArn string

Returns

IBucket

Inherited from

Bucket.fromBucketArn


fromBucketAttributes

Static fromBucketAttributes(scope, id, attrs): IBucket

Creates a Bucket construct that represents an external bucket.

stability stable

Parameters

Name Type Description
scope Construct The parent creating construct (usually this).
id string The construct's name.
attrs BucketAttributes A BucketAttributes object.

Returns

IBucket

Inherited from

Bucket.fromBucketAttributes


fromBucketName

Static fromBucketName(scope, id, bucketName): IBucket

stability stable

Parameters

Name Type
scope Construct
id string
bucketName string

Returns

IBucket

Inherited from

Bucket.fromBucketName


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Bucket.isConstruct


isResource

Static isResource(construct): construct is CfnResource

Check whether the given construct is a Resource.

stability stable

Parameters

Name Type
construct IConstruct

Returns

construct is CfnResource

Inherited from

Bucket.isResource


validateBucketName

Static validateBucketName(physicalName): void

Thrown an exception if the given bucket name is not valid.

stability stable

Parameters

Name Type Description
physicalName string name of the bucket.

Returns

void

Inherited from

Bucket.validateBucketName

Definition Initializer

@cloudcomponents/cdk-s3-antivirus / DefinitionInitializer

Class: DefinitionInitializer

Hierarchy

  • Construct

    DefinitionInitializer

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DefinitionInitializer(scope, id, props)

Parameters

Name Type
scope Construct
id string
props DefinitionInitializerProps

Overrides

Construct.constructor

Properties

node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node

Methods

onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Sandbox

@cloudcomponents/cdk-s3-antivirus / Sandbox

Class: Sandbox

Hierarchy

  • Construct

    Sandbox

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Sandbox(scope, id, props?)

Parameters

Name Type
scope Construct
id string
props SandboxProps

Overrides

Construct.constructor

Properties

definitionBucket

Readonly definitionBucket: DefinitionBucket


lambdaAccessPoint

Readonly lambdaAccessPoint: IAccessPoint


node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node


s3Endpoint

Readonly s3Endpoint: GatewayVpcEndpoint


vpc

Readonly vpc: IVpc

Methods

addToS3EnpointPolicy

addToS3EnpointPolicy(statement): void

Parameters

Name Type
statement PolicyStatement

Returns

void


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Scanner

@cloudcomponents/cdk-s3-antivirus / Scanner

Class: Scanner

Hierarchy

  • Construct

    Scanner

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Scanner(scope, id, props?)

Parameters

Name Type
scope Construct
id string
props ScannerProps

Overrides

Construct.constructor

Properties

node

Readonly node: ConstructNode

The construct tree node associated with this construct.

stability stable

Inherited from

Construct.node


sandbox

Readonly sandbox: Sandbox


scanFunction

Readonly scanFunction: IFunction


scanStatusTagName

Readonly scanStatusTagName: string


updateFunction

Readonly updateFunction: IFunction

Methods

addSourceBucket

addSourceBucket(bucket): void

Parameters

Name Type
bucket Bucket

Returns

void


onPrepare

Protected onPrepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.onPrepare


onSynthesize

Protected onSynthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.onSynthesize


onValidate

Protected onValidate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.onValidate


prepare

Protected prepare(): void

Perform final modifications before synthesis.

This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

This is an advanced framework feature. Only use this if you understand the implications.

stability stable

Returns

void

Inherited from

Construct.prepare


synthesize

Protected synthesize(session): void

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

stability stable

Parameters

Name Type Description
session ISynthesisSession The synthesis session.

Returns

void

Inherited from

Construct.synthesize


toString

toString(): string

Returns a string representation of this construct.

stability stable

Returns

string

Inherited from

Construct.toString


validate

Protected validate(): string[]

Validate the current construct.

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

stability stable

Returns

string[]

An array of validation error messages, or an empty array if the construct is valid.

Inherited from

Construct.validate


isConstruct

Static isConstruct(x): x is Construct

Return whether the given object is a Construct.

stability stable

Parameters

Name Type
x any

Returns

x is Construct

Inherited from

Construct.isConstruct

Definition Bucket Props

@cloudcomponents/cdk-s3-antivirus / DefinitionBucketProps

Interface: DefinitionBucketProps

Table of contents

Properties

Properties

bucketName

Optional Readonly bucketName: string


vpcEndpoint

Readonly vpcEndpoint: string

Definition Initializer Props

@cloudcomponents/cdk-s3-antivirus / DefinitionInitializerProps

Interface: DefinitionInitializerProps

Table of contents

Properties

Properties

fn

Readonly fn: IFunction

Sandbox Props

@cloudcomponents/cdk-s3-antivirus / SandboxProps

Interface: SandboxProps

Table of contents

Properties

Properties

encryptedFileSystem

Optional Readonly encryptedFileSystem: boolean

Scanner Props

@cloudcomponents/cdk-s3-antivirus / ScannerProps

Interface: ScannerProps

Table of contents

Properties

Properties

buckets

Optional Readonly buckets: Bucket[]


onError

Optional Readonly onError: IDestination


onResult

Optional Readonly onResult: IDestination


scanStatusTagName

Optional Readonly scanStatusTagName: string

default cc:scan-status


updateSchedule

Optional Readonly updateSchedule: Schedule