alchemy 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/lib/ai/ark.d.ts +11 -0
- package/lib/ai/ark.js +86 -0
- package/lib/ai/client.d.ts +51 -0
- package/lib/ai/client.js +29 -0
- package/lib/ai/document.d.ts +97 -0
- package/lib/ai/document.js +82 -0
- package/lib/ai/index.d.ts +2 -0
- package/lib/ai/index.js +2 -0
- package/lib/ai/object.d.ts +101 -0
- package/lib/ai/object.js +70 -0
- package/lib/alchemy.d.ts +84 -2
- package/lib/alchemy.js +114 -10
- package/lib/apply.d.ts +1 -1
- package/lib/apply.js +13 -10
- package/lib/aws/bucket.d.ts +87 -1
- package/lib/aws/bucket.js +48 -1
- package/lib/aws/function.d.ts +186 -1
- package/lib/aws/function.js +62 -8
- package/lib/aws/oidc/github-oidc-provider.d.ts +81 -0
- package/lib/aws/oidc/github-oidc-provider.js +68 -0
- package/lib/aws/oidc/oidc-provider.d.ts +14 -6
- package/lib/aws/oidc/oidc-provider.js +26 -5
- package/lib/aws/policy-attachment.d.ts +44 -1
- package/lib/aws/policy-attachment.js +31 -0
- package/lib/aws/policy.d.ts +160 -1
- package/lib/aws/policy.js +78 -0
- package/lib/aws/queue.d.ts +83 -1
- package/lib/aws/queue.js +39 -0
- package/lib/aws/role.d.ts +162 -1
- package/lib/aws/role.js +114 -0
- package/lib/aws/ses.d.ts +57 -2
- package/lib/aws/ses.js +42 -1
- package/lib/aws/table.d.ts +96 -1
- package/lib/aws/table.js +36 -0
- package/lib/cloudflare/asset-manifest.js +0 -1
- package/lib/cloudflare/bound.js +0 -1
- package/lib/cloudflare/bucket.d.ts +37 -1
- package/lib/cloudflare/bucket.js +36 -0
- package/lib/cloudflare/durable-object-namespace.d.ts +25 -0
- package/lib/cloudflare/durable-object-namespace.js +22 -0
- package/lib/cloudflare/kv-namespace.d.ts +37 -1
- package/lib/cloudflare/kv-namespace.js +36 -0
- package/lib/cloudflare/static-site.d.ts +53 -1
- package/lib/cloudflare/static-site.js +53 -1
- package/lib/cloudflare/worker-metadata.js +0 -1
- package/lib/cloudflare/worker.d.ts +64 -1
- package/lib/cloudflare/worker.js +63 -0
- package/lib/cloudflare/wrangler.json.d.ts +1 -1
- package/lib/cloudflare/zone-settings.js +0 -1
- package/lib/cloudflare/zone.d.ts +56 -1
- package/lib/cloudflare/zone.js +55 -0
- package/lib/context.d.ts +9 -4
- package/lib/context.js +4 -2
- package/lib/destroy.js +9 -8
- package/lib/esbuild/bundle.d.ts +43 -4
- package/lib/esbuild/bundle.js +16 -0
- package/lib/fs/file-collection.d.ts +16 -0
- package/lib/fs/file-collection.js +6 -0
- package/lib/fs/file-ref.d.ts +14 -0
- package/lib/fs/file-ref.js +6 -0
- package/lib/fs/file.d.ts +78 -5
- package/lib/fs/file.js +39 -3
- package/lib/fs/folder.d.ts +37 -5
- package/lib/fs/folder.js +28 -3
- package/lib/fs/index.d.ts +6 -0
- package/lib/fs/index.js +6 -0
- package/lib/fs/json-file.d.ts +16 -0
- package/lib/fs/json-file.js +7 -0
- package/lib/fs/text-file.d.ts +12 -0
- package/lib/fs/text-file.js +7 -0
- package/lib/fs/typescript-file.d.ts +19 -0
- package/lib/fs/typescript-file.js +14 -0
- package/lib/fs/yaml-file.d.ts +19 -0
- package/lib/fs/yaml-file.js +8 -0
- package/lib/github/secret.d.ts +63 -2
- package/lib/github/secret.js +61 -1
- package/lib/internal/docs.d.ts +5 -0
- package/lib/internal/docs.js +324 -0
- package/lib/resource.d.ts +2 -2
- package/lib/resource.js +4 -0
- package/lib/scope.d.ts +1 -1
- package/lib/scope.js +6 -6
- package/lib/secret.d.ts +67 -0
- package/lib/secret.js +67 -0
- package/lib/shadcn/component.d.ts +1 -1
- package/lib/state.d.ts +1 -1
- package/lib/state.js +8 -1
- package/lib/stripe/price.d.ts +51 -1
- package/lib/stripe/price.js +50 -0
- package/lib/stripe/product.d.ts +39 -1
- package/lib/stripe/product.js +38 -0
- package/lib/stripe/webhook.d.ts +46 -1
- package/lib/stripe/webhook.js +45 -0
- package/lib/test/bun.d.ts +64 -0
- package/lib/test/bun.js +35 -3
- package/lib/util/serde.d.ts +3 -1
- package/lib/util/serde.js +20 -4
- package/lib/vite/vite.d.ts +1 -1
- package/lib/vitepress/dependencies.d.ts +12 -0
- package/lib/vitepress/dependencies.js +35 -0
- package/lib/vitepress/home-page.d.ts +133 -0
- package/lib/vitepress/home-page.js +11 -0
- package/lib/vitepress/index.d.ts +2 -0
- package/lib/vitepress/index.js +2 -0
- package/lib/vitepress/vitepress.d.ts +71 -0
- package/lib/vitepress/vitepress.js +266 -0
- package/package.json +22 -10
- package/src/ai/ark.ts +118 -0
- package/src/ai/client.ts +78 -0
- package/src/ai/document.ts +160 -0
- package/src/ai/index.ts +2 -0
- package/src/ai/object.ts +149 -0
- package/src/alchemy.ts +192 -17
- package/src/apply.ts +25 -13
- package/src/aws/bucket.ts +111 -7
- package/src/aws/function.ts +231 -10
- package/src/aws/oidc/github-oidc-provider.ts +83 -0
- package/src/aws/oidc/oidc-provider.ts +39 -7
- package/src/aws/policy-attachment.ts +44 -1
- package/src/aws/policy.ts +177 -2
- package/src/aws/queue.ts +89 -0
- package/src/aws/role.ts +174 -2
- package/src/aws/ses.ts +56 -1
- package/src/aws/table.ts +103 -0
- package/src/cloudflare/bucket.ts +36 -0
- package/src/cloudflare/durable-object-namespace.ts +25 -0
- package/src/cloudflare/kv-namespace.ts +36 -0
- package/src/cloudflare/static-site.ts +53 -1
- package/src/cloudflare/worker.ts +63 -0
- package/src/cloudflare/zone.ts +55 -0
- package/src/context.ts +30 -10
- package/src/destroy.ts +11 -8
- package/src/esbuild/bundle.ts +53 -3
- package/src/fs/file-collection.ts +24 -0
- package/src/fs/file-ref.ts +22 -0
- package/src/fs/file.ts +107 -6
- package/src/fs/folder.ts +45 -5
- package/src/fs/index.ts +6 -0
- package/src/fs/json-file.ts +23 -0
- package/src/fs/text-file.ts +19 -0
- package/src/fs/typescript-file.ts +36 -0
- package/src/fs/yaml-file.ts +26 -0
- package/src/github/secret.ts +65 -2
- package/src/internal/docs.ts +369 -0
- package/src/resource.ts +7 -2
- package/src/scope.ts +9 -9
- package/src/secret.ts +67 -0
- package/src/state.ts +9 -2
- package/src/stripe/price.ts +50 -0
- package/src/stripe/product.ts +38 -0
- package/src/stripe/webhook.ts +45 -0
- package/src/test/bun.ts +83 -3
- package/src/util/serde.ts +30 -4
- package/src/vitepress/dependencies.ts +68 -0
- package/src/vitepress/home-page.ts +166 -0
- package/src/vitepress/index.md +75 -0
- package/src/vitepress/index.ts +2 -0
- package/src/vitepress/vitepress.ts +382 -0
- package/lib/project/vite.d.ts +0 -90
- package/lib/project/vite.js +0 -228
- package/src/project/vite.ts +0 -406
package/src/aws/policy.ts
CHANGED
|
@@ -12,44 +12,219 @@ import {
|
|
|
12
12
|
import type { Context } from "../context";
|
|
13
13
|
import { Resource } from "../resource";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Type of effect for a policy statement
|
|
17
|
+
*/
|
|
16
18
|
export type Effect = "Allow" | "Deny";
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* A single statement within an IAM policy document
|
|
22
|
+
*/
|
|
18
23
|
export interface PolicyStatement {
|
|
24
|
+
/**
|
|
25
|
+
* Optional identifier for the statement
|
|
26
|
+
*/
|
|
19
27
|
Sid?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether to allow or deny the specified actions
|
|
31
|
+
*/
|
|
20
32
|
Effect: Effect;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Actions that the policy allows or denies
|
|
36
|
+
*/
|
|
21
37
|
Action: string | string[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resources that the policy applies to
|
|
41
|
+
*/
|
|
22
42
|
Resource?: string | string[];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Additional conditions for when the policy applies
|
|
46
|
+
*/
|
|
23
47
|
Condition?: Record<string, Record<string, string | string[]>>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* AWS principals that the policy applies to
|
|
51
|
+
*/
|
|
24
52
|
Principal?: Record<string, string | string[]>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* AWS principals that the policy explicitly does not apply to
|
|
56
|
+
*/
|
|
25
57
|
NotPrincipal?: Record<string, string | string[]>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Actions that are explicitly not included in this statement
|
|
61
|
+
*/
|
|
26
62
|
NotAction?: string | string[];
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Resources that are explicitly not included in this statement
|
|
66
|
+
*/
|
|
27
67
|
NotResource?: string | string[];
|
|
28
68
|
}
|
|
29
69
|
|
|
70
|
+
/**
|
|
71
|
+
* An IAM policy document containing one or more statements
|
|
72
|
+
*/
|
|
30
73
|
export interface PolicyDocument {
|
|
74
|
+
/**
|
|
75
|
+
* Policy language version (must be "2012-10-17")
|
|
76
|
+
*/
|
|
31
77
|
Version: "2012-10-17";
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* List of policy statements
|
|
81
|
+
*/
|
|
32
82
|
Statement: PolicyStatement[];
|
|
33
83
|
}
|
|
34
84
|
|
|
35
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Properties for creating or updating an IAM policy
|
|
87
|
+
*/
|
|
36
88
|
export interface PolicyProps {
|
|
89
|
+
/**
|
|
90
|
+
* Name of the policy
|
|
91
|
+
*/
|
|
37
92
|
policyName: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Policy document defining the permissions
|
|
96
|
+
*/
|
|
38
97
|
document: PolicyDocument;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Optional description of the policy's purpose
|
|
101
|
+
*/
|
|
39
102
|
description?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Optional path prefix for the policy
|
|
106
|
+
*/
|
|
40
107
|
path?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Optional resource tags
|
|
111
|
+
*/
|
|
41
112
|
tags?: Record<string, string>;
|
|
42
113
|
}
|
|
43
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Output returned after IAM policy creation/update
|
|
117
|
+
*/
|
|
44
118
|
export interface Policy extends Resource<"iam::Policy">, PolicyProps {
|
|
119
|
+
/**
|
|
120
|
+
* ARN of the policy
|
|
121
|
+
*/
|
|
45
122
|
arn: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* ID of the default policy version
|
|
126
|
+
*/
|
|
46
127
|
defaultVersionId: string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Number of entities the policy is attached to
|
|
131
|
+
*/
|
|
47
132
|
attachmentCount: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* When the policy was created
|
|
136
|
+
*/
|
|
48
137
|
createDate: Date;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* When the policy was last updated
|
|
141
|
+
*/
|
|
49
142
|
updateDate: Date;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Whether the policy can be attached to IAM users/roles
|
|
146
|
+
*/
|
|
50
147
|
isAttachable: boolean;
|
|
51
148
|
}
|
|
52
149
|
|
|
150
|
+
/**
|
|
151
|
+
* AWS IAM Policy Resource
|
|
152
|
+
*
|
|
153
|
+
* Creates and manages IAM policies that define permissions for AWS services and resources.
|
|
154
|
+
* Supports automatic versioning and updates when policy content changes.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* // Create a basic S3 bucket access policy
|
|
158
|
+
* const s3Policy = await Policy("bucket-access", {
|
|
159
|
+
* policyName: "s3-bucket-access",
|
|
160
|
+
* document: {
|
|
161
|
+
* Version: "2012-10-17",
|
|
162
|
+
* Statement: [{
|
|
163
|
+
* Effect: "Allow",
|
|
164
|
+
* Action: [
|
|
165
|
+
* "s3:GetObject",
|
|
166
|
+
* "s3:PutObject"
|
|
167
|
+
* ],
|
|
168
|
+
* Resource: `${bucket.arn}/*`
|
|
169
|
+
* }]
|
|
170
|
+
* }
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* // Create a policy with multiple statements and conditions
|
|
175
|
+
* const apiPolicy = await Policy("api-access", {
|
|
176
|
+
* policyName: "api-gateway-access",
|
|
177
|
+
* document: {
|
|
178
|
+
* Version: "2012-10-17",
|
|
179
|
+
* Statement: [
|
|
180
|
+
* {
|
|
181
|
+
* Sid: "InvokeAPI",
|
|
182
|
+
* Effect: "Allow",
|
|
183
|
+
* Action: "execute-api:Invoke",
|
|
184
|
+
* Resource: `${api.executionArn}/*`,
|
|
185
|
+
* Condition: {
|
|
186
|
+
* StringEquals: {
|
|
187
|
+
* "aws:SourceVpc": vpc.id
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
* },
|
|
191
|
+
* {
|
|
192
|
+
* Sid: "ReadLogs",
|
|
193
|
+
* Effect: "Allow",
|
|
194
|
+
* Action: [
|
|
195
|
+
* "logs:GetLogEvents",
|
|
196
|
+
* "logs:FilterLogEvents"
|
|
197
|
+
* ],
|
|
198
|
+
* Resource: `${api.logGroupArn}:*`
|
|
199
|
+
* }
|
|
200
|
+
* ]
|
|
201
|
+
* },
|
|
202
|
+
* description: "Allows invoking API Gateway endpoints and reading logs",
|
|
203
|
+
* tags: {
|
|
204
|
+
* Service: "API Gateway",
|
|
205
|
+
* Environment: "production"
|
|
206
|
+
* }
|
|
207
|
+
* });
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* // Create a policy that denies access based on tags
|
|
211
|
+
* const denyPolicy = await Policy("deny-production", {
|
|
212
|
+
* policyName: "deny-production-access",
|
|
213
|
+
* document: {
|
|
214
|
+
* Version: "2012-10-17",
|
|
215
|
+
* Statement: [{
|
|
216
|
+
* Effect: "Deny",
|
|
217
|
+
* Action: "*",
|
|
218
|
+
* Resource: "*",
|
|
219
|
+
* Condition: {
|
|
220
|
+
* StringEquals: {
|
|
221
|
+
* "aws:ResourceTag/Environment": "production"
|
|
222
|
+
* }
|
|
223
|
+
* }
|
|
224
|
+
* }]
|
|
225
|
+
* }
|
|
226
|
+
* });
|
|
227
|
+
*/
|
|
53
228
|
export const Policy = Resource(
|
|
54
229
|
"iam::Policy",
|
|
55
230
|
async function (
|
package/src/aws/queue.ts
CHANGED
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
import type { Context } from "../context";
|
|
9
9
|
import { Resource } from "../resource";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Properties for creating or updating an SQS queue
|
|
13
|
+
*/
|
|
11
14
|
export interface QueueProps {
|
|
12
15
|
/**
|
|
13
16
|
* Name of the queue
|
|
@@ -21,10 +24,34 @@ export interface QueueProps {
|
|
|
21
24
|
*/
|
|
22
25
|
fifo?: boolean;
|
|
23
26
|
|
|
27
|
+
/**
|
|
28
|
+
* The length of time (in seconds) that a message received from a queue will be invisible to other receiving components
|
|
29
|
+
* Default: 30 seconds
|
|
30
|
+
*/
|
|
24
31
|
visibilityTimeout?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The length of time (in seconds) for which Amazon SQS retains a message
|
|
35
|
+
* Default: 345600 seconds (4 days)
|
|
36
|
+
*/
|
|
25
37
|
messageRetentionPeriod?: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The limit of how many bytes a message can contain before Amazon SQS rejects it
|
|
41
|
+
* Default: 262144 bytes (256 KB)
|
|
42
|
+
*/
|
|
26
43
|
maximumMessageSize?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The time in seconds that the delivery of all messages in the queue will be delayed
|
|
47
|
+
* Default: 0 seconds
|
|
48
|
+
*/
|
|
27
49
|
delaySeconds?: number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The length of time (in seconds) for which a ReceiveMessage action waits for a message to arrive
|
|
53
|
+
* Default: 0 seconds
|
|
54
|
+
*/
|
|
28
55
|
receiveMessageWaitTimeSeconds?: number;
|
|
29
56
|
|
|
30
57
|
/**
|
|
@@ -33,16 +60,78 @@ export interface QueueProps {
|
|
|
33
60
|
*/
|
|
34
61
|
contentBasedDeduplication?: boolean;
|
|
35
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Specifies whether message deduplication occurs at the message group or queue level
|
|
65
|
+
* Only applicable when fifo is true
|
|
66
|
+
*/
|
|
36
67
|
deduplicationScope?: "messageGroup" | "queue";
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group
|
|
71
|
+
* Only applicable when fifo is true
|
|
72
|
+
*/
|
|
37
73
|
fifoThroughputLimit?: "perQueue" | "perMessageGroupId";
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Resource tags for the queue
|
|
77
|
+
*/
|
|
38
78
|
tags?: Record<string, string>;
|
|
39
79
|
}
|
|
40
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Output returned after SQS queue creation/update
|
|
83
|
+
*/
|
|
41
84
|
export interface Queue extends Resource<"sqs::Queue">, QueueProps {
|
|
85
|
+
/**
|
|
86
|
+
* ARN of the queue
|
|
87
|
+
*/
|
|
42
88
|
arn: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* URL of the queue
|
|
92
|
+
*/
|
|
43
93
|
url: string;
|
|
44
94
|
}
|
|
45
95
|
|
|
96
|
+
/**
|
|
97
|
+
* AWS SQS Queue Resource
|
|
98
|
+
*
|
|
99
|
+
* Creates and manages Amazon SQS queues with support for both standard and FIFO queues.
|
|
100
|
+
* Handles queue creation, attribute configuration, and automatic cleanup of deleted queues.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* // Create a standard queue with custom visibility timeout
|
|
104
|
+
* const standardQueue = await Queue("my-queue", {
|
|
105
|
+
* queueName: "my-queue",
|
|
106
|
+
* visibilityTimeout: 30,
|
|
107
|
+
* tags: {
|
|
108
|
+
* Environment: "production"
|
|
109
|
+
* }
|
|
110
|
+
* });
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* // Create a FIFO queue with content-based deduplication
|
|
114
|
+
* const fifoQueue = await Queue("orders-queue", {
|
|
115
|
+
* queueName: "orders-queue.fifo",
|
|
116
|
+
* fifo: true,
|
|
117
|
+
* contentBasedDeduplication: true,
|
|
118
|
+
* visibilityTimeout: 30,
|
|
119
|
+
* tags: {
|
|
120
|
+
* Environment: "production"
|
|
121
|
+
* }
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* // Create a queue with custom message retention and size
|
|
126
|
+
* const customQueue = await Queue("large-messages", {
|
|
127
|
+
* queueName: "large-messages",
|
|
128
|
+
* messageRetentionPeriod: 345600, // 4 days
|
|
129
|
+
* maximumMessageSize: 262144, // 256 KB
|
|
130
|
+
* visibilityTimeout: 60,
|
|
131
|
+
* delaySeconds: 5,
|
|
132
|
+
* receiveMessageWaitTimeSeconds: 20
|
|
133
|
+
* });
|
|
134
|
+
*/
|
|
46
135
|
export const Queue = Resource(
|
|
47
136
|
"sqs::Queue",
|
|
48
137
|
async function (
|
package/src/aws/role.ts
CHANGED
|
@@ -20,28 +20,200 @@ import { Resource } from "../resource";
|
|
|
20
20
|
import { ignore } from "../util/ignore";
|
|
21
21
|
import type { PolicyDocument } from "./policy";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Properties for creating or updating an IAM role
|
|
25
|
+
*/
|
|
23
26
|
export interface RoleProps {
|
|
27
|
+
/**
|
|
28
|
+
* Name of the IAM role
|
|
29
|
+
*/
|
|
24
30
|
roleName: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Policy that defines which entities can assume this role
|
|
34
|
+
*/
|
|
25
35
|
assumeRolePolicy: PolicyDocument;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Optional description of the role's purpose
|
|
39
|
+
*/
|
|
26
40
|
description?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Optional path prefix for the role
|
|
44
|
+
*/
|
|
27
45
|
path?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Maximum session duration in seconds when assumed
|
|
49
|
+
* Default: 3600 seconds (1 hour)
|
|
50
|
+
*/
|
|
28
51
|
maxSessionDuration?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ARN of the policy used to set the permissions boundary
|
|
55
|
+
*/
|
|
29
56
|
permissionsBoundary?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Inline policies to embed in the role
|
|
60
|
+
* Each policy must have a unique name and policy document
|
|
61
|
+
*/
|
|
30
62
|
policies?: Array<{
|
|
31
63
|
policyName: string;
|
|
32
64
|
policyDocument: PolicyDocument;
|
|
33
65
|
}>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* List of managed policy ARNs to attach to the role
|
|
69
|
+
*/
|
|
34
70
|
managedPolicyArns?: string[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Resource tags for the role
|
|
74
|
+
*/
|
|
35
75
|
tags?: Record<string, string>;
|
|
36
76
|
}
|
|
37
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Output returned after IAM role creation/update
|
|
80
|
+
*/
|
|
38
81
|
export interface Role extends Resource<"iam::Role">, RoleProps {
|
|
82
|
+
/**
|
|
83
|
+
* ARN of the role
|
|
84
|
+
*/
|
|
39
85
|
arn: string;
|
|
40
|
-
|
|
41
|
-
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Unique identifier for the role
|
|
89
|
+
*/
|
|
90
|
+
uniqueId: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The stable and unique string identifying the role
|
|
94
|
+
*/
|
|
95
|
+
roleId: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* When the role was created
|
|
99
|
+
*/
|
|
42
100
|
createDate: Date;
|
|
43
101
|
}
|
|
44
102
|
|
|
103
|
+
/**
|
|
104
|
+
* AWS IAM Role Resource
|
|
105
|
+
*
|
|
106
|
+
* Creates and manages IAM roles with support for inline policies, managed policies,
|
|
107
|
+
* and automatic cleanup of attached policies during deletion.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* // Create a basic Lambda execution role with inline policy
|
|
111
|
+
* const basicRole = await Role("lambda-role", {
|
|
112
|
+
* roleName: "lambda-role",
|
|
113
|
+
* assumeRolePolicy: {
|
|
114
|
+
* Version: "2012-10-17",
|
|
115
|
+
* Statement: [{
|
|
116
|
+
* Effect: "Allow",
|
|
117
|
+
* Principal: {
|
|
118
|
+
* Service: "lambda.amazonaws.com"
|
|
119
|
+
* },
|
|
120
|
+
* Action: "sts:AssumeRole"
|
|
121
|
+
* }]
|
|
122
|
+
* },
|
|
123
|
+
* description: "Basic Lambda execution role",
|
|
124
|
+
* tags: {
|
|
125
|
+
* Environment: "production"
|
|
126
|
+
* },
|
|
127
|
+
* policies: [{
|
|
128
|
+
* policyName: "logs",
|
|
129
|
+
* policyDocument: {
|
|
130
|
+
* Version: "2012-10-17",
|
|
131
|
+
* Statement: [{
|
|
132
|
+
* Effect: "Allow",
|
|
133
|
+
* Action: [
|
|
134
|
+
* "logs:CreateLogGroup",
|
|
135
|
+
* "logs:CreateLogStream",
|
|
136
|
+
* "logs:PutLogEvents"
|
|
137
|
+
* ],
|
|
138
|
+
* Resource: "*"
|
|
139
|
+
* }]
|
|
140
|
+
* }
|
|
141
|
+
* }]
|
|
142
|
+
* });
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* // Create a role with AWS managed policies
|
|
146
|
+
* const managedRole = await Role("readonly-role", {
|
|
147
|
+
* roleName: "readonly-role",
|
|
148
|
+
* assumeRolePolicy: {
|
|
149
|
+
* Version: "2012-10-17",
|
|
150
|
+
* Statement: [{
|
|
151
|
+
* Effect: "Allow",
|
|
152
|
+
* Principal: {
|
|
153
|
+
* Service: "lambda.amazonaws.com"
|
|
154
|
+
* },
|
|
155
|
+
* Action: "sts:AssumeRole"
|
|
156
|
+
* }]
|
|
157
|
+
* },
|
|
158
|
+
* description: "Role with managed policies",
|
|
159
|
+
* managedPolicyArns: [
|
|
160
|
+
* "arn:aws:iam::aws:policy/ReadOnlyAccess"
|
|
161
|
+
* ],
|
|
162
|
+
* tags: {
|
|
163
|
+
* Environment: "production"
|
|
164
|
+
* }
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* // Create a role with multiple inline policies and custom session duration
|
|
169
|
+
* const customRole = await Role("custom-role", {
|
|
170
|
+
* roleName: "custom-role",
|
|
171
|
+
* assumeRolePolicy: {
|
|
172
|
+
* Version: "2012-10-17",
|
|
173
|
+
* Statement: [{
|
|
174
|
+
* Effect: "Allow",
|
|
175
|
+
* Principal: {
|
|
176
|
+
* Service: "lambda.amazonaws.com"
|
|
177
|
+
* },
|
|
178
|
+
* Action: "sts:AssumeRole"
|
|
179
|
+
* }]
|
|
180
|
+
* },
|
|
181
|
+
* description: "Role with multiple policies",
|
|
182
|
+
* maxSessionDuration: 7200,
|
|
183
|
+
* policies: [
|
|
184
|
+
* {
|
|
185
|
+
* policyName: "logs",
|
|
186
|
+
* policyDocument: {
|
|
187
|
+
* Version: "2012-10-17",
|
|
188
|
+
* Statement: [{
|
|
189
|
+
* Effect: "Allow",
|
|
190
|
+
* Action: [
|
|
191
|
+
* "logs:CreateLogGroup",
|
|
192
|
+
* "logs:CreateLogStream",
|
|
193
|
+
* "logs:PutLogEvents"
|
|
194
|
+
* ],
|
|
195
|
+
* Resource: "*"
|
|
196
|
+
* }]
|
|
197
|
+
* }
|
|
198
|
+
* },
|
|
199
|
+
* {
|
|
200
|
+
* policyName: "s3",
|
|
201
|
+
* policyDocument: {
|
|
202
|
+
* Version: "2012-10-17",
|
|
203
|
+
* Statement: [{
|
|
204
|
+
* Effect: "Allow",
|
|
205
|
+
* Action: "s3:ListBucket",
|
|
206
|
+
* Resource: "*"
|
|
207
|
+
* }]
|
|
208
|
+
* }
|
|
209
|
+
* }
|
|
210
|
+
* ],
|
|
211
|
+
* tags: {
|
|
212
|
+
* Environment: "production",
|
|
213
|
+
* Updated: "true"
|
|
214
|
+
* }
|
|
215
|
+
* });
|
|
216
|
+
*/
|
|
45
217
|
export const Role = Resource(
|
|
46
218
|
"iam::Role",
|
|
47
219
|
async function (
|
package/src/aws/ses.ts
CHANGED
|
@@ -29,46 +29,56 @@ import { ignore } from "../util/ignore";
|
|
|
29
29
|
export interface SESProps {
|
|
30
30
|
/**
|
|
31
31
|
* Name of the configuration set
|
|
32
|
+
* Used to group email sending and tracking settings
|
|
32
33
|
*/
|
|
33
34
|
configurationSetName?: string;
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Email identity to verify (email address or domain)
|
|
38
|
+
* For domains, use the format "example.com"
|
|
39
|
+
* For email addresses, use the format "user@example.com"
|
|
37
40
|
*/
|
|
38
41
|
emailIdentity?: string;
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* Whether to enable DKIM signing for the email identity
|
|
45
|
+
* DKIM helps prevent email spoofing by verifying sender authenticity
|
|
42
46
|
*/
|
|
43
47
|
enableDkim?: boolean;
|
|
44
48
|
|
|
45
49
|
/**
|
|
46
50
|
* Sending options for the configuration set
|
|
51
|
+
* Controls whether email sending is enabled and related settings
|
|
47
52
|
*/
|
|
48
53
|
sendingOptions?: SendingOptions;
|
|
49
54
|
|
|
50
55
|
/**
|
|
51
56
|
* Reputation options for the configuration set
|
|
57
|
+
* Controls reputation tracking and metrics collection
|
|
52
58
|
*/
|
|
53
59
|
reputationOptions?: ReputationOptions;
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
62
|
* Tracking options for the configuration set
|
|
63
|
+
* Controls open and click tracking with optional custom domains
|
|
57
64
|
*/
|
|
58
65
|
trackingOptions?: TrackingOptions;
|
|
59
66
|
|
|
60
67
|
/**
|
|
61
68
|
* Suppression options for the configuration set
|
|
69
|
+
* Controls how bounces and complaints are handled
|
|
62
70
|
*/
|
|
63
71
|
suppressionOptions?: SuppressionOptions;
|
|
64
72
|
|
|
65
73
|
/**
|
|
66
74
|
* Delivery options for the configuration set
|
|
75
|
+
* Controls TLS settings and sending pool configuration
|
|
67
76
|
*/
|
|
68
77
|
deliveryOptions?: DeliveryOptions;
|
|
69
78
|
|
|
70
79
|
/**
|
|
71
80
|
* Tags to apply to the SES resources
|
|
81
|
+
* Key-value pairs for resource organization
|
|
72
82
|
*/
|
|
73
83
|
tags?: Record<string, string>;
|
|
74
84
|
}
|
|
@@ -79,27 +89,72 @@ export interface SESProps {
|
|
|
79
89
|
export interface SES extends Resource<"aws::SES">, SESProps {
|
|
80
90
|
/**
|
|
81
91
|
* ARN of the configuration set if created
|
|
92
|
+
* Format: arn:aws:ses:region:account-id:configuration-set/name
|
|
82
93
|
*/
|
|
83
94
|
configurationSetArn?: string;
|
|
84
95
|
|
|
85
96
|
/**
|
|
86
97
|
* Email identity verification status if an identity was created
|
|
98
|
+
* Can be "PENDING" or "VERIFIED"
|
|
87
99
|
*/
|
|
88
100
|
emailIdentityVerificationStatus?: string;
|
|
89
101
|
|
|
90
102
|
/**
|
|
91
103
|
* DKIM verification status if DKIM was enabled
|
|
104
|
+
* Can be "PENDING", "SUCCESS", "FAILED", "TEMPORARY_FAILURE", or "NOT_STARTED"
|
|
92
105
|
*/
|
|
93
106
|
dkimVerificationStatus?: string;
|
|
94
107
|
|
|
95
108
|
/**
|
|
96
109
|
* Email identity ARN if an identity was created
|
|
110
|
+
* Format: arn:aws:ses:region:account-id:identity/name
|
|
97
111
|
*/
|
|
98
112
|
emailIdentityArn?: string;
|
|
99
113
|
}
|
|
100
114
|
|
|
101
115
|
/**
|
|
102
|
-
* AWS SES
|
|
116
|
+
* AWS SES Resource
|
|
117
|
+
*
|
|
118
|
+
* Creates and manages Amazon Simple Email Service (SES) configuration sets and email identities.
|
|
119
|
+
* Supports email sending configuration, DKIM signing, and identity verification.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* // Create a configuration set with sending options
|
|
123
|
+
* const configSet = await SES("email-config", {
|
|
124
|
+
* configurationSetName: "my-email-config",
|
|
125
|
+
* sendingOptions: {
|
|
126
|
+
* SendingEnabled: true
|
|
127
|
+
* },
|
|
128
|
+
* tags: {
|
|
129
|
+
* Environment: "production",
|
|
130
|
+
* Project: "notifications"
|
|
131
|
+
* }
|
|
132
|
+
* });
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* // Create and verify a domain identity with DKIM
|
|
136
|
+
* const domainIdentity = await SES("domain-identity", {
|
|
137
|
+
* emailIdentity: "example.com",
|
|
138
|
+
* enableDkim: true,
|
|
139
|
+
* tags: {
|
|
140
|
+
* Environment: "production",
|
|
141
|
+
* Project: "transactional-emails"
|
|
142
|
+
* }
|
|
143
|
+
* });
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // Update configuration set sending options
|
|
147
|
+
* const updatedConfig = await SES("email-config", {
|
|
148
|
+
* configurationSetName: "my-email-config",
|
|
149
|
+
* sendingOptions: {
|
|
150
|
+
* SendingEnabled: false
|
|
151
|
+
* },
|
|
152
|
+
* tags: {
|
|
153
|
+
* Environment: "production",
|
|
154
|
+
* Project: "notifications",
|
|
155
|
+
* Updated: "true"
|
|
156
|
+
* }
|
|
157
|
+
* });
|
|
103
158
|
*/
|
|
104
159
|
export const SES = Resource(
|
|
105
160
|
"aws::SES",
|