@ts-cloud/core 0.2.3 → 0.2.4
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/dist/advanced-features.test.d.ts +1 -0
- package/dist/aws/cloudformation.d.ts +136 -0
- package/dist/aws/cloudfront.d.ts +45 -0
- package/dist/aws/credentials.d.ts +77 -0
- package/dist/aws/credentials.test.d.ts +4 -0
- package/dist/aws/index.d.ts +10 -0
- package/dist/aws/s3.d.ts +256 -0
- package/dist/aws/s3.test.d.ts +4 -0
- package/dist/aws/signature.d.ts +142 -0
- package/dist/aws/signature.test.d.ts +4 -0
- package/dist/backup/disaster-recovery.d.ts +140 -0
- package/dist/backup/disaster-recovery.test.d.ts +1 -0
- package/dist/backup/index.d.ts +8 -0
- package/dist/backup/manager.d.ts +172 -0
- package/dist/backup/manager.test.d.ts +1 -0
- package/dist/cicd/circleci.d.ts +50 -0
- package/dist/cicd/github-actions.d.ts +62 -0
- package/dist/cicd/gitlab-ci.d.ts +50 -0
- package/dist/cicd/index.d.ts +7 -0
- package/dist/cli/history.d.ts +137 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/progress.d.ts +193 -0
- package/dist/cli/repl.d.ts +148 -0
- package/dist/cli/suggestions.d.ts +74 -0
- package/dist/cli/table.d.ts +73 -0
- package/dist/cli/table.test.d.ts +1 -0
- package/dist/cloudformation/builder.d.ts +93 -0
- package/dist/cloudformation/builder.test.d.ts +4 -0
- package/dist/cloudformation/builders/api-gateway.d.ts +30 -0
- package/dist/cloudformation/builders/cache.d.ts +35 -0
- package/dist/cloudformation/builders/cdn.d.ts +34 -0
- package/dist/cloudformation/builders/compute.d.ts +68 -0
- package/dist/cloudformation/builders/database.d.ts +61 -0
- package/dist/cloudformation/builders/functions.d.ts +32 -0
- package/dist/cloudformation/builders/messaging.d.ts +17 -0
- package/dist/cloudformation/builders/monitoring.d.ts +39 -0
- package/dist/cloudformation/builders/network.d.ts +14 -0
- package/dist/cloudformation/builders/queue.d.ts +16 -0
- package/dist/cloudformation/builders/security.d.ts +31 -0
- package/dist/cloudformation/builders/storage.d.ts +36 -0
- package/dist/cloudformation/index.d.ts +10 -0
- package/dist/cloudformation/types.d.ts +200 -0
- package/dist/compliance/aws-config.d.ts +175 -0
- package/dist/compliance/cloudtrail.d.ts +132 -0
- package/dist/compliance/compliance.test.d.ts +1 -0
- package/dist/compliance/guardduty.d.ts +176 -0
- package/dist/compliance/index.d.ts +12 -0
- package/dist/compliance/security-hub.d.ts +178 -0
- package/dist/containers/build-optimization.d.ts +155 -0
- package/dist/containers/containers.test.d.ts +1 -0
- package/dist/containers/image-scanning.d.ts +144 -0
- package/dist/containers/index.d.ts +8 -0
- package/dist/containers/registry.d.ts +129 -0
- package/dist/containers/service-mesh.d.ts +254 -0
- package/dist/database/database.test.d.ts +1 -0
- package/dist/database/index.d.ts +8 -0
- package/dist/database/migrations.d.ts +153 -0
- package/dist/database/performance.d.ts +219 -0
- package/dist/database/replicas.d.ts +218 -0
- package/dist/database/users.d.ts +165 -0
- package/dist/dependency-graph.d.ts +37 -0
- package/dist/deployment/ab-testing.d.ts +165 -0
- package/dist/deployment/blue-green.d.ts +140 -0
- package/dist/deployment/canary.d.ts +165 -0
- package/dist/deployment/deployment.test.d.ts +1 -0
- package/dist/deployment/index.d.ts +12 -0
- package/dist/deployment/progressive.d.ts +50 -0
- package/dist/dns/dns.test.d.ts +1 -0
- package/dist/dns/dnssec.d.ts +120 -0
- package/dist/dns/index.d.ts +7 -0
- package/dist/dns/resolver.d.ts +216 -0
- package/dist/dns/routing.d.ts +277 -0
- package/dist/email/advanced/analytics.d.ts +107 -0
- package/dist/email/advanced/index.d.ts +10 -0
- package/dist/email/advanced/rules.d.ts +131 -0
- package/dist/email/advanced/scheduling.d.ts +81 -0
- package/dist/email/advanced/search.d.ts +91 -0
- package/dist/email/advanced/shared-mailboxes.d.ts +109 -0
- package/dist/email/advanced/templates.d.ts +95 -0
- package/dist/email/advanced/threading.d.ts +65 -0
- package/dist/email/analytics.d.ts +189 -0
- package/dist/email/bounce-handling.d.ts +171 -0
- package/dist/email/email.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/inbound.test.d.ts +1 -0
- package/dist/email/handlers/__tests__/outbound.test.d.ts +1 -0
- package/dist/email/handlers/converter.d.ts +11 -0
- package/dist/email/handlers/feedback.d.ts +11 -0
- package/dist/email/handlers/inbound.d.ts +13 -0
- package/dist/email/handlers/outbound.d.ts +13 -0
- package/dist/email/index.d.ts +10 -0
- package/dist/email/reputation.d.ts +133 -0
- package/dist/email/templates.d.ts +124 -0
- package/dist/errors/index.d.ts +177 -0
- package/dist/errors/index.test.d.ts +4 -0
- package/dist/health-checks/index.d.ts +35 -0
- package/dist/index.d.ts +15 -256
- package/dist/index.js +228 -80
- package/dist/intrinsic-functions.d.ts +77 -0
- package/dist/lambda/concurrency.d.ts +146 -0
- package/dist/lambda/destinations.d.ts +141 -0
- package/dist/lambda/dlq.d.ts +160 -0
- package/dist/lambda/index.d.ts +10 -0
- package/dist/lambda/lambda.test.d.ts +1 -0
- package/dist/lambda/layers.d.ts +117 -0
- package/dist/lambda/versions.d.ts +145 -0
- package/dist/lambda/vpc.d.ts +164 -0
- package/dist/local/config.d.ts +44 -0
- package/dist/local/index.d.ts +5 -0
- package/dist/local/mock-aws.d.ts +69 -0
- package/dist/modules/ai.d.ts +108 -0
- package/dist/modules/api.d.ts +157 -0
- package/dist/modules/auth.d.ts +262 -0
- package/dist/modules/cache.d.ts +108 -0
- package/dist/modules/cdn.d.ts +305 -0
- package/dist/modules/communication.d.ts +117 -0
- package/dist/modules/compute.d.ts +1376 -0
- package/dist/modules/database.d.ts +144 -0
- package/dist/modules/deployment.d.ts +372 -0
- package/dist/modules/dns.d.ts +143 -0
- package/dist/modules/email.d.ts +314 -0
- package/dist/modules/filesystem.d.ts +132 -0
- package/dist/modules/index.d.ts +31 -0
- package/dist/modules/messaging.d.ts +210 -0
- package/dist/modules/monitoring.d.ts +574 -0
- package/dist/modules/network.d.ts +148 -0
- package/dist/modules/parameter-store.d.ts +143 -0
- package/dist/modules/permissions.d.ts +245 -0
- package/dist/modules/phone.d.ts +125 -0
- package/dist/modules/queue.d.ts +411 -0
- package/dist/modules/redirects.d.ts +140 -0
- package/dist/modules/registry.d.ts +189 -0
- package/dist/modules/search.d.ts +135 -0
- package/dist/modules/secrets.d.ts +149 -0
- package/dist/modules/security.d.ts +219 -0
- package/dist/modules/sms.d.ts +130 -0
- package/dist/modules/storage.d.ts +344 -0
- package/dist/modules/workflow.d.ts +288 -0
- package/dist/multi-account/config.d.ts +166 -0
- package/dist/multi-account/index.d.ts +6 -0
- package/dist/multi-account/manager.d.ts +181 -0
- package/dist/multi-region/cross-region.d.ts +204 -0
- package/dist/multi-region/index.d.ts +7 -0
- package/dist/multi-region/manager.d.ts +136 -0
- package/dist/multi-region/regions.d.ts +98 -0
- package/dist/network-security/index.d.ts +55 -0
- package/dist/observability/index.d.ts +8 -0
- package/dist/observability/logs.d.ts +213 -0
- package/dist/observability/metrics.d.ts +187 -0
- package/dist/observability/observability.test.d.ts +1 -0
- package/dist/observability/synthetics.d.ts +189 -0
- package/dist/observability/xray.d.ts +193 -0
- package/dist/phone/advanced/analytics.d.ts +83 -0
- package/dist/phone/advanced/callbacks.d.ts +67 -0
- package/dist/phone/advanced/index.d.ts +7 -0
- package/dist/phone/advanced/ivr-builder.d.ts +130 -0
- package/dist/phone/advanced/recording.d.ts +62 -0
- package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +1 -0
- package/dist/phone/handlers/incoming-call.d.ts +10 -0
- package/dist/phone/handlers/missed-call.d.ts +9 -0
- package/dist/phone/handlers/voicemail.d.ts +10 -0
- package/dist/phone/index.d.ts +5 -0
- package/dist/presets/api-backend.d.ts +11 -0
- package/dist/presets/data-pipeline.d.ts +11 -0
- package/dist/presets/extend.d.ts +194 -0
- package/dist/presets/extend.test.d.ts +4 -0
- package/dist/presets/fullstack-app.d.ts +12 -0
- package/dist/presets/index.d.ts +13 -0
- package/dist/presets/jamstack.d.ts +12 -0
- package/dist/presets/microservices.d.ts +18 -0
- package/dist/presets/ml-api.d.ts +13 -0
- package/dist/presets/nodejs-server.d.ts +14 -0
- package/dist/presets/nodejs-serverless.d.ts +14 -0
- package/dist/presets/realtime-app.d.ts +11 -0
- package/dist/presets/static-site.d.ts +12 -0
- package/dist/presets/traditional-web-app.d.ts +16 -0
- package/dist/presets/wordpress.d.ts +12 -0
- package/dist/preview/github.d.ts +32 -0
- package/dist/preview/github.test.d.ts +1 -0
- package/dist/preview/index.d.ts +10 -0
- package/dist/preview/manager.d.ts +101 -0
- package/dist/preview/manager.test.d.ts +1 -0
- package/dist/preview/notifications.d.ts +89 -0
- package/dist/preview/notifications.test.d.ts +1 -0
- package/dist/queue/batch-processing.d.ts +138 -0
- package/dist/queue/dlq-monitoring.d.ts +143 -0
- package/dist/queue/fifo.d.ts +131 -0
- package/dist/queue/index.d.ts +8 -0
- package/dist/queue/management.d.ts +162 -0
- package/dist/queue/queue.test.d.ts +1 -0
- package/dist/resource-mgmt/index.d.ts +44 -0
- package/dist/resource-naming.d.ts +26 -0
- package/dist/s3/index.d.ts +227 -0
- package/dist/schema/index.d.ts +12 -0
- package/dist/security/certificate-manager.d.ts +184 -0
- package/dist/security/index.d.ts +8 -0
- package/dist/security/scanning.d.ts +196 -0
- package/dist/security/secrets-manager.d.ts +204 -0
- package/dist/security/secrets-rotation.d.ts +167 -0
- package/dist/security/security.test.d.ts +1 -0
- package/dist/sms/advanced/ab-testing.d.ts +74 -0
- package/dist/sms/advanced/analytics.d.ts +75 -0
- package/dist/sms/advanced/campaigns.d.ts +96 -0
- package/dist/sms/advanced/chatbot.d.ts +67 -0
- package/dist/sms/advanced/index.d.ts +9 -0
- package/dist/sms/advanced/link-tracking.d.ts +60 -0
- package/dist/sms/advanced/mms.d.ts +60 -0
- package/dist/sms/handlers/__tests__/send.test.d.ts +1 -0
- package/dist/sms/handlers/delivery-status.d.ts +10 -0
- package/dist/sms/handlers/receive.d.ts +10 -0
- package/dist/sms/handlers/send.d.ts +10 -0
- package/dist/sms/index.d.ts +5 -0
- package/dist/stack-diff.d.ts +38 -0
- package/dist/static-site/index.d.ts +49 -0
- package/dist/template-builder.d.ts +42 -0
- package/dist/template-validator.d.ts +28 -0
- package/dist/types.d.ts +2514 -0
- package/dist/utils/cache.d.ts +117 -0
- package/dist/utils/diff.d.ts +52 -0
- package/dist/utils/hash.d.ts +73 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/parallel.d.ts +78 -0
- package/dist/validators/credentials.d.ts +30 -0
- package/dist/validators/credentials.test.d.ts +4 -0
- package/dist/validators/quotas.d.ts +64 -0
- package/dist/validators/quotas.test.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import type { IAMPolicy, IAMRole, LambdaFunction, LambdaPermission, Route53RecordSet, S3Bucket, SESConfigurationSet, SESEmailIdentity, SESReceiptRule, SESReceiptRuleSet } from '@ts-cloud/aws-types';
|
|
2
|
+
import type { EnvironmentType } from '../types';
|
|
3
|
+
export interface EmailIdentityOptions {
|
|
4
|
+
domain: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
environment: EnvironmentType;
|
|
7
|
+
enableDkim?: boolean;
|
|
8
|
+
dkimKeyLength?: 'RSA_1024_BIT' | 'RSA_2048_BIT';
|
|
9
|
+
}
|
|
10
|
+
export interface ConfigurationSetOptions {
|
|
11
|
+
slug: string;
|
|
12
|
+
environment: EnvironmentType;
|
|
13
|
+
name?: string;
|
|
14
|
+
reputationMetrics?: boolean;
|
|
15
|
+
sendingEnabled?: boolean;
|
|
16
|
+
suppressBounces?: boolean;
|
|
17
|
+
suppressComplaints?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ReceiptRuleSetOptions {
|
|
20
|
+
slug: string;
|
|
21
|
+
environment: EnvironmentType;
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ReceiptRuleOptions {
|
|
25
|
+
slug: string;
|
|
26
|
+
environment: EnvironmentType;
|
|
27
|
+
ruleSetName: string;
|
|
28
|
+
recipients?: string[];
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
scanEnabled?: boolean;
|
|
31
|
+
tlsPolicy?: 'Optional' | 'Require';
|
|
32
|
+
s3Action?: {
|
|
33
|
+
bucketName: string;
|
|
34
|
+
prefix?: string;
|
|
35
|
+
kmsKeyArn?: string;
|
|
36
|
+
};
|
|
37
|
+
lambdaAction?: {
|
|
38
|
+
functionArn: string;
|
|
39
|
+
invocationType?: 'Event' | 'RequestResponse';
|
|
40
|
+
};
|
|
41
|
+
snsAction?: {
|
|
42
|
+
topicArn: string;
|
|
43
|
+
encoding?: 'UTF-8' | 'Base64';
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Email Module - SES (Simple Email Service)
|
|
48
|
+
* Provides clean API for email sending, receiving, and domain verification
|
|
49
|
+
*/
|
|
50
|
+
export declare class Email {
|
|
51
|
+
/**
|
|
52
|
+
* Verify a domain for sending emails
|
|
53
|
+
*/
|
|
54
|
+
static verifyDomain(options: EmailIdentityOptions): {
|
|
55
|
+
emailIdentity: SESEmailIdentity;
|
|
56
|
+
logicalId: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Create DNS records for DKIM verification
|
|
60
|
+
* Returns Route53 RecordSets for DKIM tokens
|
|
61
|
+
*/
|
|
62
|
+
static createDkimRecords(domain: string, dkimTokens: string[], hostedZoneId: string): Array<{
|
|
63
|
+
record: Route53RecordSet;
|
|
64
|
+
logicalId: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Create SES Configuration Set
|
|
68
|
+
*/
|
|
69
|
+
static createConfigurationSet(options: ConfigurationSetOptions): {
|
|
70
|
+
configurationSet: SESConfigurationSet;
|
|
71
|
+
logicalId: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Create Receipt Rule Set for inbound email
|
|
75
|
+
*/
|
|
76
|
+
static createReceiptRuleSet(options: ReceiptRuleSetOptions): {
|
|
77
|
+
ruleSet: SESReceiptRuleSet;
|
|
78
|
+
logicalId: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Create Receipt Rule for processing inbound emails
|
|
82
|
+
*/
|
|
83
|
+
static createReceiptRule(ruleSetLogicalId: string, options: ReceiptRuleOptions): {
|
|
84
|
+
receiptRule: SESReceiptRule;
|
|
85
|
+
logicalId: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Create MX record for receiving emails
|
|
89
|
+
*/
|
|
90
|
+
static createMxRecord(domain: string, hostedZoneId: string, region: string): {
|
|
91
|
+
record: Route53RecordSet;
|
|
92
|
+
logicalId: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Create verification TXT record
|
|
96
|
+
*/
|
|
97
|
+
static createVerificationRecord(domain: string, verificationToken: string, hostedZoneId: string): {
|
|
98
|
+
record: Route53RecordSet;
|
|
99
|
+
logicalId: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Get SES SMTP credentials information
|
|
103
|
+
*/
|
|
104
|
+
static getSmtpEndpoint(region: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Get SES SMTP port options
|
|
107
|
+
*/
|
|
108
|
+
static readonly SmtpPorts: {
|
|
109
|
+
readonly TLS: 587;
|
|
110
|
+
readonly SSL: 465;
|
|
111
|
+
readonly Unencrypted: 25;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Create SPF record for email authentication
|
|
115
|
+
*/
|
|
116
|
+
static createSpfRecord(domain: string, hostedZoneId: string, options?: {
|
|
117
|
+
includeDomains?: string[];
|
|
118
|
+
softFail?: boolean;
|
|
119
|
+
}): {
|
|
120
|
+
record: Route53RecordSet;
|
|
121
|
+
logicalId: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Create DMARC record for email authentication
|
|
125
|
+
*/
|
|
126
|
+
static createDmarcRecord(domain: string, hostedZoneId: string, options?: {
|
|
127
|
+
policy?: 'none' | 'quarantine' | 'reject';
|
|
128
|
+
subdomainPolicy?: 'none' | 'quarantine' | 'reject';
|
|
129
|
+
percentage?: number;
|
|
130
|
+
reportingEmail?: string;
|
|
131
|
+
forensicEmail?: string;
|
|
132
|
+
}): {
|
|
133
|
+
record: Route53RecordSet;
|
|
134
|
+
logicalId: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Create complete inbound email setup
|
|
138
|
+
* Includes receipt rule set, rule, and S3 storage
|
|
139
|
+
*/
|
|
140
|
+
static createInboundEmailSetup(options: {
|
|
141
|
+
slug: string;
|
|
142
|
+
environment: EnvironmentType;
|
|
143
|
+
domain: string;
|
|
144
|
+
s3BucketName: string;
|
|
145
|
+
s3KeyPrefix?: string;
|
|
146
|
+
region: string;
|
|
147
|
+
hostedZoneId: string;
|
|
148
|
+
lambdaFunctionArn?: string;
|
|
149
|
+
snsTopicArn?: string;
|
|
150
|
+
}): {
|
|
151
|
+
resources: Record<string, any>;
|
|
152
|
+
outputs: {
|
|
153
|
+
ruleSetLogicalId: string;
|
|
154
|
+
ruleLogicalId: string;
|
|
155
|
+
mxRecordLogicalId: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Create complete email domain setup
|
|
160
|
+
* Includes domain verification, DKIM, SPF, DMARC, and optionally inbound email
|
|
161
|
+
*/
|
|
162
|
+
static createCompleteDomainSetup(options: {
|
|
163
|
+
slug: string;
|
|
164
|
+
environment: EnvironmentType;
|
|
165
|
+
domain: string;
|
|
166
|
+
hostedZoneId: string;
|
|
167
|
+
region: string;
|
|
168
|
+
enableInbound?: boolean;
|
|
169
|
+
inboundS3Bucket?: string;
|
|
170
|
+
dmarcReportingEmail?: string;
|
|
171
|
+
}): {
|
|
172
|
+
resources: Record<string, any>;
|
|
173
|
+
outputs: {
|
|
174
|
+
identityLogicalId: string;
|
|
175
|
+
configSetLogicalId: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* SES inbound SMTP endpoints by region
|
|
180
|
+
*/
|
|
181
|
+
static readonly InboundSmtpEndpoints: Record<string, string>;
|
|
182
|
+
/**
|
|
183
|
+
* Check if region supports SES inbound email
|
|
184
|
+
*/
|
|
185
|
+
static supportsInboundEmail(region: string): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Create IAM role for email Lambda functions
|
|
188
|
+
*/
|
|
189
|
+
static createEmailLambdaRole(options: {
|
|
190
|
+
slug: string;
|
|
191
|
+
environment: EnvironmentType;
|
|
192
|
+
s3BucketArn: string;
|
|
193
|
+
sesIdentityArn?: string;
|
|
194
|
+
}): {
|
|
195
|
+
role: IAMRole;
|
|
196
|
+
policy: IAMPolicy;
|
|
197
|
+
roleLogicalId: string;
|
|
198
|
+
policyLogicalId: string;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Create Lambda function for outbound email (JSON to raw email conversion)
|
|
202
|
+
* Converts JSON email payloads to raw MIME format and sends via SES
|
|
203
|
+
*/
|
|
204
|
+
static createOutboundEmailLambda(options: {
|
|
205
|
+
slug: string;
|
|
206
|
+
environment: EnvironmentType;
|
|
207
|
+
roleArn: string;
|
|
208
|
+
domain: string;
|
|
209
|
+
configurationSetName?: string;
|
|
210
|
+
timeout?: number;
|
|
211
|
+
memorySize?: number;
|
|
212
|
+
}): {
|
|
213
|
+
function: LambdaFunction;
|
|
214
|
+
logicalId: string;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Create Lambda function for inbound email processing
|
|
218
|
+
* Organizes emails by From/To addresses and extracts metadata
|
|
219
|
+
*/
|
|
220
|
+
static createInboundEmailLambda(options: {
|
|
221
|
+
slug: string;
|
|
222
|
+
environment: EnvironmentType;
|
|
223
|
+
roleArn: string;
|
|
224
|
+
s3BucketName: string;
|
|
225
|
+
organizedPrefix?: string;
|
|
226
|
+
timeout?: number;
|
|
227
|
+
memorySize?: number;
|
|
228
|
+
}): {
|
|
229
|
+
function: LambdaFunction;
|
|
230
|
+
permission: LambdaPermission;
|
|
231
|
+
logicalId: string;
|
|
232
|
+
permissionLogicalId: string;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Create Lambda function for email conversion
|
|
236
|
+
* Converts raw MIME emails to HTML/text format
|
|
237
|
+
*/
|
|
238
|
+
static createEmailConversionLambda(options: {
|
|
239
|
+
slug: string;
|
|
240
|
+
environment: EnvironmentType;
|
|
241
|
+
roleArn: string;
|
|
242
|
+
s3BucketName: string;
|
|
243
|
+
convertedPrefix?: string;
|
|
244
|
+
timeout?: number;
|
|
245
|
+
memorySize?: number;
|
|
246
|
+
}): {
|
|
247
|
+
function: LambdaFunction;
|
|
248
|
+
logicalId: string;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Create S3 bucket notification configuration for email processing
|
|
252
|
+
*/
|
|
253
|
+
static createEmailBucketNotification(options: {
|
|
254
|
+
bucketLogicalId: string;
|
|
255
|
+
lambdaArn: string;
|
|
256
|
+
prefix?: string;
|
|
257
|
+
suffix?: string;
|
|
258
|
+
events?: string[];
|
|
259
|
+
}): {
|
|
260
|
+
notificationConfiguration: NonNullable<NonNullable<S3Bucket['Properties']>['NotificationConfiguration']>;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Create Lambda permission for S3 to invoke email processing Lambda
|
|
264
|
+
*/
|
|
265
|
+
static createS3LambdaPermission(options: {
|
|
266
|
+
slug: string;
|
|
267
|
+
environment: EnvironmentType;
|
|
268
|
+
lambdaLogicalId: string;
|
|
269
|
+
s3BucketArn: string;
|
|
270
|
+
}): {
|
|
271
|
+
permission: LambdaPermission;
|
|
272
|
+
logicalId: string;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Create complete email processing stack
|
|
276
|
+
* Includes all Lambda functions, IAM roles, and S3 notifications
|
|
277
|
+
*/
|
|
278
|
+
static createEmailProcessingStack(options: {
|
|
279
|
+
slug: string;
|
|
280
|
+
environment: EnvironmentType;
|
|
281
|
+
domain: string;
|
|
282
|
+
s3BucketName: string;
|
|
283
|
+
s3BucketArn: string;
|
|
284
|
+
configurationSetName?: string;
|
|
285
|
+
enableInbound?: boolean;
|
|
286
|
+
enableConversion?: boolean;
|
|
287
|
+
}): {
|
|
288
|
+
resources: Record<string, any>;
|
|
289
|
+
outputs: {
|
|
290
|
+
roleLogicalId: string;
|
|
291
|
+
outboundLambdaLogicalId: string;
|
|
292
|
+
inboundLambdaLogicalId?: string;
|
|
293
|
+
conversionLambdaLogicalId?: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Lambda function code for email processing
|
|
298
|
+
*/
|
|
299
|
+
static readonly LambdaCode: {
|
|
300
|
+
/**
|
|
301
|
+
* Outbound email Lambda - JSON to raw email conversion
|
|
302
|
+
*/
|
|
303
|
+
outboundEmail: string;
|
|
304
|
+
/**
|
|
305
|
+
* Inbound email Lambda - Processes raw emails into EmailSDK-compatible structure
|
|
306
|
+
* Writes to: mailboxes/{domain}/{localPart}/inbox.json + per-message files
|
|
307
|
+
*/
|
|
308
|
+
inboundEmail: string;
|
|
309
|
+
/**
|
|
310
|
+
* Email conversion Lambda - Raw to HTML/text
|
|
311
|
+
*/
|
|
312
|
+
emailConversion: string;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { EC2SecurityGroup, EFSAccessPoint, EFSFileSystem, EFSMountTarget } from '@ts-cloud/aws-types';
|
|
2
|
+
import type { EnvironmentType } from '../types';
|
|
3
|
+
export interface FileSystemOptions {
|
|
4
|
+
slug: string;
|
|
5
|
+
environment: EnvironmentType;
|
|
6
|
+
encrypted?: boolean;
|
|
7
|
+
kmsKeyId?: string;
|
|
8
|
+
performanceMode?: 'generalPurpose' | 'maxIO';
|
|
9
|
+
throughputMode?: 'bursting' | 'provisioned' | 'elastic';
|
|
10
|
+
provisionedThroughput?: number;
|
|
11
|
+
enableBackup?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface MountTargetOptions {
|
|
14
|
+
slug: string;
|
|
15
|
+
environment: EnvironmentType;
|
|
16
|
+
subnetId: string;
|
|
17
|
+
securityGroups: string[];
|
|
18
|
+
ipAddress?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AccessPointOptions {
|
|
21
|
+
slug: string;
|
|
22
|
+
environment: EnvironmentType;
|
|
23
|
+
path?: string;
|
|
24
|
+
uid?: string;
|
|
25
|
+
gid?: string;
|
|
26
|
+
permissions?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LifecyclePolicyOptions {
|
|
29
|
+
transitionToIA?: 7 | 14 | 30 | 60 | 90;
|
|
30
|
+
transitionToPrimary?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* FileSystem Module - EFS (Elastic File System)
|
|
34
|
+
* Provides clean API for creating and configuring shared file systems
|
|
35
|
+
*/
|
|
36
|
+
export declare class FileSystem {
|
|
37
|
+
/**
|
|
38
|
+
* Create an EFS file system
|
|
39
|
+
*/
|
|
40
|
+
static createFileSystem(options: FileSystemOptions): {
|
|
41
|
+
fileSystem: EFSFileSystem;
|
|
42
|
+
logicalId: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Create a mount target for multi-AZ access
|
|
46
|
+
*/
|
|
47
|
+
static createMountTarget(fileSystemLogicalId: string, options: MountTargetOptions): {
|
|
48
|
+
mountTarget: EFSMountTarget;
|
|
49
|
+
logicalId: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Create an access point with POSIX permissions
|
|
53
|
+
*/
|
|
54
|
+
static createAccessPoint(fileSystemLogicalId: string, options: AccessPointOptions): {
|
|
55
|
+
accessPoint: EFSAccessPoint;
|
|
56
|
+
logicalId: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Set lifecycle policy for cost optimization
|
|
60
|
+
*/
|
|
61
|
+
static setLifecyclePolicy(fileSystem: EFSFileSystem, options: LifecyclePolicyOptions): EFSFileSystem;
|
|
62
|
+
/**
|
|
63
|
+
* Enable automatic backups
|
|
64
|
+
*/
|
|
65
|
+
static enableBackup(fileSystem: EFSFileSystem): EFSFileSystem;
|
|
66
|
+
/**
|
|
67
|
+
* Disable automatic backups
|
|
68
|
+
*/
|
|
69
|
+
static disableBackup(fileSystem: EFSFileSystem): EFSFileSystem;
|
|
70
|
+
/**
|
|
71
|
+
* Set provisioned throughput mode
|
|
72
|
+
*/
|
|
73
|
+
static setProvisionedThroughput(fileSystem: EFSFileSystem, throughputInMibps: number): EFSFileSystem;
|
|
74
|
+
/**
|
|
75
|
+
* Set elastic throughput mode (recommended for most workloads)
|
|
76
|
+
*/
|
|
77
|
+
static setElasticThroughput(fileSystem: EFSFileSystem): EFSFileSystem;
|
|
78
|
+
/**
|
|
79
|
+
* Enable max I/O performance mode (for highly parallelized workloads)
|
|
80
|
+
*/
|
|
81
|
+
static enableMaxIO(fileSystem: EFSFileSystem): EFSFileSystem;
|
|
82
|
+
/**
|
|
83
|
+
* Create a security group for EFS mount targets
|
|
84
|
+
* Allows NFS traffic (port 2049) from specified sources
|
|
85
|
+
*/
|
|
86
|
+
static createEfsSecurityGroup(options: {
|
|
87
|
+
slug: string;
|
|
88
|
+
environment: EnvironmentType;
|
|
89
|
+
vpcId: string;
|
|
90
|
+
sourceSecurityGroupIds?: string[];
|
|
91
|
+
sourceCidrBlocks?: string[];
|
|
92
|
+
description?: string;
|
|
93
|
+
}): {
|
|
94
|
+
securityGroup: EC2SecurityGroup;
|
|
95
|
+
logicalId: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Create mount targets across multiple subnets (multi-AZ)
|
|
99
|
+
* Returns all mount targets and their logical IDs
|
|
100
|
+
*/
|
|
101
|
+
static createMultiAzMountTargets(fileSystemLogicalId: string, options: {
|
|
102
|
+
slug: string;
|
|
103
|
+
environment: EnvironmentType;
|
|
104
|
+
subnetIds: string[];
|
|
105
|
+
securityGroupId: string;
|
|
106
|
+
}): {
|
|
107
|
+
mountTargets: EFSMountTarget[];
|
|
108
|
+
logicalIds: string[];
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Create a complete EFS setup with security group and mount targets
|
|
112
|
+
*/
|
|
113
|
+
static createCompleteFileSystem(options: {
|
|
114
|
+
slug: string;
|
|
115
|
+
environment: EnvironmentType;
|
|
116
|
+
vpcId: string;
|
|
117
|
+
subnetIds: string[];
|
|
118
|
+
sourceSecurityGroupIds?: string[];
|
|
119
|
+
encrypted?: boolean;
|
|
120
|
+
performanceMode?: 'generalPurpose' | 'maxIO';
|
|
121
|
+
throughputMode?: 'bursting' | 'provisioned' | 'elastic';
|
|
122
|
+
enableBackup?: boolean;
|
|
123
|
+
transitionToIA?: 7 | 14 | 30 | 60 | 90;
|
|
124
|
+
}): {
|
|
125
|
+
resources: Record<string, any>;
|
|
126
|
+
outputs: {
|
|
127
|
+
fileSystemId: string;
|
|
128
|
+
securityGroupId: string;
|
|
129
|
+
mountTargetIds: string[];
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ts-cloud Resource Modules
|
|
3
|
+
* Clean API abstractions for AWS CloudFormation resources
|
|
4
|
+
*/
|
|
5
|
+
export * from './storage';
|
|
6
|
+
export * from './registry';
|
|
7
|
+
export * from './cdn';
|
|
8
|
+
export * from './dns';
|
|
9
|
+
export * from './security';
|
|
10
|
+
export * from './compute';
|
|
11
|
+
export * from './network';
|
|
12
|
+
export * from './filesystem';
|
|
13
|
+
export * from './email';
|
|
14
|
+
export * from './phone';
|
|
15
|
+
export * from './queue';
|
|
16
|
+
export * from './sms';
|
|
17
|
+
export * from './ai';
|
|
18
|
+
export * from './database';
|
|
19
|
+
export * from './cache';
|
|
20
|
+
export * from './permissions';
|
|
21
|
+
export * from './api';
|
|
22
|
+
export * from './messaging';
|
|
23
|
+
export * from './workflow';
|
|
24
|
+
export * from './monitoring';
|
|
25
|
+
export * from './auth';
|
|
26
|
+
export * from './deployment';
|
|
27
|
+
export * from './secrets';
|
|
28
|
+
export * from './parameter-store';
|
|
29
|
+
export * from './search';
|
|
30
|
+
export * from './redirects';
|
|
31
|
+
export * from './communication';
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { SNSSubscription, SNSTopic, SNSTopicPolicy } from '@ts-cloud/aws-types';
|
|
2
|
+
import type { EnvironmentType } from '../types';
|
|
3
|
+
export interface TopicOptions {
|
|
4
|
+
slug: string;
|
|
5
|
+
environment: EnvironmentType;
|
|
6
|
+
topicName?: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
encrypted?: boolean;
|
|
9
|
+
kmsKeyId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SubscriptionOptions {
|
|
12
|
+
slug: string;
|
|
13
|
+
environment: EnvironmentType;
|
|
14
|
+
protocol: 'http' | 'https' | 'email' | 'email-json' | 'sms' | 'sqs' | 'application' | 'lambda' | 'firehose';
|
|
15
|
+
endpoint: string;
|
|
16
|
+
filterPolicy?: Record<string, unknown>;
|
|
17
|
+
rawMessageDelivery?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface TopicPolicyOptions {
|
|
20
|
+
slug: string;
|
|
21
|
+
environment: EnvironmentType;
|
|
22
|
+
allowedPrincipals?: string | string[];
|
|
23
|
+
allowedServices?: string | string[];
|
|
24
|
+
actions?: string | string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Messaging Module - SNS (Simple Notification Service)
|
|
28
|
+
* Provides clean API for pub/sub messaging, notifications, and event routing
|
|
29
|
+
*/
|
|
30
|
+
export declare class Messaging {
|
|
31
|
+
/**
|
|
32
|
+
* Create an SNS topic
|
|
33
|
+
*/
|
|
34
|
+
static createTopic(options: TopicOptions): {
|
|
35
|
+
topic: SNSTopic;
|
|
36
|
+
logicalId: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to a topic
|
|
40
|
+
*/
|
|
41
|
+
static subscribe(topicLogicalId: string, options: SubscriptionOptions): {
|
|
42
|
+
subscription: SNSSubscription;
|
|
43
|
+
logicalId: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Subscribe email to topic
|
|
47
|
+
*/
|
|
48
|
+
static subscribeEmail(topicLogicalId: string, email: string, options: {
|
|
49
|
+
slug: string;
|
|
50
|
+
environment: EnvironmentType;
|
|
51
|
+
filterPolicy?: Record<string, unknown>;
|
|
52
|
+
}): {
|
|
53
|
+
subscription: SNSSubscription;
|
|
54
|
+
logicalId: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Subscribe Lambda function to topic
|
|
58
|
+
*/
|
|
59
|
+
static subscribeLambda(topicLogicalId: string, functionArn: string, options: {
|
|
60
|
+
slug: string;
|
|
61
|
+
environment: EnvironmentType;
|
|
62
|
+
filterPolicy?: Record<string, unknown>;
|
|
63
|
+
}): {
|
|
64
|
+
subscription: SNSSubscription;
|
|
65
|
+
logicalId: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Subscribe SQS queue to topic
|
|
69
|
+
*/
|
|
70
|
+
static subscribeSqs(topicLogicalId: string, queueArn: string, options: {
|
|
71
|
+
slug: string;
|
|
72
|
+
environment: EnvironmentType;
|
|
73
|
+
filterPolicy?: Record<string, unknown>;
|
|
74
|
+
rawMessageDelivery?: boolean;
|
|
75
|
+
}): {
|
|
76
|
+
subscription: SNSSubscription;
|
|
77
|
+
logicalId: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Subscribe HTTP/HTTPS endpoint to topic
|
|
81
|
+
*/
|
|
82
|
+
static subscribeHttp(topicLogicalId: string, url: string, options: {
|
|
83
|
+
slug: string;
|
|
84
|
+
environment: EnvironmentType;
|
|
85
|
+
filterPolicy?: Record<string, unknown>;
|
|
86
|
+
}): {
|
|
87
|
+
subscription: SNSSubscription;
|
|
88
|
+
logicalId: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Subscribe SMS to topic
|
|
92
|
+
*/
|
|
93
|
+
static subscribeSms(topicLogicalId: string, phoneNumber: string, options: {
|
|
94
|
+
slug: string;
|
|
95
|
+
environment: EnvironmentType;
|
|
96
|
+
}): {
|
|
97
|
+
subscription: SNSSubscription;
|
|
98
|
+
logicalId: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Create a topic policy
|
|
102
|
+
*/
|
|
103
|
+
static setTopicPolicy(topicLogicalId: string, options: TopicPolicyOptions): {
|
|
104
|
+
policy: SNSTopicPolicy;
|
|
105
|
+
logicalId: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Allow CloudWatch Alarms to publish to topic
|
|
109
|
+
*/
|
|
110
|
+
static allowCloudWatchAlarms(topicLogicalId: string, options: {
|
|
111
|
+
slug: string;
|
|
112
|
+
environment: EnvironmentType;
|
|
113
|
+
}): {
|
|
114
|
+
policy: SNSTopicPolicy;
|
|
115
|
+
logicalId: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Allow EventBridge to publish to topic
|
|
119
|
+
*/
|
|
120
|
+
static allowEventBridge(topicLogicalId: string, options: {
|
|
121
|
+
slug: string;
|
|
122
|
+
environment: EnvironmentType;
|
|
123
|
+
}): {
|
|
124
|
+
policy: SNSTopicPolicy;
|
|
125
|
+
logicalId: string;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Allow S3 to publish to topic
|
|
129
|
+
*/
|
|
130
|
+
static allowS3(topicLogicalId: string, options: {
|
|
131
|
+
slug: string;
|
|
132
|
+
environment: EnvironmentType;
|
|
133
|
+
}): {
|
|
134
|
+
policy: SNSTopicPolicy;
|
|
135
|
+
logicalId: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Enable encryption on topic
|
|
139
|
+
*/
|
|
140
|
+
static enableEncryption(topic: SNSTopic, kmsKeyId: string): SNSTopic;
|
|
141
|
+
/**
|
|
142
|
+
* Add inline subscription to topic
|
|
143
|
+
*/
|
|
144
|
+
static addInlineSubscription(topic: SNSTopic, protocol: SubscriptionOptions['protocol'], endpoint: string): SNSTopic;
|
|
145
|
+
/**
|
|
146
|
+
* Common filter policy patterns
|
|
147
|
+
*/
|
|
148
|
+
static readonly FilterPolicies: {
|
|
149
|
+
/**
|
|
150
|
+
* Filter by event type
|
|
151
|
+
*/
|
|
152
|
+
readonly eventType: (types: string[]) => {
|
|
153
|
+
eventType: string[];
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Filter by status
|
|
157
|
+
*/
|
|
158
|
+
readonly status: (statuses: string[]) => {
|
|
159
|
+
status: string[];
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Filter by numeric range
|
|
163
|
+
*/
|
|
164
|
+
readonly numericRange: (attribute: string, min: number, max: number) => Record<string, Array<{
|
|
165
|
+
numeric: (string | number)[];
|
|
166
|
+
}>>;
|
|
167
|
+
/**
|
|
168
|
+
* Filter by string prefix
|
|
169
|
+
*/
|
|
170
|
+
readonly prefix: (attribute: string, prefixValue: string) => Record<string, Array<{
|
|
171
|
+
prefix: string;
|
|
172
|
+
}>>;
|
|
173
|
+
/**
|
|
174
|
+
* Filter by multiple attributes (AND logic)
|
|
175
|
+
*/
|
|
176
|
+
readonly and: (...policies: Record<string, unknown>[]) => Record<string, unknown>;
|
|
177
|
+
/**
|
|
178
|
+
* Filter by exists/not exists
|
|
179
|
+
*/
|
|
180
|
+
readonly exists: (attribute: string, existsValue: boolean) => Record<string, Array<{
|
|
181
|
+
exists: boolean;
|
|
182
|
+
}>>;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Common use cases for SNS topics
|
|
186
|
+
*/
|
|
187
|
+
static readonly UseCases: {
|
|
188
|
+
/**
|
|
189
|
+
* Create alert topic for CloudWatch alarms
|
|
190
|
+
*/
|
|
191
|
+
readonly createAlertTopic: (options: TopicOptions) => {
|
|
192
|
+
topic: SNSTopic;
|
|
193
|
+
logicalId: string;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Create event fanout topic for distributing events
|
|
197
|
+
*/
|
|
198
|
+
readonly createEventFanout: (options: TopicOptions) => {
|
|
199
|
+
topic: SNSTopic;
|
|
200
|
+
logicalId: string;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Create notification topic for user notifications
|
|
204
|
+
*/
|
|
205
|
+
readonly createNotificationTopic: (options: TopicOptions) => {
|
|
206
|
+
topic: SNSTopic;
|
|
207
|
+
logicalId: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
}
|