@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.
- 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,68 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface LoadBalancerConfig {
|
|
3
|
+
type: 'application' | 'network';
|
|
4
|
+
healthCheck?: {
|
|
5
|
+
path?: string;
|
|
6
|
+
interval?: number;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
healthyThreshold?: number;
|
|
9
|
+
unhealthyThreshold?: number;
|
|
10
|
+
};
|
|
11
|
+
stickySession?: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
duration?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ServerConfig {
|
|
17
|
+
instanceType: string;
|
|
18
|
+
ami?: string;
|
|
19
|
+
autoScaling?: {
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
targetCPU?: number;
|
|
23
|
+
scaleUpCooldown?: number;
|
|
24
|
+
scaleDownCooldown?: number;
|
|
25
|
+
};
|
|
26
|
+
loadBalancer?: LoadBalancerConfig;
|
|
27
|
+
userData?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ComputeConfig {
|
|
30
|
+
server?: ServerConfig;
|
|
31
|
+
fargate?: {
|
|
32
|
+
taskDefinition: {
|
|
33
|
+
cpu: string;
|
|
34
|
+
memory: string;
|
|
35
|
+
containerDefinitions?: Array<{
|
|
36
|
+
name: string;
|
|
37
|
+
image: string;
|
|
38
|
+
portMappings?: Array<{
|
|
39
|
+
containerPort: number;
|
|
40
|
+
}>;
|
|
41
|
+
environment?: Record<string, string>;
|
|
42
|
+
healthCheck?: any;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
service: {
|
|
46
|
+
desiredCount: number;
|
|
47
|
+
serviceDiscovery?: {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
namespace?: string;
|
|
50
|
+
};
|
|
51
|
+
autoScaling?: {
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
targetCPU?: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
services?: Array<{
|
|
59
|
+
name: string;
|
|
60
|
+
type: 'fargate' | 'ec2';
|
|
61
|
+
taskDefinition: any;
|
|
62
|
+
service: any;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Add compute resources (EC2, ECS, ALB) to CloudFormation template
|
|
67
|
+
*/
|
|
68
|
+
export declare function addComputeResources(builder: CloudFormationBuilder, config: ComputeConfig): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface DatabaseConfig {
|
|
3
|
+
postgres?: {
|
|
4
|
+
engine: 'postgres';
|
|
5
|
+
version: string;
|
|
6
|
+
instanceClass: string;
|
|
7
|
+
allocatedStorage: number;
|
|
8
|
+
maxAllocatedStorage?: number;
|
|
9
|
+
multiAZ?: boolean;
|
|
10
|
+
backupRetentionDays?: number;
|
|
11
|
+
preferredBackupWindow?: string;
|
|
12
|
+
preferredMaintenanceWindow?: string;
|
|
13
|
+
enablePerformanceInsights?: boolean;
|
|
14
|
+
performanceInsightsRetention?: number;
|
|
15
|
+
deletionProtection?: boolean;
|
|
16
|
+
parameters?: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
mysql?: {
|
|
19
|
+
engine: 'mysql';
|
|
20
|
+
version: string;
|
|
21
|
+
instanceClass: string;
|
|
22
|
+
allocatedStorage: number;
|
|
23
|
+
maxAllocatedStorage?: number;
|
|
24
|
+
multiAZ?: boolean;
|
|
25
|
+
backupRetentionDays?: number;
|
|
26
|
+
preferredBackupWindow?: string;
|
|
27
|
+
preferredMaintenanceWindow?: string;
|
|
28
|
+
enablePerformanceInsights?: boolean;
|
|
29
|
+
performanceInsightsRetention?: number;
|
|
30
|
+
deletionProtection?: boolean;
|
|
31
|
+
parameters?: Record<string, string>;
|
|
32
|
+
};
|
|
33
|
+
dynamodb?: {
|
|
34
|
+
tables: DynamoDBTableConfig[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface DynamoDBTableConfig {
|
|
38
|
+
name: string;
|
|
39
|
+
partitionKey: string;
|
|
40
|
+
sortKey?: string;
|
|
41
|
+
billingMode?: 'PROVISIONED' | 'PAY_PER_REQUEST';
|
|
42
|
+
readCapacity?: number;
|
|
43
|
+
writeCapacity?: number;
|
|
44
|
+
streamEnabled?: boolean;
|
|
45
|
+
pointInTimeRecovery?: boolean;
|
|
46
|
+
ttl?: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
attributeName: string;
|
|
49
|
+
};
|
|
50
|
+
globalSecondaryIndexes?: Array<{
|
|
51
|
+
name: string;
|
|
52
|
+
partitionKey: string;
|
|
53
|
+
sortKey?: string;
|
|
54
|
+
projectionType?: 'ALL' | 'KEYS_ONLY' | 'INCLUDE';
|
|
55
|
+
nonKeyAttributes?: string[];
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Add database resources (RDS, DynamoDB) to CloudFormation template
|
|
60
|
+
*/
|
|
61
|
+
export declare function addDatabaseResources(builder: CloudFormationBuilder, config: DatabaseConfig): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface FunctionEvent {
|
|
3
|
+
type: 'http' | 's3' | 'sqs' | 'sns' | 'kinesis' | 'dynamodb-stream' | 'schedule';
|
|
4
|
+
path?: string;
|
|
5
|
+
method?: string;
|
|
6
|
+
bucket?: string;
|
|
7
|
+
filterPrefix?: string;
|
|
8
|
+
filterSuffix?: string;
|
|
9
|
+
queueName?: string;
|
|
10
|
+
streamName?: string;
|
|
11
|
+
tableName?: string;
|
|
12
|
+
batchSize?: number;
|
|
13
|
+
startingPosition?: 'LATEST' | 'TRIM_HORIZON';
|
|
14
|
+
parallelizationFactor?: number;
|
|
15
|
+
expression?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FunctionItem {
|
|
18
|
+
name: string;
|
|
19
|
+
runtime: string;
|
|
20
|
+
handler: string;
|
|
21
|
+
memory: number;
|
|
22
|
+
timeout: number;
|
|
23
|
+
events?: FunctionEvent[];
|
|
24
|
+
environment?: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
export interface FunctionsConfig {
|
|
27
|
+
[category: string]: FunctionItem[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Add Lambda function resources to CloudFormation template
|
|
31
|
+
*/
|
|
32
|
+
export declare function addFunctionResources(builder: CloudFormationBuilder, config: FunctionsConfig): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface TopicConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
subscriptions?: Array<{
|
|
6
|
+
protocol: 'http' | 'https' | 'email' | 'email-json' | 'sms' | 'sqs' | 'lambda';
|
|
7
|
+
endpoint: string;
|
|
8
|
+
filterPolicy?: Record<string, any>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface MessagingConfig {
|
|
12
|
+
topics?: TopicConfig[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Add SNS topic resources to CloudFormation template
|
|
16
|
+
*/
|
|
17
|
+
export declare function addMessagingResources(builder: CloudFormationBuilder, config: MessagingConfig): void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface AlarmConfig {
|
|
3
|
+
name?: string;
|
|
4
|
+
metric: string;
|
|
5
|
+
threshold: number;
|
|
6
|
+
evaluationPeriods?: number;
|
|
7
|
+
comparisonOperator?: 'GreaterThanThreshold' | 'LessThanThreshold' | 'GreaterThanOrEqualToThreshold' | 'LessThanOrEqualToThreshold';
|
|
8
|
+
statistic?: 'Average' | 'Sum' | 'Minimum' | 'Maximum' | 'SampleCount';
|
|
9
|
+
period?: number;
|
|
10
|
+
treatMissingData?: 'breaching' | 'notBreaching' | 'ignore' | 'missing';
|
|
11
|
+
service?: string;
|
|
12
|
+
namespace?: string;
|
|
13
|
+
dimensions?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface MonitoringConfig {
|
|
16
|
+
dashboard?: {
|
|
17
|
+
name: string;
|
|
18
|
+
widgets?: Array<{
|
|
19
|
+
type: 'metric' | 'log' | 'text';
|
|
20
|
+
metrics?: string[] | Array<{
|
|
21
|
+
service?: string;
|
|
22
|
+
metric: string;
|
|
23
|
+
}>;
|
|
24
|
+
logGroup?: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
alarms?: AlarmConfig[];
|
|
31
|
+
logs?: {
|
|
32
|
+
retention?: number;
|
|
33
|
+
groups?: string[];
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Add CloudWatch monitoring resources to CloudFormation template
|
|
38
|
+
*/
|
|
39
|
+
export declare function addMonitoringResources(builder: CloudFormationBuilder, config: MonitoringConfig): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface NetworkConfig {
|
|
3
|
+
vpc?: {
|
|
4
|
+
cidr?: string;
|
|
5
|
+
availabilityZones?: number;
|
|
6
|
+
natGateways?: number;
|
|
7
|
+
enableDnsHostnames?: boolean;
|
|
8
|
+
enableDnsSupport?: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Add VPC and networking resources to CloudFormation template
|
|
13
|
+
*/
|
|
14
|
+
export declare function addNetworkResources(builder: CloudFormationBuilder, config: NetworkConfig): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface QueueConfig {
|
|
3
|
+
[queueName: string]: {
|
|
4
|
+
fifo?: boolean;
|
|
5
|
+
visibilityTimeout?: number;
|
|
6
|
+
messageRetentionPeriod?: number;
|
|
7
|
+
receiveMessageWaitTime?: number;
|
|
8
|
+
deadLetterQueue?: boolean;
|
|
9
|
+
maxReceiveCount?: number;
|
|
10
|
+
contentBasedDeduplication?: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Add SQS queue resources to CloudFormation template
|
|
15
|
+
*/
|
|
16
|
+
export declare function addQueueResources(builder: CloudFormationBuilder, config: QueueConfig): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface SecurityConfig {
|
|
3
|
+
certificate?: {
|
|
4
|
+
domain: string;
|
|
5
|
+
subdomains?: string[];
|
|
6
|
+
validationMethod?: 'DNS' | 'EMAIL';
|
|
7
|
+
};
|
|
8
|
+
waf?: {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
rules?: string[];
|
|
11
|
+
rateLimit?: number;
|
|
12
|
+
scope?: 'REGIONAL' | 'CLOUDFRONT';
|
|
13
|
+
};
|
|
14
|
+
securityGroups?: Record<string, {
|
|
15
|
+
ingress?: Array<{
|
|
16
|
+
port: number;
|
|
17
|
+
protocol: string;
|
|
18
|
+
cidr?: string;
|
|
19
|
+
source?: string;
|
|
20
|
+
}>;
|
|
21
|
+
egress?: Array<{
|
|
22
|
+
port: number;
|
|
23
|
+
protocol: string;
|
|
24
|
+
cidr?: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Add security resources (ACM certificates, WAF, security groups) to CloudFormation template
|
|
30
|
+
*/
|
|
31
|
+
export declare function addSecurityResources(builder: CloudFormationBuilder, config: SecurityConfig): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CloudFormationBuilder } from '../builder';
|
|
2
|
+
export interface StorageConfig {
|
|
3
|
+
[bucketName: string]: {
|
|
4
|
+
public?: boolean;
|
|
5
|
+
versioning?: boolean;
|
|
6
|
+
website?: boolean;
|
|
7
|
+
encryption?: boolean;
|
|
8
|
+
intelligentTiering?: boolean;
|
|
9
|
+
cors?: Array<{
|
|
10
|
+
allowedOrigins: string[];
|
|
11
|
+
allowedMethods: string[];
|
|
12
|
+
allowedHeaders?: string[];
|
|
13
|
+
maxAge?: number;
|
|
14
|
+
}>;
|
|
15
|
+
lifecycleRules?: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
expirationDays?: number;
|
|
19
|
+
transitions?: Array<{
|
|
20
|
+
days: number;
|
|
21
|
+
storageClass: 'STANDARD_IA' | 'ONEZONE_IA' | 'INTELLIGENT_TIERING' | 'GLACIER' | 'DEEP_ARCHIVE';
|
|
22
|
+
}>;
|
|
23
|
+
}>;
|
|
24
|
+
type?: 'efs';
|
|
25
|
+
performanceMode?: 'generalPurpose' | 'maxIO';
|
|
26
|
+
throughputMode?: 'bursting' | 'provisioned';
|
|
27
|
+
lifecyclePolicy?: {
|
|
28
|
+
transitionToIA?: number;
|
|
29
|
+
transitionToPrimaryStorageClass?: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Add S3 and EFS storage resources to CloudFormation template
|
|
35
|
+
*/
|
|
36
|
+
export declare function addStorageResources(builder: CloudFormationBuilder, config: StorageConfig): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CloudFormationBuilder, buildCloudFormationTemplate, } from './builder';
|
|
2
|
+
export type { CloudFormationTemplate, CloudFormationResource, CloudFormationParameter, CloudFormationOutput, CloudFormationCondition, CloudFormationIntrinsicFunction, } from './types';
|
|
3
|
+
export { Fn, Arn, AWS_PSEUDO_PARAMETERS, } from './types';
|
|
4
|
+
export { addNetworkResources } from './builders/network';
|
|
5
|
+
export { addStorageResources } from './builders/storage';
|
|
6
|
+
export { addComputeResources } from './builders/compute';
|
|
7
|
+
export { addDatabaseResources } from './builders/database';
|
|
8
|
+
export { addFunctionResources } from './builders/functions';
|
|
9
|
+
export { addQueueResources } from './builders/queue';
|
|
10
|
+
export type { QueueConfig } from './builders/queue';
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CloudFormation Template Types
|
|
3
|
+
* Based on AWS CloudFormation Resource Specification
|
|
4
|
+
*/
|
|
5
|
+
export interface CloudFormationTemplate {
|
|
6
|
+
AWSTemplateFormatVersion: '2010-09-09';
|
|
7
|
+
Description?: string;
|
|
8
|
+
Metadata?: Record<string, any>;
|
|
9
|
+
Parameters?: Record<string, CloudFormationParameter>;
|
|
10
|
+
Mappings?: Record<string, Record<string, Record<string, string>>>;
|
|
11
|
+
Conditions?: Record<string, CloudFormationCondition>;
|
|
12
|
+
Resources: Record<string, CloudFormationResource>;
|
|
13
|
+
Outputs?: Record<string, CloudFormationOutput>;
|
|
14
|
+
}
|
|
15
|
+
export interface CloudFormationParameter {
|
|
16
|
+
Type: 'String' | 'Number' | 'List<Number>' | 'CommaDelimitedList' | 'AWS::EC2::AvailabilityZone::Name' | 'AWS::EC2::Image::Id' | 'AWS::EC2::Instance::Id' | 'AWS::EC2::KeyPair::KeyName' | 'AWS::EC2::SecurityGroup::GroupName' | 'AWS::EC2::SecurityGroup::Id' | 'AWS::EC2::Subnet::Id' | 'AWS::EC2::Volume::Id' | 'AWS::EC2::VPC::Id' | 'AWS::Route53::HostedZone::Id' | 'List<AWS::EC2::AvailabilityZone::Name>' | 'List<AWS::EC2::Image::Id>' | 'List<AWS::EC2::Instance::Id>' | 'List<AWS::EC2::SecurityGroup::GroupName>' | 'List<AWS::EC2::SecurityGroup::Id>' | 'List<AWS::EC2::Subnet::Id>' | 'List<AWS::EC2::Volume::Id>' | 'List<AWS::EC2::VPC::Id>' | 'List<AWS::Route53::HostedZone::Id>';
|
|
17
|
+
Default?: string | number;
|
|
18
|
+
Description?: string;
|
|
19
|
+
AllowedValues?: string[];
|
|
20
|
+
AllowedPattern?: string;
|
|
21
|
+
MinLength?: number;
|
|
22
|
+
MaxLength?: number;
|
|
23
|
+
MinValue?: number;
|
|
24
|
+
MaxValue?: number;
|
|
25
|
+
ConstraintDescription?: string;
|
|
26
|
+
NoEcho?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CloudFormationResource {
|
|
29
|
+
Type: string;
|
|
30
|
+
Properties?: Record<string, any>;
|
|
31
|
+
DependsOn?: string | string[];
|
|
32
|
+
Condition?: string;
|
|
33
|
+
Metadata?: Record<string, any>;
|
|
34
|
+
CreationPolicy?: Record<string, any>;
|
|
35
|
+
UpdatePolicy?: Record<string, any>;
|
|
36
|
+
DeletionPolicy?: 'Delete' | 'Retain' | 'Snapshot';
|
|
37
|
+
UpdateReplacePolicy?: 'Delete' | 'Retain' | 'Snapshot';
|
|
38
|
+
}
|
|
39
|
+
export interface CloudFormationOutput {
|
|
40
|
+
Value: any;
|
|
41
|
+
Description?: string;
|
|
42
|
+
Export?: {
|
|
43
|
+
Name: any;
|
|
44
|
+
};
|
|
45
|
+
Condition?: string;
|
|
46
|
+
}
|
|
47
|
+
export type CloudFormationCondition = CloudFormationIntrinsicFunction | boolean;
|
|
48
|
+
/**
|
|
49
|
+
* CloudFormation Intrinsic Functions
|
|
50
|
+
*/
|
|
51
|
+
export type CloudFormationIntrinsicFunction = {
|
|
52
|
+
Ref: string;
|
|
53
|
+
} | {
|
|
54
|
+
'Fn::GetAtt': [string, string];
|
|
55
|
+
} | {
|
|
56
|
+
'Fn::Join': [string, any[]];
|
|
57
|
+
} | {
|
|
58
|
+
'Fn::Sub': string | [string, Record<string, any>];
|
|
59
|
+
} | {
|
|
60
|
+
'Fn::Select': [number, any[] | CloudFormationIntrinsicFunction];
|
|
61
|
+
} | {
|
|
62
|
+
'Fn::Split': [string, string];
|
|
63
|
+
} | {
|
|
64
|
+
'Fn::GetAZs': string;
|
|
65
|
+
} | {
|
|
66
|
+
'Fn::ImportValue': any;
|
|
67
|
+
} | {
|
|
68
|
+
'Fn::FindInMap': [string, any, any];
|
|
69
|
+
} | {
|
|
70
|
+
'Fn::Base64': any;
|
|
71
|
+
} | {
|
|
72
|
+
'Fn::Cidr': [any, number, number];
|
|
73
|
+
} | {
|
|
74
|
+
'Fn::Equals': [any, any];
|
|
75
|
+
} | {
|
|
76
|
+
'Fn::If': [string, any, any];
|
|
77
|
+
} | {
|
|
78
|
+
'Fn::Not': [any];
|
|
79
|
+
} | {
|
|
80
|
+
'Fn::And': any[];
|
|
81
|
+
} | {
|
|
82
|
+
'Fn::Or': any[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Helper functions for creating CloudFormation intrinsic functions
|
|
86
|
+
*/
|
|
87
|
+
export declare const Fn: {
|
|
88
|
+
ref: (logicalId: string) => {
|
|
89
|
+
Ref: string;
|
|
90
|
+
};
|
|
91
|
+
getAtt: (logicalId: string, attribute: string) => {
|
|
92
|
+
"Fn::GetAtt": [string, string];
|
|
93
|
+
};
|
|
94
|
+
join: (delimiter: string, values: any[]) => {
|
|
95
|
+
"Fn::Join": [string, any[]];
|
|
96
|
+
};
|
|
97
|
+
sub: (template: string, variables?: Record<string, any>) => {
|
|
98
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
99
|
+
};
|
|
100
|
+
select: (index: number, list: any[] | CloudFormationIntrinsicFunction) => {
|
|
101
|
+
"Fn::Select": [number, any[] | CloudFormationIntrinsicFunction];
|
|
102
|
+
};
|
|
103
|
+
split: (delimiter: string, source: string) => {
|
|
104
|
+
"Fn::Split": [string, string];
|
|
105
|
+
};
|
|
106
|
+
getAZs: (region?: string) => {
|
|
107
|
+
"Fn::GetAZs": string;
|
|
108
|
+
};
|
|
109
|
+
importValue: (name: any) => {
|
|
110
|
+
"Fn::ImportValue": any;
|
|
111
|
+
};
|
|
112
|
+
findInMap: (mapName: string, topLevelKey: any, secondLevelKey: any) => {
|
|
113
|
+
"Fn::FindInMap": [string, any, any];
|
|
114
|
+
};
|
|
115
|
+
base64: (value: any) => {
|
|
116
|
+
"Fn::Base64": any;
|
|
117
|
+
};
|
|
118
|
+
cidr: (ipBlock: any, count: number, cidrBits: number) => {
|
|
119
|
+
"Fn::Cidr": [any, number, number];
|
|
120
|
+
};
|
|
121
|
+
equals: (value1: any, value2: any) => {
|
|
122
|
+
"Fn::Equals": [any, any];
|
|
123
|
+
};
|
|
124
|
+
if: (conditionName: string, trueValue: any, falseValue: any) => {
|
|
125
|
+
"Fn::If": [string, any, any];
|
|
126
|
+
};
|
|
127
|
+
not: (condition: any) => {
|
|
128
|
+
"Fn::Not": [any];
|
|
129
|
+
};
|
|
130
|
+
and: (...conditions: any[]) => {
|
|
131
|
+
"Fn::And": any[];
|
|
132
|
+
};
|
|
133
|
+
or: (...conditions: any[]) => {
|
|
134
|
+
"Fn::Or": any[];
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Common AWS resource ARN patterns
|
|
139
|
+
*/
|
|
140
|
+
export declare const Arn: {
|
|
141
|
+
s3Bucket: (bucketName: any) => {
|
|
142
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
143
|
+
};
|
|
144
|
+
s3Object: (bucketName: any, key?: string) => {
|
|
145
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
146
|
+
};
|
|
147
|
+
lambda: (functionName: string, region?: string, account?: string) => {
|
|
148
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
149
|
+
};
|
|
150
|
+
dynamodb: (tableName: string) => {
|
|
151
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
152
|
+
};
|
|
153
|
+
sqs: (queueName: string) => {
|
|
154
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
155
|
+
};
|
|
156
|
+
sns: (topicName: string) => {
|
|
157
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
158
|
+
};
|
|
159
|
+
kinesis: (streamName: string) => {
|
|
160
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
161
|
+
};
|
|
162
|
+
iam: (resourceType: "role" | "policy" | "user" | "group", name: string) => {
|
|
163
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
164
|
+
};
|
|
165
|
+
secretsManager: (secretName: string) => {
|
|
166
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
167
|
+
};
|
|
168
|
+
cloudwatch: (logGroup: string) => {
|
|
169
|
+
"Fn::Sub": string | [string, Record<string, any>];
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Common CloudFormation pseudo parameters
|
|
174
|
+
*/
|
|
175
|
+
export declare const AWS_PSEUDO_PARAMETERS: {
|
|
176
|
+
ACCOUNT_ID: {
|
|
177
|
+
Ref: string;
|
|
178
|
+
};
|
|
179
|
+
NOTIFICATION_ARNS: {
|
|
180
|
+
Ref: string;
|
|
181
|
+
};
|
|
182
|
+
NO_VALUE: {
|
|
183
|
+
Ref: string;
|
|
184
|
+
};
|
|
185
|
+
PARTITION: {
|
|
186
|
+
Ref: string;
|
|
187
|
+
};
|
|
188
|
+
REGION: {
|
|
189
|
+
Ref: string;
|
|
190
|
+
};
|
|
191
|
+
STACK_ID: {
|
|
192
|
+
Ref: string;
|
|
193
|
+
};
|
|
194
|
+
STACK_NAME: {
|
|
195
|
+
Ref: string;
|
|
196
|
+
};
|
|
197
|
+
URL_SUFFIX: {
|
|
198
|
+
Ref: string;
|
|
199
|
+
};
|
|
200
|
+
};
|