Skip to main content

Amazon Connect L2 Construct library

License

This CDK Construct Library provides L2 constructs for Amazon Connect.

This is used in production internally. However, it is alpha and subject to breaking changes as better ways of managing resources are designed.

Package Installation

NPM

yarn add @netforbpo/aws-cdk-aws-connect-lib
# or
npm install @netforbpo/aws-cdk-aws-connect-lib

PyPI

uv add netforbpo-aws-cdk-aws-connect-lib
# or
pip install netforbpo-aws-cdk-aws-connect-lib

Basic Usage

Typescript

import * as connect from '@netforbpo/aws-cdk-aws-connect-lib';
import {
  aws_s3 as s3
} from '@aws-cdk';

// assuming `this` is your stack or other construct

const instance = new connect.Instance(this, 'myInstance', {
  identityManagementType: connect.IdentityManagementType.CONNECT_MANAGED,
  instanceAlias: 'my-instance-alias',
  telephonyConfig: {
    inboundCalls: true,
    outboundCalls: true,
  },
  otherConfig: {
    contactFlowLogs: true,
  }
});

const bucket = s3.Bucket(this, 'ConnectStorage');

instance.addStorageConfig(connect.SttorageConfig.buildS3(
    connect.StorageType.CALL_RECORDINGS,
    {
      bucket,
      prefix: 'call-recordings'
    }
));

Python

import aws_cdk_aws_connect_lib as connect
from aws_cdk import aws_s3 as s3

# Assuming `self` is your stack or other construct

self.instance = new connect.Instance(self, 'myInstance',
  identity_management_type=connect.IdentityManagementType.CONNECT_MANAGED,
  instance_alias='my-instance-alias',
  telephony_config=connect.TelephonyConfigProps(
    inbound_calls=True,
    outbound_calls=True,
  ),
  other_config=connect.OtherConfigProps(
    contact_flow_logs=True,
  )
)

self.bucket = s3.Bucket(stack, 'ConnectStorage')

self.instance.add_storage_config(
    connect.SttorageConfig.buildS3(
        resource_type=connect.StorageType.CALL_RECORDINGS,
        bucket=self.bucket,
        prefix='call-recordings'
    )
)

locating resources

Currently only Instance has a fromLookup method to build an Instance object from an previousl created connect instance (from another stack, or manually).

All the other resources can be used against that looked-up instance.

The ability to look up other resources will be added in the future once a PR gets merged into core aws-cdk ( aws/aws-cdk-cli#1015 ).

Example usage

import aws_cdk_aws_connect_lib as connect

self.instance = connect.Instance.from_lookup(self, 'myInstance',
    instance_name='my-instance-alias'
    # instance_arn and instance_id are also available
)

# Assuming self.bucket is an S3 bucket
self.instance.add_storage_config(
    connect.SttorageConfig.buildS3(
        resource_type=connect.StorageType.CHAT_TRANSCRIPTS,
        bucket=self.bucket,
        prefix='chat-transcripts'
    )
)

Associating Lex & Lambda bots

To associate a Lex Bot or Lambda Function to a connect instance there are two helper methods available on an instance (whether created or looked-up)

import aws_cdk_aws_connect_lib as connect

# and to associate a Lex Bot or Lambda Function to the connect instance

# Assuming self.lex_bot is a Lex Bot Alias
self.instance.associate_lex_bot('MyLexBot', self.lex_bot_alias)

# Assuming self.lambda_function is a Lambda Function or lambda function alias
self.instance.associate_lambda_function('MyLambda', self.lambda_function)

Metadata

Release files for netforbpo-aws-cdk-aws-connect-lib 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netforbpo-aws-cdk-aws-connect-lib 0.3.1
File Size Uploaded Provenance
netforbpo_aws_cdk_aws_connect_lib-0.3.1.tar.gz 2.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for netforbpo-aws-cdk-aws-connect-lib 0.3.1
File Interpreter ABI Platform
netforbpo_aws_cdk_aws_connect_lib-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.2 MB

Release files / netforbpo_aws_cdk_aws_connect_lib-0.3.1.tar.gz

Download URL netforbpo_aws_cdk_aws_connect_lib-0.3.1.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
6bcf82fd059298f2fe500353482c9f9637d2b788117879ecbc1fba1346a18a1c
BLAKE2b-256 checksum
How to use checksums
6e41e7016c3414c8fccdcebf69b1a3ab6cf8c97a2e12bcf312cfa0ca5ce5211d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.15

Release files / netforbpo_aws_cdk_aws_connect_lib-0.3.1-py3-none-any.whl

Download URL netforbpo_aws_cdk_aws_connect_lib-0.3.1-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a4d4e604c09c36d95429d8eb6ecabc4ec02609ab4796d38eea6538cf3c889b1e
BLAKE2b-256 checksum
How to use checksums
b785998c18d1f2c779c3434c1c2bc5486fafbfb24cb640be978062ed745989b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.15

Security for netforbpo-aws-cdk-aws-connect-lib 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page