@ts-cloud/core 0.2.3 → 0.2.5

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.
Files changed (226) hide show
  1. package/dist/advanced-features.test.d.ts +1 -0
  2. package/dist/aws/cloudformation.d.ts +136 -0
  3. package/dist/aws/cloudfront.d.ts +45 -0
  4. package/dist/aws/credentials.d.ts +77 -0
  5. package/dist/aws/credentials.test.d.ts +4 -0
  6. package/dist/aws/index.d.ts +10 -0
  7. package/dist/aws/s3.d.ts +256 -0
  8. package/dist/aws/s3.test.d.ts +4 -0
  9. package/dist/aws/signature.d.ts +142 -0
  10. package/dist/aws/signature.test.d.ts +4 -0
  11. package/dist/backup/disaster-recovery.d.ts +140 -0
  12. package/dist/backup/disaster-recovery.test.d.ts +1 -0
  13. package/dist/backup/index.d.ts +8 -0
  14. package/dist/backup/manager.d.ts +172 -0
  15. package/dist/backup/manager.test.d.ts +1 -0
  16. package/dist/cicd/circleci.d.ts +50 -0
  17. package/dist/cicd/github-actions.d.ts +62 -0
  18. package/dist/cicd/gitlab-ci.d.ts +50 -0
  19. package/dist/cicd/index.d.ts +7 -0
  20. package/dist/cli/history.d.ts +137 -0
  21. package/dist/cli/index.d.ts +9 -0
  22. package/dist/cli/progress.d.ts +193 -0
  23. package/dist/cli/repl.d.ts +148 -0
  24. package/dist/cli/suggestions.d.ts +74 -0
  25. package/dist/cli/table.d.ts +73 -0
  26. package/dist/cli/table.test.d.ts +1 -0
  27. package/dist/cloudformation/builder.d.ts +93 -0
  28. package/dist/cloudformation/builder.test.d.ts +4 -0
  29. package/dist/cloudformation/builders/api-gateway.d.ts +30 -0
  30. package/dist/cloudformation/builders/cache.d.ts +35 -0
  31. package/dist/cloudformation/builders/cdn.d.ts +34 -0
  32. package/dist/cloudformation/builders/compute.d.ts +68 -0
  33. package/dist/cloudformation/builders/database.d.ts +61 -0
  34. package/dist/cloudformation/builders/functions.d.ts +32 -0
  35. package/dist/cloudformation/builders/messaging.d.ts +17 -0
  36. package/dist/cloudformation/builders/monitoring.d.ts +39 -0
  37. package/dist/cloudformation/builders/network.d.ts +14 -0
  38. package/dist/cloudformation/builders/queue.d.ts +16 -0
  39. package/dist/cloudformation/builders/security.d.ts +31 -0
  40. package/dist/cloudformation/builders/storage.d.ts +36 -0
  41. package/dist/cloudformation/index.d.ts +10 -0
  42. package/dist/cloudformation/types.d.ts +200 -0
  43. package/dist/compliance/aws-config.d.ts +175 -0
  44. package/dist/compliance/cloudtrail.d.ts +132 -0
  45. package/dist/compliance/compliance.test.d.ts +1 -0
  46. package/dist/compliance/guardduty.d.ts +176 -0
  47. package/dist/compliance/index.d.ts +12 -0
  48. package/dist/compliance/security-hub.d.ts +178 -0
  49. package/dist/containers/build-optimization.d.ts +155 -0
  50. package/dist/containers/containers.test.d.ts +1 -0
  51. package/dist/containers/image-scanning.d.ts +144 -0
  52. package/dist/containers/index.d.ts +8 -0
  53. package/dist/containers/registry.d.ts +129 -0
  54. package/dist/containers/service-mesh.d.ts +254 -0
  55. package/dist/database/database.test.d.ts +1 -0
  56. package/dist/database/index.d.ts +8 -0
  57. package/dist/database/migrations.d.ts +153 -0
  58. package/dist/database/performance.d.ts +219 -0
  59. package/dist/database/replicas.d.ts +218 -0
  60. package/dist/database/users.d.ts +165 -0
  61. package/dist/dependency-graph.d.ts +37 -0
  62. package/dist/deployment/ab-testing.d.ts +165 -0
  63. package/dist/deployment/blue-green.d.ts +140 -0
  64. package/dist/deployment/canary.d.ts +165 -0
  65. package/dist/deployment/deployment.test.d.ts +1 -0
  66. package/dist/deployment/index.d.ts +12 -0
  67. package/dist/deployment/progressive.d.ts +50 -0
  68. package/dist/dns/dns.test.d.ts +1 -0
  69. package/dist/dns/dnssec.d.ts +120 -0
  70. package/dist/dns/index.d.ts +7 -0
  71. package/dist/dns/resolver.d.ts +216 -0
  72. package/dist/dns/routing.d.ts +277 -0
  73. package/dist/email/advanced/analytics.d.ts +107 -0
  74. package/dist/email/advanced/index.d.ts +10 -0
  75. package/dist/email/advanced/rules.d.ts +131 -0
  76. package/dist/email/advanced/scheduling.d.ts +81 -0
  77. package/dist/email/advanced/search.d.ts +91 -0
  78. package/dist/email/advanced/shared-mailboxes.d.ts +109 -0
  79. package/dist/email/advanced/templates.d.ts +95 -0
  80. package/dist/email/advanced/threading.d.ts +65 -0
  81. package/dist/email/analytics.d.ts +189 -0
  82. package/dist/email/bounce-handling.d.ts +171 -0
  83. package/dist/email/email.test.d.ts +1 -0
  84. package/dist/email/handlers/__tests__/inbound.test.d.ts +1 -0
  85. package/dist/email/handlers/__tests__/outbound.test.d.ts +1 -0
  86. package/dist/email/handlers/converter.d.ts +11 -0
  87. package/dist/email/handlers/feedback.d.ts +11 -0
  88. package/dist/email/handlers/inbound.d.ts +13 -0
  89. package/dist/email/handlers/outbound.d.ts +13 -0
  90. package/dist/email/index.d.ts +10 -0
  91. package/dist/email/reputation.d.ts +133 -0
  92. package/dist/email/templates.d.ts +124 -0
  93. package/dist/errors/index.d.ts +177 -0
  94. package/dist/errors/index.test.d.ts +4 -0
  95. package/dist/health-checks/index.d.ts +35 -0
  96. package/dist/index.d.ts +15 -256
  97. package/dist/index.js +228 -80
  98. package/dist/intrinsic-functions.d.ts +77 -0
  99. package/dist/lambda/concurrency.d.ts +146 -0
  100. package/dist/lambda/destinations.d.ts +141 -0
  101. package/dist/lambda/dlq.d.ts +160 -0
  102. package/dist/lambda/index.d.ts +10 -0
  103. package/dist/lambda/lambda.test.d.ts +1 -0
  104. package/dist/lambda/layers.d.ts +117 -0
  105. package/dist/lambda/versions.d.ts +145 -0
  106. package/dist/lambda/vpc.d.ts +164 -0
  107. package/dist/local/config.d.ts +44 -0
  108. package/dist/local/index.d.ts +5 -0
  109. package/dist/local/mock-aws.d.ts +69 -0
  110. package/dist/modules/ai.d.ts +108 -0
  111. package/dist/modules/api.d.ts +157 -0
  112. package/dist/modules/auth.d.ts +262 -0
  113. package/dist/modules/cache.d.ts +108 -0
  114. package/dist/modules/cdn.d.ts +305 -0
  115. package/dist/modules/communication.d.ts +117 -0
  116. package/dist/modules/compute.d.ts +1376 -0
  117. package/dist/modules/database.d.ts +144 -0
  118. package/dist/modules/deployment.d.ts +372 -0
  119. package/dist/modules/dns.d.ts +143 -0
  120. package/dist/modules/email.d.ts +314 -0
  121. package/dist/modules/filesystem.d.ts +132 -0
  122. package/dist/modules/index.d.ts +31 -0
  123. package/dist/modules/messaging.d.ts +210 -0
  124. package/dist/modules/monitoring.d.ts +574 -0
  125. package/dist/modules/network.d.ts +148 -0
  126. package/dist/modules/parameter-store.d.ts +143 -0
  127. package/dist/modules/permissions.d.ts +245 -0
  128. package/dist/modules/phone.d.ts +125 -0
  129. package/dist/modules/queue.d.ts +411 -0
  130. package/dist/modules/redirects.d.ts +140 -0
  131. package/dist/modules/registry.d.ts +189 -0
  132. package/dist/modules/search.d.ts +135 -0
  133. package/dist/modules/secrets.d.ts +149 -0
  134. package/dist/modules/security.d.ts +219 -0
  135. package/dist/modules/sms.d.ts +130 -0
  136. package/dist/modules/storage.d.ts +344 -0
  137. package/dist/modules/workflow.d.ts +288 -0
  138. package/dist/multi-account/config.d.ts +166 -0
  139. package/dist/multi-account/index.d.ts +6 -0
  140. package/dist/multi-account/manager.d.ts +181 -0
  141. package/dist/multi-region/cross-region.d.ts +204 -0
  142. package/dist/multi-region/index.d.ts +7 -0
  143. package/dist/multi-region/manager.d.ts +136 -0
  144. package/dist/multi-region/regions.d.ts +98 -0
  145. package/dist/network-security/index.d.ts +55 -0
  146. package/dist/observability/index.d.ts +8 -0
  147. package/dist/observability/logs.d.ts +213 -0
  148. package/dist/observability/metrics.d.ts +187 -0
  149. package/dist/observability/observability.test.d.ts +1 -0
  150. package/dist/observability/synthetics.d.ts +189 -0
  151. package/dist/observability/xray.d.ts +193 -0
  152. package/dist/phone/advanced/analytics.d.ts +83 -0
  153. package/dist/phone/advanced/callbacks.d.ts +67 -0
  154. package/dist/phone/advanced/index.d.ts +7 -0
  155. package/dist/phone/advanced/ivr-builder.d.ts +130 -0
  156. package/dist/phone/advanced/recording.d.ts +62 -0
  157. package/dist/phone/handlers/__tests__/incoming-call.test.d.ts +1 -0
  158. package/dist/phone/handlers/incoming-call.d.ts +10 -0
  159. package/dist/phone/handlers/missed-call.d.ts +9 -0
  160. package/dist/phone/handlers/voicemail.d.ts +10 -0
  161. package/dist/phone/index.d.ts +5 -0
  162. package/dist/presets/api-backend.d.ts +11 -0
  163. package/dist/presets/data-pipeline.d.ts +11 -0
  164. package/dist/presets/extend.d.ts +194 -0
  165. package/dist/presets/extend.test.d.ts +4 -0
  166. package/dist/presets/fullstack-app.d.ts +12 -0
  167. package/dist/presets/index.d.ts +13 -0
  168. package/dist/presets/jamstack.d.ts +12 -0
  169. package/dist/presets/microservices.d.ts +18 -0
  170. package/dist/presets/ml-api.d.ts +13 -0
  171. package/dist/presets/nodejs-server.d.ts +14 -0
  172. package/dist/presets/nodejs-serverless.d.ts +14 -0
  173. package/dist/presets/realtime-app.d.ts +11 -0
  174. package/dist/presets/static-site.d.ts +12 -0
  175. package/dist/presets/traditional-web-app.d.ts +16 -0
  176. package/dist/presets/wordpress.d.ts +12 -0
  177. package/dist/preview/github.d.ts +32 -0
  178. package/dist/preview/github.test.d.ts +1 -0
  179. package/dist/preview/index.d.ts +10 -0
  180. package/dist/preview/manager.d.ts +101 -0
  181. package/dist/preview/manager.test.d.ts +1 -0
  182. package/dist/preview/notifications.d.ts +89 -0
  183. package/dist/preview/notifications.test.d.ts +1 -0
  184. package/dist/queue/batch-processing.d.ts +138 -0
  185. package/dist/queue/dlq-monitoring.d.ts +143 -0
  186. package/dist/queue/fifo.d.ts +131 -0
  187. package/dist/queue/index.d.ts +8 -0
  188. package/dist/queue/management.d.ts +162 -0
  189. package/dist/queue/queue.test.d.ts +1 -0
  190. package/dist/resource-mgmt/index.d.ts +44 -0
  191. package/dist/resource-naming.d.ts +26 -0
  192. package/dist/s3/index.d.ts +227 -0
  193. package/dist/schema/index.d.ts +12 -0
  194. package/dist/security/certificate-manager.d.ts +184 -0
  195. package/dist/security/index.d.ts +8 -0
  196. package/dist/security/scanning.d.ts +196 -0
  197. package/dist/security/secrets-manager.d.ts +204 -0
  198. package/dist/security/secrets-rotation.d.ts +167 -0
  199. package/dist/security/security.test.d.ts +1 -0
  200. package/dist/sms/advanced/ab-testing.d.ts +74 -0
  201. package/dist/sms/advanced/analytics.d.ts +75 -0
  202. package/dist/sms/advanced/campaigns.d.ts +96 -0
  203. package/dist/sms/advanced/chatbot.d.ts +67 -0
  204. package/dist/sms/advanced/index.d.ts +9 -0
  205. package/dist/sms/advanced/link-tracking.d.ts +60 -0
  206. package/dist/sms/advanced/mms.d.ts +60 -0
  207. package/dist/sms/handlers/__tests__/send.test.d.ts +1 -0
  208. package/dist/sms/handlers/delivery-status.d.ts +10 -0
  209. package/dist/sms/handlers/receive.d.ts +10 -0
  210. package/dist/sms/handlers/send.d.ts +10 -0
  211. package/dist/sms/index.d.ts +5 -0
  212. package/dist/stack-diff.d.ts +38 -0
  213. package/dist/static-site/index.d.ts +49 -0
  214. package/dist/template-builder.d.ts +42 -0
  215. package/dist/template-validator.d.ts +28 -0
  216. package/dist/types.d.ts +2514 -0
  217. package/dist/utils/cache.d.ts +117 -0
  218. package/dist/utils/diff.d.ts +52 -0
  219. package/dist/utils/hash.d.ts +73 -0
  220. package/dist/utils/index.d.ts +7 -0
  221. package/dist/utils/parallel.d.ts +78 -0
  222. package/dist/validators/credentials.d.ts +30 -0
  223. package/dist/validators/credentials.test.d.ts +4 -0
  224. package/dist/validators/quotas.d.ts +64 -0
  225. package/dist/validators/quotas.test.d.ts +4 -0
  226. package/package.json +2 -2
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Lambda Versions and Aliases
3
+ * Immutable versions and mutable aliases for Lambda functions
4
+ */
5
+ export interface LambdaVersion {
6
+ id: string;
7
+ functionName: string;
8
+ version: string;
9
+ functionArn: string;
10
+ codeHash: string;
11
+ description?: string;
12
+ runtime: string;
13
+ memorySize: number;
14
+ timeout: number;
15
+ publishedAt: Date;
16
+ }
17
+ export interface LambdaAlias {
18
+ id: string;
19
+ functionName: string;
20
+ aliasName: string;
21
+ aliasArn: string;
22
+ functionVersion: string;
23
+ description?: string;
24
+ routingConfig?: RoutingConfig;
25
+ revisionId?: string;
26
+ }
27
+ export interface RoutingConfig {
28
+ additionalVersionWeights?: Record<string, number>;
29
+ }
30
+ export interface VersionDeployment {
31
+ id: string;
32
+ functionName: string;
33
+ fromVersion: string;
34
+ toVersion: string;
35
+ aliasName: string;
36
+ strategy: 'all_at_once' | 'linear' | 'canary';
37
+ status: 'pending' | 'in_progress' | 'completed' | 'failed';
38
+ startedAt?: Date;
39
+ completedAt?: Date;
40
+ }
41
+ /**
42
+ * Lambda versions manager
43
+ */
44
+ export declare class LambdaVersionsManager {
45
+ private versions;
46
+ private aliases;
47
+ private deployments;
48
+ private versionCounter;
49
+ private aliasCounter;
50
+ private deploymentCounter;
51
+ /**
52
+ * Publish function version
53
+ */
54
+ publishVersion(options: {
55
+ functionName: string;
56
+ description?: string;
57
+ runtime: string;
58
+ memorySize: number;
59
+ timeout: number;
60
+ }): LambdaVersion;
61
+ /**
62
+ * Get next version number
63
+ */
64
+ private getNextVersionNumber;
65
+ /**
66
+ * Create alias
67
+ */
68
+ createAlias(alias: Omit<LambdaAlias, 'id' | 'aliasArn' | 'revisionId'>): LambdaAlias;
69
+ /**
70
+ * Create production alias
71
+ */
72
+ createProductionAlias(options: {
73
+ functionName: string;
74
+ version: string;
75
+ }): LambdaAlias;
76
+ /**
77
+ * Create staging alias
78
+ */
79
+ createStagingAlias(options: {
80
+ functionName: string;
81
+ version: string;
82
+ }): LambdaAlias;
83
+ /**
84
+ * Update alias
85
+ */
86
+ updateAlias(aliasId: string, newVersion: string): LambdaAlias;
87
+ /**
88
+ * Configure weighted routing
89
+ */
90
+ configureWeightedRouting(aliasId: string, weights: Record<string, number>): LambdaAlias;
91
+ /**
92
+ * Create canary deployment
93
+ */
94
+ createCanaryDeployment(options: {
95
+ functionName: string;
96
+ fromVersion: string;
97
+ toVersion: string;
98
+ aliasName: string;
99
+ canaryWeight: number;
100
+ }): VersionDeployment;
101
+ /**
102
+ * Complete deployment
103
+ */
104
+ completeDeployment(deploymentId: string): VersionDeployment;
105
+ /**
106
+ * Rollback deployment
107
+ */
108
+ rollbackDeployment(deploymentId: string): VersionDeployment;
109
+ /**
110
+ * Generate hash
111
+ */
112
+ private generateHash;
113
+ /**
114
+ * Get version
115
+ */
116
+ getVersion(id: string): LambdaVersion | undefined;
117
+ /**
118
+ * List versions
119
+ */
120
+ listVersions(functionName?: string): LambdaVersion[];
121
+ /**
122
+ * Get alias
123
+ */
124
+ getAlias(id: string): LambdaAlias | undefined;
125
+ /**
126
+ * List aliases
127
+ */
128
+ listAliases(functionName?: string): LambdaAlias[];
129
+ /**
130
+ * Generate CloudFormation for version
131
+ */
132
+ generateVersionCF(version: LambdaVersion): any;
133
+ /**
134
+ * Generate CloudFormation for alias
135
+ */
136
+ generateAliasCF(alias: LambdaAlias): any;
137
+ /**
138
+ * Clear all data
139
+ */
140
+ clear(): void;
141
+ }
142
+ /**
143
+ * Global Lambda versions manager instance
144
+ */
145
+ export declare const lambdaVersionsManager: LambdaVersionsManager;
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Lambda VPC Configuration
3
+ * VPC networking for Lambda functions
4
+ */
5
+ export interface LambdaVPCConfig {
6
+ id: string;
7
+ functionName: string;
8
+ vpcId: string;
9
+ subnetIds: string[];
10
+ securityGroupIds: string[];
11
+ ipv6Allowed?: boolean;
12
+ }
13
+ export interface VPCEndpoint {
14
+ id: string;
15
+ vpcId: string;
16
+ serviceName: string;
17
+ endpointType: 'Interface' | 'Gateway';
18
+ subnetIds?: string[];
19
+ securityGroupIds?: string[];
20
+ privateDnsEnabled?: boolean;
21
+ }
22
+ export interface NetworkInterface {
23
+ id: string;
24
+ functionName: string;
25
+ networkInterfaceId: string;
26
+ subnetId: string;
27
+ privateIpAddress: string;
28
+ status: 'creating' | 'available' | 'in-use' | 'deleting';
29
+ attachedAt?: Date;
30
+ }
31
+ export interface VPCConnectivity {
32
+ id: string;
33
+ functionName: string;
34
+ hasInternetAccess: boolean;
35
+ hasNATGateway: boolean;
36
+ hasVPCEndpoints: boolean;
37
+ endpoints: string[];
38
+ recommendations: string[];
39
+ }
40
+ /**
41
+ * Lambda VPC manager
42
+ */
43
+ export declare class LambdaVPCManager {
44
+ private vpcConfigs;
45
+ private endpoints;
46
+ private networkInterfaces;
47
+ private connectivity;
48
+ private configCounter;
49
+ private endpointCounter;
50
+ private eniCounter;
51
+ private connectivityCounter;
52
+ /**
53
+ * Configure VPC
54
+ */
55
+ configureVPC(config: Omit<LambdaVPCConfig, 'id'>): LambdaVPCConfig;
56
+ /**
57
+ * Configure private VPC
58
+ */
59
+ configurePrivateVPC(options: {
60
+ functionName: string;
61
+ vpcId: string;
62
+ privateSubnetIds: string[];
63
+ securityGroupId: string;
64
+ }): LambdaVPCConfig;
65
+ /**
66
+ * Configure multi-AZ VPC
67
+ */
68
+ configureMultiAZVPC(options: {
69
+ functionName: string;
70
+ vpcId: string;
71
+ subnetIds: string[];
72
+ securityGroupIds: string[];
73
+ }): LambdaVPCConfig;
74
+ /**
75
+ * Create VPC endpoint
76
+ */
77
+ createVPCEndpoint(endpoint: Omit<VPCEndpoint, 'id'>): VPCEndpoint;
78
+ /**
79
+ * Create S3 VPC endpoint
80
+ */
81
+ createS3Endpoint(options: {
82
+ vpcId: string;
83
+ routeTableIds: string[];
84
+ }): VPCEndpoint;
85
+ /**
86
+ * Create DynamoDB VPC endpoint
87
+ */
88
+ createDynamoDBEndpoint(options: {
89
+ vpcId: string;
90
+ routeTableIds: string[];
91
+ }): VPCEndpoint;
92
+ /**
93
+ * Create Secrets Manager VPC endpoint
94
+ */
95
+ createSecretsManagerEndpoint(options: {
96
+ vpcId: string;
97
+ subnetIds: string[];
98
+ securityGroupIds: string[];
99
+ }): VPCEndpoint;
100
+ /**
101
+ * Create network interface
102
+ */
103
+ private createNetworkInterface;
104
+ /**
105
+ * Analyze VPC connectivity
106
+ */
107
+ analyzeConnectivity(options: {
108
+ functionName: string;
109
+ hasNATGateway?: boolean;
110
+ hasInternetGateway?: boolean;
111
+ }): VPCConnectivity;
112
+ /**
113
+ * Get VPC config
114
+ */
115
+ getVPCConfig(id: string): LambdaVPCConfig | undefined;
116
+ /**
117
+ * List VPC configs
118
+ */
119
+ listVPCConfigs(functionName?: string): LambdaVPCConfig[];
120
+ /**
121
+ * Get network interfaces
122
+ */
123
+ getNetworkInterfaces(functionName: string): NetworkInterface[];
124
+ /**
125
+ * List VPC endpoints
126
+ */
127
+ listVPCEndpoints(vpcId?: string): VPCEndpoint[];
128
+ /**
129
+ * Generate CloudFormation for VPC config
130
+ */
131
+ generateVPCConfigCF(config: LambdaVPCConfig): any;
132
+ /**
133
+ * Generate CloudFormation for VPC endpoint
134
+ */
135
+ generateVPCEndpointCF(endpoint: VPCEndpoint): any;
136
+ /**
137
+ * Generate security group CloudFormation
138
+ */
139
+ generateSecurityGroupCF(options: {
140
+ groupName: string;
141
+ vpcId: string;
142
+ ingressRules?: Array<{
143
+ protocol: string;
144
+ fromPort: number;
145
+ toPort: number;
146
+ cidrIp?: string;
147
+ sourceSecurityGroupId?: string;
148
+ }>;
149
+ egressRules?: Array<{
150
+ protocol: string;
151
+ fromPort: number;
152
+ toPort: number;
153
+ cidrIp?: string;
154
+ }>;
155
+ }): any;
156
+ /**
157
+ * Clear all data
158
+ */
159
+ clear(): void;
160
+ }
161
+ /**
162
+ * Global Lambda VPC manager instance
163
+ */
164
+ export declare const lambdaVPCManager: LambdaVPCManager;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Local development configuration
3
+ * Configures ts-cloud to use LocalStack and local services
4
+ */
5
+ export interface LocalConfig {
6
+ enabled: boolean;
7
+ localstackEndpoint: string;
8
+ postgresUrl: string;
9
+ redisUrl: string;
10
+ dynamodbEndpoint: string;
11
+ s3Endpoint: string;
12
+ emailEndpoint: string;
13
+ awsRegion: string;
14
+ awsAccessKeyId: string;
15
+ awsSecretAccessKey: string;
16
+ }
17
+ /**
18
+ * Default local development configuration
19
+ */
20
+ export declare const defaultLocalConfig: LocalConfig;
21
+ /**
22
+ * Get local configuration
23
+ */
24
+ export declare function getLocalConfig(): LocalConfig;
25
+ /**
26
+ * Check if running in local development mode
27
+ */
28
+ export declare function isLocalDevelopment(): boolean;
29
+ /**
30
+ * Get AWS endpoint for service in local mode
31
+ */
32
+ export declare function getLocalEndpoint(service: string): string;
33
+ /**
34
+ * Get local credentials
35
+ */
36
+ export declare function getLocalCredentials(): {
37
+ accessKeyId: string;
38
+ secretAccessKey: string;
39
+ region: string;
40
+ };
41
+ /**
42
+ * Create local environment variables for AWS CLI
43
+ */
44
+ export declare function getLocalEnvVars(): Record<string, string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Local development and testing utilities
3
+ */
4
+ export * from './config';
5
+ export * from './mock-aws';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Mock AWS services for unit testing
3
+ * Provides in-memory implementations of AWS services without external dependencies
4
+ */
5
+ export interface MockAWSConfig {
6
+ region?: string;
7
+ credentials?: {
8
+ accessKeyId: string;
9
+ secretAccessKey: string;
10
+ };
11
+ }
12
+ /**
13
+ * Mock CloudFormation service
14
+ */
15
+ export declare class MockCloudFormation {
16
+ private stacks;
17
+ private stackEvents;
18
+ createStack(params: any): Promise<any>;
19
+ updateStack(params: any): Promise<any>;
20
+ deleteStack(params: any): Promise<void>;
21
+ describeStacks(params: any): Promise<any>;
22
+ describeStackEvents(params: any): Promise<any>;
23
+ private addEvent;
24
+ /**
25
+ * Reset mock state (useful for testing)
26
+ */
27
+ reset(): void;
28
+ }
29
+ /**
30
+ * Mock S3 service
31
+ */
32
+ export declare class MockS3 {
33
+ private buckets;
34
+ createBucket(params: any): Promise<any>;
35
+ deleteBucket(params: any): Promise<void>;
36
+ putObject(params: any): Promise<any>;
37
+ getObject(params: any): Promise<any>;
38
+ deleteObject(params: any): Promise<void>;
39
+ listObjects(params: any): Promise<any>;
40
+ /**
41
+ * Reset mock state
42
+ */
43
+ reset(): void;
44
+ }
45
+ /**
46
+ * Mock DynamoDB service
47
+ */
48
+ export declare class MockDynamoDB {
49
+ private tables;
50
+ private data;
51
+ createTable(params: any): Promise<any>;
52
+ deleteTable(params: any): Promise<void>;
53
+ putItem(params: any): Promise<void>;
54
+ getItem(params: any): Promise<any>;
55
+ deleteItem(params: any): Promise<void>;
56
+ scan(params: any): Promise<any>;
57
+ /**
58
+ * Reset mock state
59
+ */
60
+ reset(): void;
61
+ }
62
+ /**
63
+ * Create mock AWS services
64
+ */
65
+ export declare function createMockAWS(_config?: MockAWSConfig): {
66
+ cloudformation: MockCloudFormation;
67
+ s3: MockS3;
68
+ dynamodb: MockDynamoDB;
69
+ };
@@ -0,0 +1,108 @@
1
+ import type { IAMRole, IAMManagedPolicy } from '@ts-cloud/aws-types';
2
+ import type { EnvironmentType } from '../types';
3
+ export interface BedrockRoleOptions {
4
+ slug: string;
5
+ environment: EnvironmentType;
6
+ name?: string;
7
+ models?: string[];
8
+ allowStreaming?: boolean;
9
+ }
10
+ export interface BedrockPolicyOptions {
11
+ slug: string;
12
+ environment: EnvironmentType;
13
+ name?: string;
14
+ models?: string[];
15
+ allowInvoke?: boolean;
16
+ allowStreaming?: boolean;
17
+ allowAsync?: boolean;
18
+ }
19
+ /**
20
+ * AI Module - Amazon Bedrock
21
+ * Provides clean API for setting up Bedrock permissions and roles
22
+ */
23
+ export declare class AI {
24
+ /**
25
+ * Create an IAM role for Bedrock access
26
+ */
27
+ static createBedrockRole(servicePrincipal: string, options: BedrockRoleOptions): {
28
+ role: IAMRole;
29
+ logicalId: string;
30
+ };
31
+ /**
32
+ * Create an IAM policy for Bedrock model invocation
33
+ */
34
+ static createBedrockPolicy(options: BedrockPolicyOptions): {
35
+ policy: IAMManagedPolicy;
36
+ logicalId: string;
37
+ };
38
+ /**
39
+ * Enable Bedrock for Lambda function
40
+ * Returns a role with Bedrock permissions
41
+ */
42
+ static enableBedrockForLambda(options: BedrockRoleOptions): {
43
+ role: IAMRole;
44
+ logicalId: string;
45
+ };
46
+ /**
47
+ * Enable Bedrock for ECS task
48
+ * Returns a role with Bedrock permissions
49
+ */
50
+ static enableBedrockForEcs(options: BedrockRoleOptions): {
51
+ role: IAMRole;
52
+ logicalId: string;
53
+ };
54
+ /**
55
+ * Enable Bedrock for EC2 instance
56
+ * Returns a role with Bedrock permissions
57
+ */
58
+ static enableBedrockForEc2(options: BedrockRoleOptions): {
59
+ role: IAMRole;
60
+ logicalId: string;
61
+ };
62
+ /**
63
+ * Add Bedrock permissions to an existing role
64
+ */
65
+ static addBedrockPermissions(role: IAMRole, models?: string[], allowStreaming?: boolean): IAMRole;
66
+ /**
67
+ * Common Bedrock model IDs
68
+ */
69
+ static readonly Models: {
70
+ readonly Claude3_5_Sonnet: "anthropic.claude-3-5-sonnet-20241022-v2:0";
71
+ readonly Claude3_5_Haiku: "anthropic.claude-3-5-haiku-20241022-v1:0";
72
+ readonly Claude3_Opus: "anthropic.claude-3-opus-20240229-v1:0";
73
+ readonly Claude3_Sonnet: "anthropic.claude-3-sonnet-20240229-v1:0";
74
+ readonly Claude3_Haiku: "anthropic.claude-3-haiku-20240307-v1:0";
75
+ readonly TitanTextG1Express: "amazon.titan-text-express-v1";
76
+ readonly TitanTextG1Lite: "amazon.titan-text-lite-v1";
77
+ readonly TitanEmbedG1Text: "amazon.titan-embed-text-v1";
78
+ readonly TitanImageG1: "amazon.titan-image-generator-v1";
79
+ readonly JurassicUltra: "ai21.j2-ultra-v1";
80
+ readonly JurassicMid: "ai21.j2-mid-v1";
81
+ readonly CommandText: "cohere.command-text-v14";
82
+ readonly CommandLight: "cohere.command-light-text-v14";
83
+ readonly EmbedEnglish: "cohere.embed-english-v3";
84
+ readonly EmbedMultilingual: "cohere.embed-multilingual-v3";
85
+ readonly Llama3_2_1B: "meta.llama3-2-1b-instruct-v1:0";
86
+ readonly Llama3_2_3B: "meta.llama3-2-3b-instruct-v1:0";
87
+ readonly Llama3_2_11B: "meta.llama3-2-11b-instruct-v1:0";
88
+ readonly Llama3_2_90B: "meta.llama3-2-90b-instruct-v1:0";
89
+ readonly Llama3_1_8B: "meta.llama3-1-8b-instruct-v1:0";
90
+ readonly Llama3_1_70B: "meta.llama3-1-70b-instruct-v1:0";
91
+ readonly Llama3_1_405B: "meta.llama3-1-405b-instruct-v1:0";
92
+ readonly Mistral7B: "mistral.mistral-7b-instruct-v0:2";
93
+ readonly Mixtral8x7B: "mistral.mixtral-8x7b-instruct-v0:1";
94
+ readonly MistralLarge: "mistral.mistral-large-2402-v1:0";
95
+ readonly StableDiffusionXL: "stability.stable-diffusion-xl-v1";
96
+ };
97
+ /**
98
+ * Common model groups for easier permission management
99
+ */
100
+ static readonly ModelGroups: {
101
+ readonly AllClaude: readonly ["anthropic.claude-3-5-sonnet-20241022-v2:0", "anthropic.claude-3-5-haiku-20241022-v1:0", "anthropic.claude-3-opus-20240229-v1:0", "anthropic.claude-3-sonnet-20240229-v1:0", "anthropic.claude-3-haiku-20240307-v1:0"];
102
+ readonly AllTitan: readonly ["amazon.titan-text-express-v1", "amazon.titan-text-lite-v1", "amazon.titan-embed-text-v1", "amazon.titan-image-generator-v1"];
103
+ readonly AllLlama: readonly ["meta.llama3-2-1b-instruct-v1:0", "meta.llama3-2-3b-instruct-v1:0", "meta.llama3-2-11b-instruct-v1:0", "meta.llama3-2-90b-instruct-v1:0", "meta.llama3-1-8b-instruct-v1:0", "meta.llama3-1-70b-instruct-v1:0", "meta.llama3-1-405b-instruct-v1:0"];
104
+ readonly TextModels: readonly ["anthropic.claude-3-5-sonnet-20241022-v2:0", "anthropic.claude-3-5-haiku-20241022-v1:0", "amazon.titan-text-express-v1", "meta.llama3-2-11b-instruct-v1:0", "mistral.mistral-7b-instruct-v0:2"];
105
+ readonly EmbeddingModels: readonly ["amazon.titan-embed-text-v1", "cohere.embed-english-v3", "cohere.embed-multilingual-v3"];
106
+ readonly ImageModels: readonly ["amazon.titan-image-generator-v1", "stability.stable-diffusion-xl-v1"];
107
+ };
108
+ }
@@ -0,0 +1,157 @@
1
+ import type { ApiGatewayAuthorizer, ApiGatewayDeployment, ApiGatewayHttpApi, ApiGatewayRestApi, ApiGatewayStage } from '@ts-cloud/aws-types';
2
+ import type { EnvironmentType } from '../types';
3
+ export interface RestApiOptions {
4
+ slug: string;
5
+ environment: EnvironmentType;
6
+ name?: string;
7
+ apiName?: string;
8
+ description?: string;
9
+ endpointType?: 'EDGE' | 'REGIONAL' | 'PRIVATE';
10
+ binaryMediaTypes?: string[];
11
+ compressionSize?: number;
12
+ }
13
+ export interface HttpApiOptions {
14
+ slug: string;
15
+ environment: EnvironmentType;
16
+ name?: string;
17
+ description?: string;
18
+ corsEnabled?: boolean;
19
+ corsOrigins?: string[];
20
+ corsMethods?: string[];
21
+ corsHeaders?: string[];
22
+ corsMaxAge?: number;
23
+ corsAllowCredentials?: boolean;
24
+ }
25
+ export interface WebSocketApiOptions {
26
+ slug: string;
27
+ environment: EnvironmentType;
28
+ name?: string;
29
+ description?: string;
30
+ }
31
+ export interface StageOptions {
32
+ slug: string;
33
+ environment: EnvironmentType;
34
+ stageName?: string;
35
+ description?: string;
36
+ cacheEnabled?: boolean;
37
+ cacheSize?: '0.5' | '1.6' | '6.1' | '13.5' | '28.4' | '58.2' | '118' | '237';
38
+ variables?: Record<string, string>;
39
+ throttling?: {
40
+ burstLimit?: number;
41
+ rateLimit?: number;
42
+ };
43
+ }
44
+ export interface AuthorizerOptions {
45
+ slug: string;
46
+ environment: EnvironmentType;
47
+ name?: string;
48
+ type: 'TOKEN' | 'REQUEST' | 'COGNITO_USER_POOLS';
49
+ functionArn?: string;
50
+ identitySource?: string;
51
+ userPoolArns?: string[];
52
+ ttl?: number;
53
+ }
54
+ /**
55
+ * API Gateway Module - REST, HTTP, and WebSocket APIs
56
+ * Provides clean API for creating and configuring API Gateway resources
57
+ */
58
+ export declare class ApiGateway {
59
+ /**
60
+ * Create a REST API
61
+ */
62
+ static createRestApi(options: RestApiOptions): {
63
+ restApi: ApiGatewayRestApi;
64
+ logicalId: string;
65
+ };
66
+ /**
67
+ * Create an HTTP API (cheaper and simpler than REST API)
68
+ */
69
+ static createHttpApi(options: HttpApiOptions): {
70
+ httpApi: ApiGatewayHttpApi;
71
+ logicalId: string;
72
+ };
73
+ /**
74
+ * Create a WebSocket API
75
+ */
76
+ static createWebSocketApi(options: WebSocketApiOptions): {
77
+ webSocketApi: ApiGatewayHttpApi;
78
+ logicalId: string;
79
+ };
80
+ /**
81
+ * Create a deployment for REST API
82
+ */
83
+ static createDeployment(restApiLogicalId: string, options: {
84
+ slug: string;
85
+ environment: EnvironmentType;
86
+ description?: string;
87
+ }): {
88
+ deployment: ApiGatewayDeployment;
89
+ logicalId: string;
90
+ };
91
+ /**
92
+ * Create a stage for REST API
93
+ */
94
+ static createStage(restApiLogicalId: string, deploymentLogicalId: string, options: StageOptions): {
95
+ stage: ApiGatewayStage;
96
+ logicalId: string;
97
+ };
98
+ /**
99
+ * Create an authorizer for REST API
100
+ */
101
+ static createAuthorizer(restApiLogicalId: string, options: AuthorizerOptions): {
102
+ authorizer: ApiGatewayAuthorizer;
103
+ logicalId: string;
104
+ };
105
+ /**
106
+ * Enable CORS on HTTP API
107
+ */
108
+ static setCors(httpApi: ApiGatewayHttpApi, options?: {
109
+ origins?: string[];
110
+ methods?: string[];
111
+ headers?: string[];
112
+ maxAge?: number;
113
+ allowCredentials?: boolean;
114
+ }): ApiGatewayHttpApi;
115
+ /**
116
+ * Add throttling to stage
117
+ */
118
+ static addThrottling(stage: ApiGatewayStage, burstLimit?: number, rateLimit?: number): ApiGatewayStage;
119
+ /**
120
+ * Enable caching on stage
121
+ */
122
+ static enableCaching(stage: ApiGatewayStage, cacheSize?: '0.5' | '1.6' | '6.1' | '13.5' | '28.4' | '58.2' | '118' | '237', ttl?: number): ApiGatewayStage;
123
+ /**
124
+ * Common cache sizes (in GB)
125
+ */
126
+ static readonly CacheSizes: {
127
+ readonly Small: "0.5";
128
+ readonly Medium: "1.6";
129
+ readonly Large: "6.1";
130
+ readonly XLarge: "13.5";
131
+ readonly XXLarge: "28.4";
132
+ readonly XXXLarge: "58.2";
133
+ readonly Huge: "118";
134
+ readonly Massive: "237";
135
+ };
136
+ /**
137
+ * Common throttling presets
138
+ */
139
+ static readonly ThrottlingPresets: {
140
+ readonly Light: {
141
+ readonly burstLimit: 100;
142
+ readonly rateLimit: 50;
143
+ };
144
+ readonly Medium: {
145
+ readonly burstLimit: 500;
146
+ readonly rateLimit: 250;
147
+ };
148
+ readonly Heavy: {
149
+ readonly burstLimit: 2000;
150
+ readonly rateLimit: 1000;
151
+ };
152
+ readonly Default: {
153
+ readonly burstLimit: 5000;
154
+ readonly rateLimit: 10000;
155
+ };
156
+ };
157
+ }