@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.
- 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,288 @@
|
|
|
1
|
+
import type { StepFunctionsStateMachine, IAMRole } from '@ts-cloud/aws-types';
|
|
2
|
+
import type { EnvironmentType } from '../types';
|
|
3
|
+
export interface StateMachineOptions {
|
|
4
|
+
slug: string;
|
|
5
|
+
environment: EnvironmentType;
|
|
6
|
+
stateMachineName?: string;
|
|
7
|
+
type?: 'STANDARD' | 'EXPRESS';
|
|
8
|
+
definition: StateMachineDefinition;
|
|
9
|
+
roleArn?: string;
|
|
10
|
+
loggingConfiguration?: {
|
|
11
|
+
level: 'ALL' | 'ERROR' | 'FATAL' | 'OFF';
|
|
12
|
+
includeExecutionData?: boolean;
|
|
13
|
+
destinations?: string[];
|
|
14
|
+
};
|
|
15
|
+
tracingConfiguration?: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface StateMachineDefinition {
|
|
20
|
+
Comment?: string;
|
|
21
|
+
StartAt: string;
|
|
22
|
+
States: Record<string, State>;
|
|
23
|
+
TimeoutSeconds?: number;
|
|
24
|
+
Version?: string;
|
|
25
|
+
}
|
|
26
|
+
export type State = TaskState | PassState | WaitState | ChoiceState | ParallelState | MapState | SucceedState | FailState;
|
|
27
|
+
export interface BaseState {
|
|
28
|
+
Type: 'Task' | 'Pass' | 'Wait' | 'Choice' | 'Parallel' | 'Map' | 'Succeed' | 'Fail';
|
|
29
|
+
Comment?: string;
|
|
30
|
+
End?: boolean;
|
|
31
|
+
Next?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TaskState extends BaseState {
|
|
34
|
+
Type: 'Task';
|
|
35
|
+
Resource: string;
|
|
36
|
+
Parameters?: Record<string, unknown>;
|
|
37
|
+
ResultPath?: string | null;
|
|
38
|
+
OutputPath?: string;
|
|
39
|
+
InputPath?: string;
|
|
40
|
+
TimeoutSeconds?: number;
|
|
41
|
+
HeartbeatSeconds?: number;
|
|
42
|
+
Retry?: RetryConfig[];
|
|
43
|
+
Catch?: CatchConfig[];
|
|
44
|
+
}
|
|
45
|
+
export interface PassState extends BaseState {
|
|
46
|
+
Type: 'Pass';
|
|
47
|
+
Result?: unknown;
|
|
48
|
+
ResultPath?: string | null;
|
|
49
|
+
Parameters?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface WaitState extends BaseState {
|
|
52
|
+
Type: 'Wait';
|
|
53
|
+
Seconds?: number;
|
|
54
|
+
Timestamp?: string;
|
|
55
|
+
SecondsPath?: string;
|
|
56
|
+
TimestampPath?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ChoiceState extends BaseState {
|
|
59
|
+
Type: 'Choice';
|
|
60
|
+
Choices: ChoiceRule[];
|
|
61
|
+
Default?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ChoiceRule {
|
|
64
|
+
Variable: string;
|
|
65
|
+
StringEquals?: string;
|
|
66
|
+
StringLessThan?: string;
|
|
67
|
+
StringGreaterThan?: string;
|
|
68
|
+
NumericEquals?: number;
|
|
69
|
+
NumericLessThan?: number;
|
|
70
|
+
NumericGreaterThan?: number;
|
|
71
|
+
BooleanEquals?: boolean;
|
|
72
|
+
TimestampEquals?: string;
|
|
73
|
+
TimestampLessThan?: string;
|
|
74
|
+
TimestampGreaterThan?: string;
|
|
75
|
+
IsPresent?: boolean;
|
|
76
|
+
IsNull?: boolean;
|
|
77
|
+
IsNumeric?: boolean;
|
|
78
|
+
IsString?: boolean;
|
|
79
|
+
IsBoolean?: boolean;
|
|
80
|
+
IsTimestamp?: boolean;
|
|
81
|
+
Next: string;
|
|
82
|
+
And?: ChoiceRule[];
|
|
83
|
+
Or?: ChoiceRule[];
|
|
84
|
+
Not?: ChoiceRule;
|
|
85
|
+
}
|
|
86
|
+
export interface ParallelState extends BaseState {
|
|
87
|
+
Type: 'Parallel';
|
|
88
|
+
Branches: StateMachineDefinition[];
|
|
89
|
+
ResultPath?: string | null;
|
|
90
|
+
Retry?: RetryConfig[];
|
|
91
|
+
Catch?: CatchConfig[];
|
|
92
|
+
}
|
|
93
|
+
export interface MapState extends BaseState {
|
|
94
|
+
Type: 'Map';
|
|
95
|
+
ItemsPath?: string;
|
|
96
|
+
Iterator: StateMachineDefinition;
|
|
97
|
+
MaxConcurrency?: number;
|
|
98
|
+
ResultPath?: string | null;
|
|
99
|
+
Retry?: RetryConfig[];
|
|
100
|
+
Catch?: CatchConfig[];
|
|
101
|
+
}
|
|
102
|
+
export interface SucceedState extends BaseState {
|
|
103
|
+
Type: 'Succeed';
|
|
104
|
+
}
|
|
105
|
+
export interface FailState extends BaseState {
|
|
106
|
+
Type: 'Fail';
|
|
107
|
+
Error?: string;
|
|
108
|
+
Cause?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface RetryConfig {
|
|
111
|
+
ErrorEquals: string[];
|
|
112
|
+
IntervalSeconds?: number;
|
|
113
|
+
MaxAttempts?: number;
|
|
114
|
+
BackoffRate?: number;
|
|
115
|
+
}
|
|
116
|
+
export interface CatchConfig {
|
|
117
|
+
ErrorEquals: string[];
|
|
118
|
+
Next: string;
|
|
119
|
+
ResultPath?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Workflow Module - Step Functions
|
|
123
|
+
* Provides clean API for orchestrating distributed applications and microservices
|
|
124
|
+
*/
|
|
125
|
+
export declare class Workflow {
|
|
126
|
+
/**
|
|
127
|
+
* Create a Step Functions state machine
|
|
128
|
+
*/
|
|
129
|
+
static createStateMachine(options: StateMachineOptions): {
|
|
130
|
+
stateMachine: StepFunctionsStateMachine;
|
|
131
|
+
logicalId: string;
|
|
132
|
+
role?: IAMRole;
|
|
133
|
+
roleLogicalId?: string;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Create a Lambda task state
|
|
137
|
+
*/
|
|
138
|
+
static createLambdaTask(functionArn: string, options?: {
|
|
139
|
+
parameters?: Record<string, unknown>;
|
|
140
|
+
resultPath?: string | null;
|
|
141
|
+
retry?: RetryConfig[];
|
|
142
|
+
catch?: CatchConfig[];
|
|
143
|
+
next?: string;
|
|
144
|
+
end?: boolean;
|
|
145
|
+
}): TaskState;
|
|
146
|
+
/**
|
|
147
|
+
* Create a DynamoDB task state
|
|
148
|
+
*/
|
|
149
|
+
static createDynamoDBTask(action: 'GetItem' | 'PutItem' | 'UpdateItem' | 'DeleteItem', tableName: string, parameters: Record<string, unknown>, options?: {
|
|
150
|
+
resultPath?: string | null;
|
|
151
|
+
retry?: RetryConfig[];
|
|
152
|
+
catch?: CatchConfig[];
|
|
153
|
+
next?: string;
|
|
154
|
+
end?: boolean;
|
|
155
|
+
}): TaskState;
|
|
156
|
+
/**
|
|
157
|
+
* Create an SNS publish task state
|
|
158
|
+
*/
|
|
159
|
+
static createSNSPublishTask(topicArn: string, message: Record<string, unknown>, options?: {
|
|
160
|
+
resultPath?: string | null;
|
|
161
|
+
retry?: RetryConfig[];
|
|
162
|
+
catch?: CatchConfig[];
|
|
163
|
+
next?: string;
|
|
164
|
+
end?: boolean;
|
|
165
|
+
}): TaskState;
|
|
166
|
+
/**
|
|
167
|
+
* Create an SQS send message task state
|
|
168
|
+
*/
|
|
169
|
+
static createSQSSendMessageTask(queueUrl: string, messageBody: Record<string, unknown>, options?: {
|
|
170
|
+
resultPath?: string | null;
|
|
171
|
+
retry?: RetryConfig[];
|
|
172
|
+
catch?: CatchConfig[];
|
|
173
|
+
next?: string;
|
|
174
|
+
end?: boolean;
|
|
175
|
+
}): TaskState;
|
|
176
|
+
/**
|
|
177
|
+
* Create a Pass state
|
|
178
|
+
*/
|
|
179
|
+
static createPassState(options?: {
|
|
180
|
+
result?: unknown;
|
|
181
|
+
resultPath?: string | null;
|
|
182
|
+
parameters?: Record<string, unknown>;
|
|
183
|
+
next?: string;
|
|
184
|
+
end?: boolean;
|
|
185
|
+
}): PassState;
|
|
186
|
+
/**
|
|
187
|
+
* Create a Wait state
|
|
188
|
+
*/
|
|
189
|
+
static createWaitState(options: {
|
|
190
|
+
seconds?: number;
|
|
191
|
+
timestamp?: string;
|
|
192
|
+
secondsPath?: string;
|
|
193
|
+
timestampPath?: string;
|
|
194
|
+
next?: string;
|
|
195
|
+
end?: boolean;
|
|
196
|
+
}): WaitState;
|
|
197
|
+
/**
|
|
198
|
+
* Create a Choice state
|
|
199
|
+
*/
|
|
200
|
+
static createChoiceState(choices: ChoiceRule[], defaultState?: string): ChoiceState;
|
|
201
|
+
/**
|
|
202
|
+
* Create a Parallel state
|
|
203
|
+
*/
|
|
204
|
+
static createParallelState(branches: StateMachineDefinition[], options?: {
|
|
205
|
+
resultPath?: string | null;
|
|
206
|
+
retry?: RetryConfig[];
|
|
207
|
+
catch?: CatchConfig[];
|
|
208
|
+
next?: string;
|
|
209
|
+
end?: boolean;
|
|
210
|
+
}): ParallelState;
|
|
211
|
+
/**
|
|
212
|
+
* Create a Map state
|
|
213
|
+
*/
|
|
214
|
+
static createMapState(iterator: StateMachineDefinition, options?: {
|
|
215
|
+
itemsPath?: string;
|
|
216
|
+
maxConcurrency?: number;
|
|
217
|
+
resultPath?: string | null;
|
|
218
|
+
retry?: RetryConfig[];
|
|
219
|
+
catch?: CatchConfig[];
|
|
220
|
+
next?: string;
|
|
221
|
+
end?: boolean;
|
|
222
|
+
}): MapState;
|
|
223
|
+
/**
|
|
224
|
+
* Create a Succeed state
|
|
225
|
+
*/
|
|
226
|
+
static createSucceedState(): SucceedState;
|
|
227
|
+
/**
|
|
228
|
+
* Create a Fail state
|
|
229
|
+
*/
|
|
230
|
+
static createFailState(error?: string, cause?: string): FailState;
|
|
231
|
+
/**
|
|
232
|
+
* Common retry configurations
|
|
233
|
+
*/
|
|
234
|
+
static readonly RetryPolicies: {
|
|
235
|
+
/**
|
|
236
|
+
* Standard retry with exponential backoff
|
|
237
|
+
*/
|
|
238
|
+
readonly standard: () => RetryConfig;
|
|
239
|
+
/**
|
|
240
|
+
* Aggressive retry for transient errors
|
|
241
|
+
*/
|
|
242
|
+
readonly aggressive: () => RetryConfig;
|
|
243
|
+
/**
|
|
244
|
+
* Custom retry configuration
|
|
245
|
+
*/
|
|
246
|
+
readonly custom: (errorEquals: string[], intervalSeconds: number, maxAttempts: number, backoffRate: number) => RetryConfig;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Common catch configurations
|
|
250
|
+
*/
|
|
251
|
+
static readonly CatchPolicies: {
|
|
252
|
+
/**
|
|
253
|
+
* Catch all errors
|
|
254
|
+
*/
|
|
255
|
+
readonly all: (nextState: string, resultPath?: string) => CatchConfig;
|
|
256
|
+
/**
|
|
257
|
+
* Catch specific errors
|
|
258
|
+
*/
|
|
259
|
+
readonly specific: (errors: string[], nextState: string, resultPath?: string) => CatchConfig;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Common workflow patterns
|
|
263
|
+
*/
|
|
264
|
+
static readonly Patterns: {
|
|
265
|
+
/**
|
|
266
|
+
* Simple sequential workflow
|
|
267
|
+
*/
|
|
268
|
+
readonly sequential: (slug: string, environment: EnvironmentType, tasks: {
|
|
269
|
+
name: string;
|
|
270
|
+
state: State;
|
|
271
|
+
}[]) => StateMachineDefinition;
|
|
272
|
+
/**
|
|
273
|
+
* Fan-out workflow (parallel execution)
|
|
274
|
+
*/
|
|
275
|
+
readonly fanout: (slug: string, environment: EnvironmentType, branches: {
|
|
276
|
+
name: string;
|
|
277
|
+
definition: StateMachineDefinition;
|
|
278
|
+
}[]) => StateMachineDefinition;
|
|
279
|
+
/**
|
|
280
|
+
* Map workflow (process array of items)
|
|
281
|
+
*/
|
|
282
|
+
readonly map: (slug: string, environment: EnvironmentType, itemProcessor: StateMachineDefinition, maxConcurrency?: number) => StateMachineDefinition;
|
|
283
|
+
/**
|
|
284
|
+
* Error handling workflow
|
|
285
|
+
*/
|
|
286
|
+
readonly withErrorHandling: (slug: string, environment: EnvironmentType, mainTask: TaskState, errorHandler: State) => StateMachineDefinition;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Account Configuration
|
|
3
|
+
* Best practices and configuration for multi-account setups
|
|
4
|
+
*/
|
|
5
|
+
import type { AWSAccount, CrossAccountRole } from './manager';
|
|
6
|
+
/**
|
|
7
|
+
* Account structure presets
|
|
8
|
+
*/
|
|
9
|
+
export interface AccountStructure {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
accounts: AccountStructureDefinition[];
|
|
13
|
+
organizationalUnits?: OUDefinition[];
|
|
14
|
+
}
|
|
15
|
+
export interface AccountStructureDefinition {
|
|
16
|
+
alias: string;
|
|
17
|
+
email: string;
|
|
18
|
+
role: AWSAccount['role'];
|
|
19
|
+
ou?: string;
|
|
20
|
+
description: string;
|
|
21
|
+
}
|
|
22
|
+
export interface OUDefinition {
|
|
23
|
+
name: string;
|
|
24
|
+
parent?: string;
|
|
25
|
+
policies?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* AWS best practices: Multi-account structure
|
|
29
|
+
* Based on AWS Well-Architected Framework
|
|
30
|
+
*/
|
|
31
|
+
export declare const RECOMMENDED_ACCOUNT_STRUCTURES: Record<string, AccountStructure>;
|
|
32
|
+
/**
|
|
33
|
+
* Service Control Policies (SCPs) - AWS best practices
|
|
34
|
+
*/
|
|
35
|
+
export declare const RECOMMENDED_SCPS: {
|
|
36
|
+
denyRootAccess: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
policyDocument: {
|
|
40
|
+
Version: string;
|
|
41
|
+
Statement: readonly [{
|
|
42
|
+
readonly Sid: "DenyRootUser";
|
|
43
|
+
readonly Effect: "Deny";
|
|
44
|
+
readonly Action: "*";
|
|
45
|
+
readonly Resource: "*";
|
|
46
|
+
readonly Condition: {
|
|
47
|
+
readonly StringLike: {
|
|
48
|
+
readonly 'aws:PrincipalArn': "arn:aws:iam::*:root";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
requireMFA: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
policyDocument: {
|
|
58
|
+
Version: string;
|
|
59
|
+
Statement: readonly [{
|
|
60
|
+
readonly Sid: "RequireMFA";
|
|
61
|
+
readonly Effect: "Deny";
|
|
62
|
+
readonly Action: "*";
|
|
63
|
+
readonly Resource: "*";
|
|
64
|
+
readonly Condition: {
|
|
65
|
+
readonly BoolIfExists: {
|
|
66
|
+
readonly 'aws:MultiFactorAuthPresent': "false";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
denyRegions: {
|
|
73
|
+
name: string;
|
|
74
|
+
description: string;
|
|
75
|
+
policyDocument: {
|
|
76
|
+
Version: string;
|
|
77
|
+
Statement: readonly [{
|
|
78
|
+
readonly Sid: "DenyNonApprovedRegions";
|
|
79
|
+
readonly Effect: "Deny";
|
|
80
|
+
readonly NotAction: readonly ["iam:*", "organizations:*", "route53:*", "cloudfront:*", "support:*", "s3:*"];
|
|
81
|
+
readonly Resource: "*";
|
|
82
|
+
readonly Condition: {
|
|
83
|
+
readonly StringNotEquals: {
|
|
84
|
+
readonly 'aws:RequestedRegion': readonly ["us-east-1", "us-west-2"];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
preventLeaving: {
|
|
91
|
+
name: string;
|
|
92
|
+
description: string;
|
|
93
|
+
policyDocument: {
|
|
94
|
+
Version: string;
|
|
95
|
+
Statement: readonly [{
|
|
96
|
+
readonly Sid: "PreventLeaving";
|
|
97
|
+
readonly Effect: "Deny";
|
|
98
|
+
readonly Action: "organizations:LeaveOrganization";
|
|
99
|
+
readonly Resource: "*";
|
|
100
|
+
}];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
denyS3Unencrypted: {
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
policyDocument: {
|
|
107
|
+
Version: string;
|
|
108
|
+
Statement: readonly [{
|
|
109
|
+
readonly Sid: "DenyUnencryptedS3Uploads";
|
|
110
|
+
readonly Effect: "Deny";
|
|
111
|
+
readonly Action: "s3:PutObject";
|
|
112
|
+
readonly Resource: "*";
|
|
113
|
+
readonly Condition: {
|
|
114
|
+
readonly StringNotEquals: {
|
|
115
|
+
readonly 's3:x-amz-server-side-encryption': readonly ["AES256", "aws:kms"];
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Common cross-account role configurations
|
|
124
|
+
*/
|
|
125
|
+
export declare const COMMON_CROSS_ACCOUNT_ROLES: {
|
|
126
|
+
deploymentRole: {
|
|
127
|
+
name: string;
|
|
128
|
+
description: string;
|
|
129
|
+
permissions: readonly ["cloudformation:*", "s3:*", "ec2:*", "ecs:*", "lambda:*", "iam:GetRole", "iam:PassRole", "logs:*", "events:*"];
|
|
130
|
+
};
|
|
131
|
+
readOnlyRole: {
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
permissions: readonly ["cloudformation:Describe*", "cloudformation:List*", "ec2:Describe*", "ecs:Describe*", "lambda:Get*", "lambda:List*", "s3:Get*", "s3:List*", "logs:Get*", "logs:Describe*"];
|
|
135
|
+
};
|
|
136
|
+
securityAuditRole: {
|
|
137
|
+
name: string;
|
|
138
|
+
description: string;
|
|
139
|
+
permissions: readonly ["iam:Get*", "iam:List*", "iam:Generate*", "access-analyzer:*", "guardduty:Get*", "guardduty:List*", "securityhub:Get*", "securityhub:List*", "config:Describe*", "config:Get*", "config:List*"];
|
|
140
|
+
};
|
|
141
|
+
breakGlassRole: {
|
|
142
|
+
name: string;
|
|
143
|
+
description: string;
|
|
144
|
+
permissions: readonly ["*"];
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Get recommended account structure
|
|
149
|
+
*/
|
|
150
|
+
export declare function getRecommendedStructure(size: 'basic' | 'standard' | 'enterprise'): AccountStructure;
|
|
151
|
+
/**
|
|
152
|
+
* Generate cross-account role CloudFormation
|
|
153
|
+
*/
|
|
154
|
+
export declare function generateCrossAccountRoleCF(role: CrossAccountRole, managedPolicies?: string[]): any;
|
|
155
|
+
/**
|
|
156
|
+
* Validate account structure
|
|
157
|
+
*/
|
|
158
|
+
export declare function validateAccountStructure(structure: AccountStructure): {
|
|
159
|
+
valid: boolean;
|
|
160
|
+
errors: string[];
|
|
161
|
+
warnings: string[];
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Format account structure for display
|
|
165
|
+
*/
|
|
166
|
+
export declare function formatAccountStructure(structure: AccountStructure): string;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Account Manager
|
|
3
|
+
* Manages deployments across multiple AWS accounts
|
|
4
|
+
*/
|
|
5
|
+
export interface AWSAccount {
|
|
6
|
+
id: string;
|
|
7
|
+
alias?: string;
|
|
8
|
+
email: string;
|
|
9
|
+
role: 'management' | 'production' | 'staging' | 'development' | 'security' | 'shared-services';
|
|
10
|
+
organizationalUnit?: string;
|
|
11
|
+
assumeRoleArn?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CrossAccountRole {
|
|
14
|
+
roleArn: string;
|
|
15
|
+
roleName: string;
|
|
16
|
+
sourceAccountId: string;
|
|
17
|
+
targetAccountId: string;
|
|
18
|
+
permissions: string[];
|
|
19
|
+
externalId?: string;
|
|
20
|
+
sessionDuration?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface AccountMapping {
|
|
23
|
+
environment: string;
|
|
24
|
+
accountId: string;
|
|
25
|
+
region: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Multi-account deployment manager
|
|
29
|
+
*/
|
|
30
|
+
export declare class MultiAccountManager {
|
|
31
|
+
private accounts;
|
|
32
|
+
private crossAccountRoles;
|
|
33
|
+
private accountMappings;
|
|
34
|
+
/**
|
|
35
|
+
* Register an AWS account
|
|
36
|
+
*/
|
|
37
|
+
registerAccount(account: AWSAccount): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get account by ID
|
|
40
|
+
*/
|
|
41
|
+
getAccount(accountId: string): AWSAccount | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get account by alias
|
|
44
|
+
*/
|
|
45
|
+
getAccountByAlias(alias: string): AWSAccount | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* List all accounts
|
|
48
|
+
*/
|
|
49
|
+
listAccounts(): AWSAccount[];
|
|
50
|
+
/**
|
|
51
|
+
* Get accounts by role
|
|
52
|
+
*/
|
|
53
|
+
getAccountsByRole(role: AWSAccount['role']): AWSAccount[];
|
|
54
|
+
/**
|
|
55
|
+
* Create cross-account role for deployment
|
|
56
|
+
*/
|
|
57
|
+
createCrossAccountRole(sourceAccountId: string, targetAccountId: string, roleName: string, permissions: string[], options?: {
|
|
58
|
+
externalId?: string;
|
|
59
|
+
sessionDuration?: number;
|
|
60
|
+
}): CrossAccountRole;
|
|
61
|
+
/**
|
|
62
|
+
* Get assume role policy document
|
|
63
|
+
*/
|
|
64
|
+
getAssumeRolePolicyDocument(sourceAccountId: string, externalId?: string): any;
|
|
65
|
+
/**
|
|
66
|
+
* Generate IAM policy for cross-account access
|
|
67
|
+
*/
|
|
68
|
+
generateCrossAccountPolicy(permissions: string[]): any;
|
|
69
|
+
/**
|
|
70
|
+
* Map environment to account
|
|
71
|
+
*/
|
|
72
|
+
mapEnvironmentToAccount(environment: string, accountId: string, region: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Get account for environment
|
|
75
|
+
*/
|
|
76
|
+
getAccountForEnvironment(environment: string): AccountMapping | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Assume role in target account
|
|
79
|
+
*/
|
|
80
|
+
assumeRole(roleArn: string, sessionName: string, externalId?: string): Promise<{
|
|
81
|
+
accessKeyId: string;
|
|
82
|
+
secretAccessKey: string;
|
|
83
|
+
sessionToken: string;
|
|
84
|
+
expiration: Date;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Get credentials for account
|
|
88
|
+
*/
|
|
89
|
+
getCredentialsForAccount(accountId: string): Promise<{
|
|
90
|
+
accessKeyId: string;
|
|
91
|
+
secretAccessKey: string;
|
|
92
|
+
sessionToken?: string;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* List cross-account roles
|
|
96
|
+
*/
|
|
97
|
+
listCrossAccountRoles(): CrossAccountRole[];
|
|
98
|
+
/**
|
|
99
|
+
* Get cross-account roles for account
|
|
100
|
+
*/
|
|
101
|
+
getCrossAccountRolesForAccount(accountId: string): CrossAccountRole[];
|
|
102
|
+
/**
|
|
103
|
+
* Validate account access
|
|
104
|
+
*/
|
|
105
|
+
validateAccountAccess(accountId: string): Promise<boolean>;
|
|
106
|
+
/**
|
|
107
|
+
* Get consolidated billing summary
|
|
108
|
+
*/
|
|
109
|
+
getConsolidatedBilling(): Promise<{
|
|
110
|
+
totalCost: number;
|
|
111
|
+
byAccount: Record<string, number>;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Clear all data
|
|
115
|
+
*/
|
|
116
|
+
clear(): void;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* AWS Organizations helper
|
|
120
|
+
*/
|
|
121
|
+
export declare class OrganizationManager {
|
|
122
|
+
private organizationId?;
|
|
123
|
+
private organizationalUnits;
|
|
124
|
+
/**
|
|
125
|
+
* Get organization ID
|
|
126
|
+
*/
|
|
127
|
+
getOrganizationId(): string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Set organization ID
|
|
130
|
+
*/
|
|
131
|
+
setOrganizationId(id: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* Create organizational unit
|
|
134
|
+
*/
|
|
135
|
+
createOrganizationalUnit(name: string, parentId?: string): OrganizationalUnit;
|
|
136
|
+
/**
|
|
137
|
+
* Get organizational unit
|
|
138
|
+
*/
|
|
139
|
+
getOrganizationalUnit(id: string): OrganizationalUnit | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* List organizational units
|
|
142
|
+
*/
|
|
143
|
+
listOrganizationalUnits(): OrganizationalUnit[];
|
|
144
|
+
/**
|
|
145
|
+
* Add account to organizational unit
|
|
146
|
+
*/
|
|
147
|
+
addAccountToOU(ouId: string, accountId: string): void;
|
|
148
|
+
/**
|
|
149
|
+
* Remove account from organizational unit
|
|
150
|
+
*/
|
|
151
|
+
removeAccountFromOU(ouId: string, accountId: string): void;
|
|
152
|
+
/**
|
|
153
|
+
* Get accounts in organizational unit
|
|
154
|
+
*/
|
|
155
|
+
getAccountsInOU(ouId: string): string[];
|
|
156
|
+
/**
|
|
157
|
+
* Apply service control policy
|
|
158
|
+
*/
|
|
159
|
+
applyServiceControlPolicy(targetId: string, policyDocument: any): ServiceControlPolicy;
|
|
160
|
+
/**
|
|
161
|
+
* Clear all data
|
|
162
|
+
*/
|
|
163
|
+
clear(): void;
|
|
164
|
+
}
|
|
165
|
+
export interface OrganizationalUnit {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
parentId?: string;
|
|
169
|
+
accounts: string[];
|
|
170
|
+
}
|
|
171
|
+
export interface ServiceControlPolicy {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
targetId: string;
|
|
175
|
+
policyDocument: any;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Global instances
|
|
179
|
+
*/
|
|
180
|
+
export declare const multiAccountManager: MultiAccountManager;
|
|
181
|
+
export declare const organizationManager: OrganizationManager;
|