cdk-amazon-connect-constructs 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +10995 -0
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/connect-constructs.test.ts +797 -0
- package/lib/connect-instance.d.ts +125 -0
- package/lib/connect-instance.d.ts.map +1 -0
- package/lib/connect-instance.js +88 -0
- package/lib/contact-flow.d.ts +81 -0
- package/lib/contact-flow.d.ts.map +1 -0
- package/lib/contact-flow.js +80 -0
- package/lib/hours-of-operation.d.ts +102 -0
- package/lib/hours-of-operation.d.ts.map +1 -0
- package/lib/hours-of-operation.js +94 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +23 -0
- package/lib/lambda-integration.d.ts +27 -0
- package/lib/lambda-integration.d.ts.map +1 -0
- package/lib/lambda-integration.js +37 -0
- package/lib/private/arn.d.ts +3 -0
- package/lib/private/arn.d.ts.map +1 -0
- package/lib/private/arn.js +8 -0
- package/lib/queue.d.ts +103 -0
- package/lib/queue.d.ts.map +1 -0
- package/lib/queue.js +64 -0
- package/lib/routing-profile.d.ts +110 -0
- package/lib/routing-profile.d.ts.map +1 -0
- package/lib/routing-profile.js +89 -0
- package/package.json +73 -0
- package/scripts/patch-java-pom.js +45 -0
- package/src/connect-instance.ts +190 -0
- package/src/contact-flow.ts +123 -0
- package/src/hours-of-operation.ts +184 -0
- package/src/index.ts +6 -0
- package/src/lambda-integration.ts +51 -0
- package/src/private/arn.ts +6 -0
- package/src/queue.ts +152 -0
- package/src/routing-profile.ts +196 -0
- package/tsconfig.jsii.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Karth
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# cdk-amazon-connect-constructs
|
|
2
|
+
|
|
3
|
+
L2-style AWS CDK constructs for Amazon Connect.
|
|
4
|
+
|
|
5
|
+
The AWS CDK currently exposes Amazon Connect primarily through low-level
|
|
6
|
+
CloudFormation resources. This library wraps the foundational pieces with
|
|
7
|
+
validated, reusable constructs that are intended to publish through JSII for
|
|
8
|
+
TypeScript, Python, Java, and .NET.
|
|
9
|
+
|
|
10
|
+
## Implemented constructs
|
|
11
|
+
|
|
12
|
+
- `ConnectInstance`
|
|
13
|
+
- `HoursOfOperation`
|
|
14
|
+
- `Queue`
|
|
15
|
+
- `RoutingProfile`
|
|
16
|
+
- `ContactFlow` with JSON import mode
|
|
17
|
+
- `LambdaIntegration`
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install cdk-amazon-connect-constructs aws-cdk-lib constructs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { Stack, aws_lambda as lambda } from 'aws-cdk-lib';
|
|
29
|
+
import {
|
|
30
|
+
ConnectInstance,
|
|
31
|
+
ContactFlow,
|
|
32
|
+
DayOfWeek,
|
|
33
|
+
HoursOfOperation,
|
|
34
|
+
LambdaIntegration,
|
|
35
|
+
Queue,
|
|
36
|
+
RoutingProfile,
|
|
37
|
+
} from 'cdk-amazon-connect-constructs';
|
|
38
|
+
|
|
39
|
+
const stack = new Stack();
|
|
40
|
+
|
|
41
|
+
const instance = new ConnectInstance(stack, 'Instance', {
|
|
42
|
+
instanceAlias: 'support',
|
|
43
|
+
attributes: {
|
|
44
|
+
contactflowLogs: true,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const hours = new HoursOfOperation(stack, 'Hours', {
|
|
49
|
+
instance,
|
|
50
|
+
name: 'Business hours',
|
|
51
|
+
timeZone: 'America/New_York',
|
|
52
|
+
config: [
|
|
53
|
+
{
|
|
54
|
+
day: DayOfWeek.MONDAY,
|
|
55
|
+
startTime: { hours: 9 },
|
|
56
|
+
endTime: { hours: 17 },
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const queue = new Queue(stack, 'Queue', {
|
|
62
|
+
instance,
|
|
63
|
+
hoursOfOperation: hours,
|
|
64
|
+
name: 'Support',
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
new RoutingProfile(stack, 'RoutingProfile', {
|
|
68
|
+
instance,
|
|
69
|
+
name: 'Tier 1',
|
|
70
|
+
description: 'Tier 1 support agents',
|
|
71
|
+
defaultOutboundQueue: queue,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const handler = new lambda.Function(stack, 'Handler', {
|
|
75
|
+
code: lambda.Code.fromInline('exports.handler = async () => ({ ok: true });'),
|
|
76
|
+
handler: 'index.handler',
|
|
77
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
new LambdaIntegration(stack, 'LambdaIntegration', {
|
|
81
|
+
instance,
|
|
82
|
+
function: handler,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
new ContactFlow(stack, 'Flow', {
|
|
86
|
+
instance,
|
|
87
|
+
name: 'Inbound support',
|
|
88
|
+
content: ContactFlow.stringify({
|
|
89
|
+
Version: '2019-10-30',
|
|
90
|
+
StartAction: 'disconnect',
|
|
91
|
+
Actions: [
|
|
92
|
+
{
|
|
93
|
+
Identifier: 'disconnect',
|
|
94
|
+
Type: 'DisconnectParticipant',
|
|
95
|
+
Parameters: {},
|
|
96
|
+
Transitions: {},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Roadmap
|
|
104
|
+
|
|
105
|
+
- Add typed builders for common Amazon Connect contact flow actions.
|
|
106
|
+
- Add Lex bot integration.
|
|
107
|
+
- Add phone number claim support.
|
|
108
|
+
- Add security profile, user, and quick connect constructs.
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm install
|
|
114
|
+
npm run build
|
|
115
|
+
npm test
|
|
116
|
+
npm run cdk:synth:example
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The project includes a `.projenrc.ts` configured for a JSII AWS CDK construct
|
|
120
|
+
library so generated project metadata can be maintained through projen.
|
|
121
|
+
|
|
122
|
+
## Java publishing
|
|
123
|
+
|
|
124
|
+
Java artifacts are generated by JSII. Use the Java package helper to generate
|
|
125
|
+
`dist/java/pom.xml` and patch it for the current Sonatype Central Publisher
|
|
126
|
+
Portal flow:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm run package:java
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The generated POM is checked for legacy OSSRH/Nexus publishing settings and is
|
|
133
|
+
patched with `org.sonatype.central:central-publishing-maven-plugin`.
|