@ts-cloud/core 0.2.2 → 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.
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,144 @@
1
+ import type { DynamoDBTable, RDSDBInstance, RDSDBParameterGroup, RDSDBSubnetGroup } from '@ts-cloud/aws-types';
2
+ import type { EnvironmentType } from '../types';
3
+ export interface RDSOptions {
4
+ slug: string;
5
+ environment: EnvironmentType;
6
+ dbInstanceIdentifier?: string;
7
+ dbInstanceClass?: string;
8
+ instanceClass?: string;
9
+ allocatedStorage?: number;
10
+ storageType?: 'gp2' | 'gp3' | 'io1' | 'io2';
11
+ masterUsername?: string;
12
+ masterUserPassword?: string;
13
+ masterPassword?: string;
14
+ databaseName?: string;
15
+ subnetIds?: string[];
16
+ securityGroupIds?: string[];
17
+ encrypted?: boolean;
18
+ kmsKeyId?: string;
19
+ multiAz?: boolean;
20
+ backupRetentionDays?: number;
21
+ publiclyAccessible?: boolean;
22
+ enableCloudwatchLogs?: boolean;
23
+ deletionProtection?: boolean;
24
+ }
25
+ export interface DynamoDBTableOptions {
26
+ slug: string;
27
+ environment: EnvironmentType;
28
+ tableName?: string;
29
+ partitionKey: {
30
+ name: string;
31
+ type: 'S' | 'N' | 'B';
32
+ };
33
+ sortKey?: {
34
+ name: string;
35
+ type: 'S' | 'N' | 'B';
36
+ };
37
+ billingMode?: 'PROVISIONED' | 'PAY_PER_REQUEST';
38
+ readCapacity?: number;
39
+ writeCapacity?: number;
40
+ streamEnabled?: boolean;
41
+ streamViewType?: 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES' | 'KEYS_ONLY';
42
+ encrypted?: boolean;
43
+ kmsKeyId?: string;
44
+ pointInTimeRecovery?: boolean;
45
+ ttlAttribute?: string;
46
+ }
47
+ export interface GlobalSecondaryIndexOptions {
48
+ indexName: string;
49
+ partitionKey: {
50
+ name: string;
51
+ type: 'S' | 'N' | 'B';
52
+ };
53
+ sortKey?: {
54
+ name: string;
55
+ type: 'S' | 'N' | 'B';
56
+ };
57
+ projectionType?: 'ALL' | 'KEYS_ONLY' | 'INCLUDE';
58
+ nonKeyAttributes?: string[];
59
+ readCapacity?: number;
60
+ writeCapacity?: number;
61
+ }
62
+ /**
63
+ * Database Module - RDS + DynamoDB
64
+ * Provides clean API for relational (RDS) and NoSQL (DynamoDB) databases
65
+ */
66
+ export declare class Database {
67
+ /**
68
+ * Create a PostgreSQL RDS instance
69
+ */
70
+ static createPostgres(options: RDSOptions): {
71
+ dbInstance: RDSDBInstance;
72
+ subnetGroup?: RDSDBSubnetGroup;
73
+ logicalId: string;
74
+ subnetGroupId?: string;
75
+ };
76
+ /**
77
+ * Create a MySQL RDS instance
78
+ */
79
+ static createMysql(options: RDSOptions): {
80
+ dbInstance: RDSDBInstance;
81
+ subnetGroup?: RDSDBSubnetGroup;
82
+ logicalId: string;
83
+ subnetGroupId?: string;
84
+ };
85
+ /**
86
+ * Create an RDS instance (internal helper)
87
+ */
88
+ private static createRDSInstance;
89
+ /**
90
+ * Create a read replica
91
+ */
92
+ static createReadReplica(sourceDbLogicalId: string, options: Omit<RDSOptions, 'masterUsername' | 'masterPassword' | 'databaseName'>): {
93
+ replica: RDSDBInstance;
94
+ logicalId: string;
95
+ };
96
+ /**
97
+ * Create a DB parameter group
98
+ */
99
+ static createParameterGroup(engine: 'postgres' | 'mysql', version: string, options: {
100
+ slug: string;
101
+ environment: EnvironmentType;
102
+ parameters?: Record<string, string>;
103
+ }): {
104
+ parameterGroup: RDSDBParameterGroup;
105
+ logicalId: string;
106
+ };
107
+ /**
108
+ * Enable backup for RDS instance
109
+ */
110
+ static enableBackup(dbInstance: RDSDBInstance, retentionDays?: number): RDSDBInstance;
111
+ /**
112
+ * Create a DynamoDB table
113
+ */
114
+ static createTable(options: DynamoDBTableOptions): {
115
+ table: DynamoDBTable;
116
+ logicalId: string;
117
+ };
118
+ /**
119
+ * Add a global secondary index to a DynamoDB table
120
+ */
121
+ static addGlobalSecondaryIndex(table: DynamoDBTable, index: GlobalSecondaryIndexOptions): DynamoDBTable;
122
+ /**
123
+ * Enable streams on a DynamoDB table
124
+ */
125
+ static enableStreams(table: DynamoDBTable, viewType?: 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES' | 'KEYS_ONLY'): DynamoDBTable;
126
+ /**
127
+ * Common RDS instance classes
128
+ */
129
+ static readonly InstanceClasses: {
130
+ readonly T3_Micro: "db.t3.micro";
131
+ readonly T3_Small: "db.t3.small";
132
+ readonly T3_Medium: "db.t3.medium";
133
+ readonly T3_Large: "db.t3.large";
134
+ readonly T4g_Micro: "db.t4g.micro";
135
+ readonly T4g_Small: "db.t4g.small";
136
+ readonly T4g_Medium: "db.t4g.medium";
137
+ readonly M5_Large: "db.m5.large";
138
+ readonly M5_XLarge: "db.m5.xlarge";
139
+ readonly M5_2XLarge: "db.m5.2xlarge";
140
+ readonly R5_Large: "db.r5.large";
141
+ readonly R5_XLarge: "db.r5.xlarge";
142
+ readonly R5_2XLarge: "db.r5.2xlarge";
143
+ };
144
+ }
@@ -0,0 +1,372 @@
1
+ import type { CodeDeployApplication, CodeDeployDeploymentGroup, CodeDeployDeploymentConfig } from '@ts-cloud/aws-types';
2
+ import type { EnvironmentType } from '../types';
3
+ /**
4
+ * Asset file with hash information
5
+ */
6
+ export interface HashedAsset {
7
+ originalPath: string;
8
+ hashedPath: string;
9
+ hash: string;
10
+ size: number;
11
+ contentType: string;
12
+ }
13
+ /**
14
+ * Asset manifest for deployment
15
+ */
16
+ export interface AssetManifest {
17
+ version: string;
18
+ timestamp: string;
19
+ assets: HashedAsset[];
20
+ hashMap: Record<string, string>;
21
+ }
22
+ export interface CodeDeployApplicationOptions {
23
+ slug: string;
24
+ environment: EnvironmentType;
25
+ applicationName?: string;
26
+ computePlatform: 'Server' | 'Lambda' | 'ECS';
27
+ }
28
+ export interface CodeDeployDeploymentGroupOptions {
29
+ slug: string;
30
+ environment: EnvironmentType;
31
+ deploymentGroupName?: string;
32
+ serviceRoleArn: string;
33
+ autoScalingGroups?: string[];
34
+ ec2TagFilters?: Array<{
35
+ key?: string;
36
+ value?: string;
37
+ type?: 'KEY_ONLY' | 'VALUE_ONLY' | 'KEY_AND_VALUE';
38
+ }>;
39
+ deploymentConfigName?: string;
40
+ autoRollbackConfiguration?: {
41
+ enabled: boolean;
42
+ events?: ('DEPLOYMENT_FAILURE' | 'DEPLOYMENT_STOP_ON_ALARM' | 'DEPLOYMENT_STOP_ON_REQUEST')[];
43
+ };
44
+ alarmConfiguration?: {
45
+ enabled: boolean;
46
+ alarms?: Array<{
47
+ name: string;
48
+ }>;
49
+ ignorePollAlarmFailure?: boolean;
50
+ };
51
+ loadBalancerInfo?: {
52
+ targetGroupInfoList?: Array<{
53
+ name: string;
54
+ }>;
55
+ elbInfoList?: Array<{
56
+ name: string;
57
+ }>;
58
+ };
59
+ blueGreenDeploymentConfiguration?: {
60
+ terminateBlueInstancesOnDeploymentSuccess?: {
61
+ action?: 'TERMINATE' | 'KEEP_ALIVE';
62
+ terminationWaitTimeInMinutes?: number;
63
+ };
64
+ deploymentReadyOption?: {
65
+ actionOnTimeout?: 'CONTINUE_DEPLOYMENT' | 'STOP_DEPLOYMENT';
66
+ waitTimeInMinutes?: number;
67
+ };
68
+ greenFleetProvisioningOption?: {
69
+ action?: 'DISCOVER_EXISTING' | 'COPY_AUTO_SCALING_GROUP';
70
+ };
71
+ };
72
+ }
73
+ export interface CodeDeployDeploymentConfigOptions {
74
+ slug: string;
75
+ environment: EnvironmentType;
76
+ deploymentConfigName?: string;
77
+ minimumHealthyHosts?: {
78
+ type: 'HOST_COUNT' | 'FLEET_PERCENT';
79
+ value: number;
80
+ };
81
+ trafficRoutingConfig?: {
82
+ type: 'TimeBasedCanary' | 'TimeBasedLinear' | 'AllAtOnce';
83
+ timeBasedCanary?: {
84
+ canaryPercentage: number;
85
+ canaryInterval: number;
86
+ };
87
+ timeBasedLinear?: {
88
+ linearPercentage: number;
89
+ linearInterval: number;
90
+ };
91
+ };
92
+ }
93
+ export interface DeploymentStrategyOptions {
94
+ type: 'rolling' | 'blue-green' | 'canary' | 'all-at-once';
95
+ batchSize?: number;
96
+ batchPercentage?: number;
97
+ canaryPercentage?: number;
98
+ canaryInterval?: number;
99
+ }
100
+ /**
101
+ * Deployment Module - CodeDeploy and Deployment Utilities
102
+ * Provides clean API for deployment infrastructure and strategies
103
+ */
104
+ export declare class Deployment {
105
+ /**
106
+ * Create a CodeDeploy Application
107
+ */
108
+ static createApplication(options: CodeDeployApplicationOptions): {
109
+ application: CodeDeployApplication;
110
+ logicalId: string;
111
+ };
112
+ /**
113
+ * Create a CodeDeploy Deployment Group
114
+ */
115
+ static createDeploymentGroup(applicationLogicalId: string, options: CodeDeployDeploymentGroupOptions): {
116
+ deploymentGroup: CodeDeployDeploymentGroup;
117
+ logicalId: string;
118
+ };
119
+ /**
120
+ * Create a CodeDeploy Deployment Configuration
121
+ */
122
+ static createDeploymentConfig(options: CodeDeployDeploymentConfigOptions): {
123
+ deploymentConfig: CodeDeployDeploymentConfig;
124
+ logicalId: string;
125
+ };
126
+ /**
127
+ * Common deployment configurations
128
+ */
129
+ static readonly DeploymentConfigs: {
130
+ /**
131
+ * All at once deployment (fastest, but downtime)
132
+ */
133
+ readonly allAtOnce: () => CodeDeployDeploymentConfigOptions["minimumHealthyHosts"];
134
+ /**
135
+ * Half at a time deployment
136
+ */
137
+ readonly halfAtATime: () => CodeDeployDeploymentConfigOptions["minimumHealthyHosts"];
138
+ /**
139
+ * One at a time deployment (slowest, but safest)
140
+ */
141
+ readonly oneAtATime: () => CodeDeployDeploymentConfigOptions["minimumHealthyHosts"];
142
+ /**
143
+ * Custom deployment configuration
144
+ */
145
+ readonly custom: (type: "HOST_COUNT" | "FLEET_PERCENT", value: number) => CodeDeployDeploymentConfigOptions["minimumHealthyHosts"];
146
+ };
147
+ /**
148
+ * Traffic routing configurations
149
+ */
150
+ static readonly TrafficRouting: {
151
+ /**
152
+ * All traffic at once
153
+ */
154
+ readonly allAtOnce: () => CodeDeployDeploymentConfigOptions["trafficRoutingConfig"];
155
+ /**
156
+ * Canary deployment (shift traffic in two steps)
157
+ */
158
+ readonly canary: (canaryPercentage: number, canaryInterval: number) => CodeDeployDeploymentConfigOptions["trafficRoutingConfig"];
159
+ /**
160
+ * Linear deployment (shift traffic gradually)
161
+ */
162
+ readonly linear: (linearPercentage: number, linearInterval: number) => CodeDeployDeploymentConfigOptions["trafficRoutingConfig"];
163
+ };
164
+ /**
165
+ * Rollback configurations
166
+ */
167
+ static readonly RollbackConfigs: {
168
+ /**
169
+ * Auto rollback on deployment failure
170
+ */
171
+ readonly onFailure: () => CodeDeployDeploymentGroupOptions["autoRollbackConfiguration"];
172
+ /**
173
+ * Auto rollback on alarm or failure
174
+ */
175
+ readonly onAlarmOrFailure: () => CodeDeployDeploymentGroupOptions["autoRollbackConfiguration"];
176
+ /**
177
+ * Auto rollback on all events
178
+ */
179
+ readonly onAllEvents: () => CodeDeployDeploymentGroupOptions["autoRollbackConfiguration"];
180
+ /**
181
+ * No auto rollback
182
+ */
183
+ readonly disabled: () => CodeDeployDeploymentGroupOptions["autoRollbackConfiguration"];
184
+ };
185
+ /**
186
+ * Blue/Green deployment configurations
187
+ */
188
+ static readonly BlueGreenConfigs: {
189
+ /**
190
+ * Standard blue/green with immediate termination
191
+ */
192
+ readonly standard: () => CodeDeployDeploymentGroupOptions["blueGreenDeploymentConfiguration"];
193
+ /**
194
+ * Blue/green with delayed termination
195
+ */
196
+ readonly withDelay: (terminationWaitTimeInMinutes: number) => CodeDeployDeploymentGroupOptions["blueGreenDeploymentConfiguration"];
197
+ /**
198
+ * Blue/green with manual approval
199
+ */
200
+ readonly withManualApproval: (waitTimeInMinutes: number) => CodeDeployDeploymentGroupOptions["blueGreenDeploymentConfiguration"];
201
+ /**
202
+ * Blue/green keeping old instances
203
+ */
204
+ readonly keepBlue: () => CodeDeployDeploymentGroupOptions["blueGreenDeploymentConfiguration"];
205
+ };
206
+ /**
207
+ * Common use cases
208
+ */
209
+ static readonly UseCases: {
210
+ /**
211
+ * Create basic EC2 deployment
212
+ */
213
+ readonly ec2Deployment: (slug: string, environment: EnvironmentType, serviceRoleArn: string, autoScalingGroups: string[]) => {
214
+ application: CodeDeployApplication;
215
+ appId: string;
216
+ deploymentGroup: CodeDeployDeploymentGroup;
217
+ groupId: string;
218
+ };
219
+ /**
220
+ * Create Lambda deployment with canary
221
+ */
222
+ readonly lambdaCanaryDeployment: (slug: string, environment: EnvironmentType, serviceRoleArn: string, canaryPercentage?: number, canaryInterval?: number) => {
223
+ application: CodeDeployApplication;
224
+ appId: string;
225
+ deploymentConfig: CodeDeployDeploymentConfig;
226
+ configId: string;
227
+ deploymentGroup: CodeDeployDeploymentGroup;
228
+ groupId: string;
229
+ };
230
+ /**
231
+ * Create ECS blue/green deployment
232
+ */
233
+ readonly ecsBlueGreenDeployment: (slug: string, environment: EnvironmentType, serviceRoleArn: string, targetGroupName: string) => {
234
+ application: CodeDeployApplication;
235
+ appId: string;
236
+ deploymentGroup: CodeDeployDeploymentGroup;
237
+ groupId: string;
238
+ };
239
+ };
240
+ /**
241
+ * Deployment strategy helpers
242
+ */
243
+ static readonly Strategies: {
244
+ /**
245
+ * Rolling deployment strategy
246
+ */
247
+ readonly rolling: (batchPercentage?: number) => DeploymentStrategyOptions;
248
+ /**
249
+ * Blue-green deployment strategy
250
+ */
251
+ readonly blueGreen: () => DeploymentStrategyOptions;
252
+ /**
253
+ * Canary deployment strategy
254
+ */
255
+ readonly canary: (canaryPercentage?: number, canaryInterval?: number) => DeploymentStrategyOptions;
256
+ /**
257
+ * All at once deployment strategy
258
+ */
259
+ readonly allAtOnce: () => DeploymentStrategyOptions;
260
+ };
261
+ }
262
+ /**
263
+ * Asset Hashing Utilities
264
+ * Provides content-based hashing for cache invalidation
265
+ */
266
+ export declare class AssetHasher {
267
+ /**
268
+ * Common content types by file extension
269
+ */
270
+ static readonly ContentTypes: Record<string, string>;
271
+ /**
272
+ * Files that should NOT be hashed (typically entry points)
273
+ */
274
+ static readonly NoHashPatterns: RegExp[];
275
+ /**
276
+ * Compute hash for a file's contents
277
+ */
278
+ static computeFileHash(filePath: string, algorithm?: 'md5' | 'sha256' | 'sha1'): string;
279
+ /**
280
+ * Compute short hash (first 8 characters)
281
+ */
282
+ static computeShortHash(filePath: string): string;
283
+ /**
284
+ * Get content type for a file
285
+ */
286
+ static getContentType(filePath: string): string;
287
+ /**
288
+ * Check if a file should be hashed
289
+ */
290
+ static shouldHashFile(relativePath: string, customNoHashPatterns?: RegExp[]): boolean;
291
+ /**
292
+ * Generate a hashed filename
293
+ * e.g., "styles.css" -> "styles.a1b2c3d4.css"
294
+ */
295
+ static generateHashedFilename(filePath: string, hash: string): string;
296
+ /**
297
+ * Collect all files in a directory recursively
298
+ */
299
+ static collectFiles(directory: string, relativeTo?: string): string[];
300
+ /**
301
+ * Hash all assets in a directory
302
+ */
303
+ static hashDirectory(options: {
304
+ sourceDir: string;
305
+ outputDir?: string;
306
+ excludePatterns?: RegExp[];
307
+ hashAlgorithm?: 'md5' | 'sha256' | 'sha1';
308
+ copyUnhashed?: boolean;
309
+ }): AssetManifest;
310
+ /**
311
+ * Get paths that need CloudFront invalidation
312
+ * Compares old and new manifests to find changed files
313
+ */
314
+ static getInvalidationPaths(oldManifest: AssetManifest | null, newManifest: AssetManifest): string[];
315
+ /**
316
+ * Update HTML files to reference hashed assets
317
+ */
318
+ static updateHtmlReferences(options: {
319
+ htmlDir: string;
320
+ manifest: AssetManifest;
321
+ basePath?: string;
322
+ }): void;
323
+ /**
324
+ * Update CSS files to reference hashed assets
325
+ */
326
+ static updateCssReferences(options: {
327
+ cssDir: string;
328
+ manifest: AssetManifest;
329
+ basePath?: string;
330
+ }): void;
331
+ /**
332
+ * Escape special regex characters
333
+ */
334
+ private static escapeRegExp;
335
+ /**
336
+ * Generate a deployment manifest for S3
337
+ */
338
+ static generateS3DeploymentManifest(options: {
339
+ sourceDir: string;
340
+ bucketName: string;
341
+ keyPrefix?: string;
342
+ excludePatterns?: RegExp[];
343
+ cacheControl?: {
344
+ hashed?: string;
345
+ unhashed?: string;
346
+ html?: string;
347
+ };
348
+ }): Array<{
349
+ localPath: string;
350
+ s3Key: string;
351
+ contentType: string;
352
+ cacheControl: string;
353
+ hash: string;
354
+ }>;
355
+ /**
356
+ * Compare two asset manifests to detect changes
357
+ */
358
+ static compareManifests(oldManifest: AssetManifest, newManifest: AssetManifest): {
359
+ added: string[];
360
+ removed: string[];
361
+ changed: string[];
362
+ unchanged: string[];
363
+ };
364
+ /**
365
+ * Load an existing asset manifest from a file
366
+ */
367
+ static loadManifest(manifestPath: string): AssetManifest | null;
368
+ /**
369
+ * Save an asset manifest to a file
370
+ */
371
+ static saveManifest(manifest: AssetManifest, manifestPath: string): void;
372
+ }
@@ -0,0 +1,143 @@
1
+ import type { Route53HostedZone, Route53RecordSet } from '@ts-cloud/aws-types';
2
+ import type { EnvironmentType } from '../types';
3
+ export interface HostedZoneOptions {
4
+ domain: string;
5
+ slug: string;
6
+ environment: EnvironmentType;
7
+ comment?: string;
8
+ }
9
+ export interface RecordOptions {
10
+ hostedZoneId?: string;
11
+ hostedZoneName?: string;
12
+ name: string;
13
+ type: 'A' | 'AAAA' | 'CNAME' | 'MX' | 'NS' | 'PTR' | 'SOA' | 'SPF' | 'SRV' | 'TXT';
14
+ ttl?: number;
15
+ values?: string[];
16
+ aliasTarget?: AliasTarget;
17
+ }
18
+ export interface AliasTarget {
19
+ dnsName: string;
20
+ hostedZoneId: string;
21
+ evaluateTargetHealth?: boolean;
22
+ }
23
+ /**
24
+ * DNS Module - Route53 Management
25
+ * Provides clean API for creating and configuring Route53 resources
26
+ */
27
+ export declare class DNS {
28
+ /**
29
+ * Create a Route53 hosted zone
30
+ */
31
+ static createHostedZone(options: HostedZoneOptions): {
32
+ zone: Route53HostedZone;
33
+ logicalId: string;
34
+ };
35
+ /**
36
+ * Create a DNS record
37
+ */
38
+ static createRecord(options: RecordOptions): {
39
+ record: Route53RecordSet;
40
+ logicalId: string;
41
+ };
42
+ /**
43
+ * Create an A record that points to a CloudFront distribution
44
+ */
45
+ static createCloudFrontAlias(domain: string, distributionDomainName: string, hostedZoneId: string): {
46
+ record: Route53RecordSet;
47
+ logicalId: string;
48
+ };
49
+ /**
50
+ * Create an A record that points to an Application Load Balancer
51
+ */
52
+ static createAlbAlias(domain: string, albDomainName: string, albHostedZoneId: string, hostedZoneId: string): {
53
+ record: Route53RecordSet;
54
+ logicalId: string;
55
+ };
56
+ /**
57
+ * Create a CNAME record
58
+ */
59
+ static createCname(name: string, target: string, hostedZoneId: string, ttl?: number): {
60
+ record: Route53RecordSet;
61
+ logicalId: string;
62
+ };
63
+ /**
64
+ * Create www → non-www redirect using S3 and Route53
65
+ */
66
+ static createWwwRedirect(domain: string, hostedZoneId: string): {
67
+ record: Route53RecordSet;
68
+ logicalId: string;
69
+ };
70
+ /**
71
+ * Create MX records for email
72
+ */
73
+ static createMxRecords(domain: string, mailServers: Array<{
74
+ priority: number;
75
+ server: string;
76
+ }>, hostedZoneId: string, ttl?: number): {
77
+ record: Route53RecordSet;
78
+ logicalId: string;
79
+ };
80
+ /**
81
+ * Create TXT record (useful for domain verification, SPF, DKIM, etc.)
82
+ */
83
+ static createTxtRecord(name: string, value: string, hostedZoneId: string, ttl?: number): {
84
+ record: Route53RecordSet;
85
+ logicalId: string;
86
+ };
87
+ /**
88
+ * Create SPF record for email sending
89
+ */
90
+ static createSpfRecord(domain: string, spfValue: string, hostedZoneId: string): {
91
+ record: Route53RecordSet;
92
+ logicalId: string;
93
+ };
94
+ /**
95
+ * Create DMARC record for email authentication
96
+ */
97
+ static createDmarcRecord(domain: string, policy: 'none' | 'quarantine' | 'reject', email: string, hostedZoneId: string): {
98
+ record: Route53RecordSet;
99
+ logicalId: string;
100
+ };
101
+ /**
102
+ * Create an A record pointing to an S3 website redirect bucket
103
+ * Used for www to non-www redirect (or vice versa)
104
+ */
105
+ static createS3WebsiteAlias(domain: string, s3WebsiteEndpoint: string, s3HostedZoneId: string, hostedZoneId: string): {
106
+ record: Route53RecordSet;
107
+ logicalId: string;
108
+ };
109
+ /**
110
+ * S3 Website Hosted Zone IDs by region
111
+ * These are required for alias records pointing to S3 website endpoints
112
+ */
113
+ static readonly S3WebsiteHostedZoneIds: Record<string, string>;
114
+ /**
115
+ * Get S3 website endpoint for a bucket in a specific region
116
+ */
117
+ static getS3WebsiteEndpoint(bucketName: string, region: string): string;
118
+ /**
119
+ * Create a store subdomain record (e.g., for Lemon Squeezy integration)
120
+ */
121
+ static createStoreRecord(domain: string, storeUrl: string, hostedZoneId: string): {
122
+ record: Route53RecordSet;
123
+ logicalId: string;
124
+ };
125
+ /**
126
+ * Create API subdomain record
127
+ */
128
+ static createApiRecord(domain: string, apiUrl: string, hostedZoneId: string): {
129
+ record: Route53RecordSet;
130
+ logicalId: string;
131
+ };
132
+ /**
133
+ * Create docs subdomain record
134
+ */
135
+ static createDocsRecord(domain: string, docsUrl: string, hostedZoneId: string): {
136
+ record: Route53RecordSet;
137
+ logicalId: string;
138
+ };
139
+ /**
140
+ * CloudFront Hosted Zone ID (constant for all CloudFront distributions)
141
+ */
142
+ static readonly CloudFrontHostedZoneId = "Z2FDTNDATAQYW2";
143
+ }