alchemy 0.12.21 → 0.14.0
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/client.d.ts.map +1 -1
- package/lib/ai/client.js +3 -5
- package/lib/ai/client.js.map +1 -1
- package/lib/alchemy.d.ts +2 -1
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +87 -92
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +6 -1
- package/lib/apply.js.map +1 -1
- package/lib/aws/bucket.d.ts.map +1 -1
- package/lib/aws/bucket.js +55 -57
- package/lib/aws/bucket.js.map +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +250 -252
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/policy-attachment.d.ts.map +1 -1
- package/lib/aws/policy-attachment.js +4 -6
- package/lib/aws/policy-attachment.js.map +1 -1
- package/lib/aws/policy.d.ts.map +1 -1
- package/lib/aws/policy.js +63 -65
- package/lib/aws/policy.js.map +1 -1
- package/lib/aws/queue.js +88 -90
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/table.d.ts.map +1 -1
- package/lib/aws/table.js +95 -99
- package/lib/aws/table.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +0 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/ai.d.ts +1 -1
- package/lib/cloudflare/ai.d.ts.map +1 -1
- package/lib/cloudflare/ai.js.map +1 -1
- package/lib/cloudflare/api.d.ts +5 -5
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +52 -15
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/auth.d.ts +24 -55
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +15 -72
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bucket.d.ts +2 -2
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +22 -24
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/alias-plugin.d.ts +6 -0
- package/lib/cloudflare/bundle/alias-plugin.d.ts.map +1 -0
- package/lib/cloudflare/bundle/alias-plugin.js +36 -0
- package/lib/cloudflare/bundle/alias-plugin.js.map +1 -0
- package/lib/cloudflare/bundle/build-failures.d.ts +12 -0
- package/lib/cloudflare/bundle/build-failures.d.ts.map +1 -0
- package/lib/cloudflare/bundle/build-failures.js +45 -0
- package/lib/cloudflare/bundle/build-failures.js.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts +7 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.js +69 -0
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -0
- package/lib/cloudflare/bundle/external.d.ts +1 -0
- package/lib/cloudflare/bundle/external.d.ts.map +1 -1
- package/lib/cloudflare/bundle/external.js +8 -1
- package/lib/cloudflare/bundle/external.js.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js +6 -6
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts +17 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +27 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.d.ts → nodejs-compat.d.ts} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.d.ts.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.js → nodejs-compat.js} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.js.map +1 -0
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +3 -5
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +70 -72
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/d1-migrations.d.ts +1 -1
- package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
- package/lib/cloudflare/d1-migrations.js +2 -3
- package/lib/cloudflare/d1-migrations.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +2 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +1 -1
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +24 -27
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +1 -1
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +32 -34
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +27 -33
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts +1 -1
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +36 -38
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/r2-rest-state-store.js +4 -8
- package/lib/cloudflare/r2-rest-state-store.js.map +1 -1
- package/lib/cloudflare/types.d.ts.map +1 -1
- package/lib/cloudflare/types.js +1 -3
- package/lib/cloudflare/types.js.map +1 -1
- package/lib/cloudflare/user.d.ts +51 -0
- package/lib/cloudflare/user.d.ts.map +1 -0
- package/lib/cloudflare/user.js +62 -0
- package/lib/cloudflare/user.js.map +1 -0
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +37 -39
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +10 -13
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +18 -3
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +11 -54
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/workflow.d.ts +1 -1
- package/lib/cloudflare/workflow.d.ts.map +1 -1
- package/lib/cloudflare/workflow.js.map +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +48 -50
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/dns/godaddy.js +1 -1
- package/lib/dns/import-dns.js +1 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/env.js +7 -9
- package/lib/env.js.map +1 -1
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +8 -11
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +27 -29
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts +1 -1
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +1 -1
- package/lib/fs/file.js.map +1 -1
- package/lib/fs/folder.d.ts.map +1 -1
- package/lib/fs/folder.js +1 -3
- package/lib/fs/folder.js.map +1 -1
- package/lib/github/client.d.ts.map +1 -1
- package/lib/github/client.js +3 -5
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +173 -176
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +97 -99
- package/lib/github/secret.js.map +1 -1
- package/lib/internal/docs/providers.d.ts.map +1 -1
- package/lib/internal/docs/providers.js +5 -7
- package/lib/internal/docs/providers.js.map +1 -1
- package/lib/neon/api.js +1 -2
- package/lib/neon/api.js.map +1 -1
- package/lib/neon/project.js +2 -2
- package/lib/neon/project.js.map +1 -1
- package/lib/os/exec.d.ts +5 -0
- package/lib/os/exec.d.ts.map +1 -1
- package/lib/os/exec.js +88 -56
- package/lib/os/exec.js.map +1 -1
- package/lib/scope.d.ts +3 -0
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +10 -3
- package/lib/scope.js.map +1 -1
- package/lib/secret.d.ts.map +1 -1
- package/lib/secret.js +1 -3
- package/lib/secret.js.map +1 -1
- package/lib/serde.d.ts.map +1 -1
- package/lib/serde.js +13 -15
- package/lib/serde.js.map +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +69 -73
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +50 -52
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +51 -53
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +3 -8
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.d.ts.map +1 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/util/dedent.js +4 -4
- package/lib/util/dedent.js.map +1 -1
- package/lib/web/astro.js +1 -1
- package/lib/web/shadcn.js +4 -4
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/tailwind.d.ts.map +1 -1
- package/lib/web/tailwind.js +0 -1
- package/lib/web/tailwind.js.map +1 -1
- package/lib/web/vite.js +3 -3
- package/lib/web/vitepress/home-page.d.ts.map +1 -1
- package/lib/web/vitepress/home-page.js +6 -8
- package/lib/web/vitepress/home-page.js.map +1 -1
- package/lib/web/vitepress/process-front-matter-files.js +1 -1
- package/lib/web/vitepress/process-front-matter-files.js.map +1 -1
- package/lib/web/vitepress/vitepress.js +2 -2
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +4 -1
- package/src/ai/astro-file.ts +4 -4
- package/src/ai/client.ts +4 -5
- package/src/ai/css-file.ts +4 -4
- package/src/ai/document.ts +3 -3
- package/src/ai/html-file.ts +4 -4
- package/src/ai/json-file.ts +1 -1
- package/src/ai/typescript-file.ts +4 -4
- package/src/ai/vue-file.ts +4 -4
- package/src/ai/yaml-file.ts +1 -1
- package/src/alchemy.ts +111 -104
- package/src/apply.ts +13 -6
- package/src/aws/bucket.ts +72 -75
- package/src/aws/function.ts +296 -297
- package/src/aws/oidc/github-oidc-provider.ts +1 -1
- package/src/aws/oidc/oidc-provider.ts +15 -15
- package/src/aws/policy-attachment.ts +10 -11
- package/src/aws/policy.ts +91 -94
- package/src/aws/queue.ts +111 -111
- package/src/aws/role.ts +24 -24
- package/src/aws/ses.ts +17 -17
- package/src/aws/table.ts +114 -115
- package/src/cloudflare/account-api-token.ts +11 -11
- package/src/cloudflare/ai-gateway.ts +4 -4
- package/src/cloudflare/ai.ts +1 -1
- package/src/cloudflare/api-error.ts +1 -1
- package/src/cloudflare/api.ts +70 -25
- package/src/cloudflare/assets.ts +4 -4
- package/src/cloudflare/auth.ts +49 -164
- package/src/cloudflare/bucket.ts +62 -63
- package/src/cloudflare/bundle/alias-plugin.ts +48 -0
- package/src/cloudflare/bundle/build-failures.ts +55 -0
- package/src/cloudflare/bundle/bundle-worker.ts +89 -0
- package/src/cloudflare/bundle/external.ts +9 -1
- package/src/cloudflare/bundle/local-dev-cloudflare-shim.ts +7 -6
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +49 -0
- package/src/cloudflare/bundle/{hybrid-nodejs-compat.ts → nodejs-compat.ts} +10 -10
- package/src/cloudflare/custom-domain.ts +27 -28
- package/src/cloudflare/d1-database.ts +101 -102
- package/src/cloudflare/d1-migrations.ts +10 -10
- package/src/cloudflare/dns-records.ts +23 -24
- package/src/cloudflare/durable-object-namespace.ts +1 -1
- package/src/cloudflare/event-source.ts +1 -1
- package/src/cloudflare/hyperdrive.ts +3 -3
- package/src/cloudflare/kv-namespace.ts +36 -37
- package/src/cloudflare/nuxt.ts +1 -1
- package/src/cloudflare/permission-groups.ts +7 -7
- package/src/cloudflare/pipeline.ts +55 -56
- package/src/cloudflare/queue-consumer.ts +46 -53
- package/src/cloudflare/queue.ts +56 -57
- package/src/cloudflare/r2-rest-state-store.ts +11 -11
- package/src/cloudflare/redwood.ts +1 -1
- package/src/cloudflare/tanstack-start.ts +1 -1
- package/src/cloudflare/types.ts +1 -2
- package/src/cloudflare/user.ts +142 -0
- package/src/cloudflare/vectorize-index.ts +60 -61
- package/src/cloudflare/vectorize-metadata-index.ts +25 -25
- package/src/cloudflare/vite.ts +1 -1
- package/src/cloudflare/website.ts +3 -3
- package/src/cloudflare/worker.ts +83 -108
- package/src/cloudflare/workflow.ts +4 -4
- package/src/cloudflare/wrangler.json.ts +4 -4
- package/src/cloudflare/zone.ts +69 -70
- package/src/destroy.ts +4 -4
- package/src/dns/godaddy.ts +1 -1
- package/src/dns/import-dns.ts +5 -5
- package/src/encrypt.ts +6 -6
- package/src/env.ts +10 -10
- package/src/esbuild/bundle.ts +14 -15
- package/src/fs/copy-file.ts +35 -36
- package/src/fs/file-system-state-store.ts +4 -4
- package/src/fs/file.ts +9 -8
- package/src/fs/folder.ts +6 -7
- package/src/github/client.ts +15 -14
- package/src/github/repository-environment.ts +206 -210
- package/src/github/secret.ts +111 -116
- package/src/internal/docs/providers.ts +16 -17
- package/src/neon/api-error.ts +1 -1
- package/src/neon/api.ts +6 -6
- package/src/neon/project.ts +18 -17
- package/src/os/exec.ts +107 -66
- package/src/resource.ts +3 -3
- package/src/scope.ts +14 -4
- package/src/secret.ts +2 -3
- package/src/serde.ts +30 -22
- package/src/stripe/price.ts +74 -77
- package/src/stripe/product.ts +55 -56
- package/src/stripe/webhook.ts +56 -57
- package/src/test/bun.ts +9 -13
- package/src/test/prune.ts +4 -4
- package/src/util/dedent.ts +4 -4
- package/src/web/astro.ts +10 -10
- package/src/web/shadcn-component.ts +4 -4
- package/src/web/shadcn.ts +10 -10
- package/src/web/tailwind.ts +2 -3
- package/src/web/vite.ts +11 -11
- package/src/web/vitepress/config.ts +2 -2
- package/src/web/vitepress/custom-theme.ts +7 -7
- package/src/web/vitepress/dependencies.ts +4 -4
- package/src/web/vitepress/home-page.ts +8 -9
- package/src/web/vitepress/process-front-matter-files.ts +5 -5
- package/src/web/vitepress/vitepress.ts +7 -7
- package/lib/cloudflare/account-id.d.ts +0 -6
- package/lib/cloudflare/account-id.d.ts.map +0 -1
- package/lib/cloudflare/account-id.js +0 -6
- package/lib/cloudflare/account-id.js.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.d.ts.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.js.map +0 -1
- package/src/cloudflare/account-id.ts +0 -12
|
@@ -99,7 +99,7 @@ export type GitHubOIDCProvider = ReturnType<typeof GitHubOIDCProvider>;
|
|
|
99
99
|
*/
|
|
100
100
|
export const GitHubOIDCProvider = async (
|
|
101
101
|
id: string,
|
|
102
|
-
props: GitHubOIDCProviderProps
|
|
102
|
+
props: GitHubOIDCProviderProps,
|
|
103
103
|
) => {
|
|
104
104
|
return OIDCProvider(id, {
|
|
105
105
|
owner: props.owner,
|
|
@@ -121,7 +121,7 @@ export const OIDCProvider = Resource(
|
|
|
121
121
|
async function (
|
|
122
122
|
this: Context<OIDCProvider>,
|
|
123
123
|
id: string,
|
|
124
|
-
props: OIDCProviderProps
|
|
124
|
+
props: OIDCProviderProps,
|
|
125
125
|
) {
|
|
126
126
|
// Initialize AWS SDK client
|
|
127
127
|
const client = new IAMClient({
|
|
@@ -135,24 +135,24 @@ export const OIDCProvider = Resource(
|
|
|
135
135
|
const getRole = await client.send(
|
|
136
136
|
new GetRoleCommand({
|
|
137
137
|
RoleName: props.roleArn.split("/").pop(),
|
|
138
|
-
})
|
|
138
|
+
}),
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
if (getRole.Role?.AssumeRolePolicyDocument) {
|
|
142
142
|
const policy = JSON.parse(
|
|
143
|
-
decodeURIComponent(getRole.Role.AssumeRolePolicyDocument)
|
|
143
|
+
decodeURIComponent(getRole.Role.AssumeRolePolicyDocument),
|
|
144
144
|
);
|
|
145
145
|
|
|
146
146
|
// Remove our specific statement while preserving others
|
|
147
147
|
policy.Statement = policy.Statement.filter(
|
|
148
|
-
(stmt: any) => stmt.Sid !== TRUST_POLICY_SID
|
|
148
|
+
(stmt: any) => stmt.Sid !== TRUST_POLICY_SID,
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
await client.send(
|
|
152
152
|
new UpdateAssumeRolePolicyCommand({
|
|
153
153
|
RoleName: props.roleArn.split("/").pop(),
|
|
154
154
|
PolicyDocument: JSON.stringify(policy),
|
|
155
|
-
})
|
|
155
|
+
}),
|
|
156
156
|
);
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -160,7 +160,7 @@ export const OIDCProvider = Resource(
|
|
|
160
160
|
const provider = await client.send(
|
|
161
161
|
new GetOpenIDConnectProviderCommand({
|
|
162
162
|
OpenIDConnectProviderArn: this.output.providerArn,
|
|
163
|
-
})
|
|
163
|
+
}),
|
|
164
164
|
);
|
|
165
165
|
|
|
166
166
|
// Only delete the provider if it exists and has no other tags
|
|
@@ -168,7 +168,7 @@ export const OIDCProvider = Resource(
|
|
|
168
168
|
await client.send(
|
|
169
169
|
new DeleteOpenIDConnectProviderCommand({
|
|
170
170
|
OpenIDConnectProviderArn: this.output.providerArn,
|
|
171
|
-
})
|
|
171
|
+
}),
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
} catch (error) {
|
|
@@ -197,7 +197,7 @@ export const OIDCProvider = Resource(
|
|
|
197
197
|
Value: "alchemy",
|
|
198
198
|
},
|
|
199
199
|
] as Tag[],
|
|
200
|
-
})
|
|
200
|
+
}),
|
|
201
201
|
);
|
|
202
202
|
providerArn = createProvider.OpenIDConnectProviderArn!;
|
|
203
203
|
} catch (error: any) {
|
|
@@ -213,13 +213,13 @@ export const OIDCProvider = Resource(
|
|
|
213
213
|
const getRole = await client.send(
|
|
214
214
|
new GetRoleCommand({
|
|
215
215
|
RoleName: props.roleArn.split("/").pop(),
|
|
216
|
-
})
|
|
216
|
+
}),
|
|
217
217
|
);
|
|
218
218
|
|
|
219
219
|
let policy: any;
|
|
220
220
|
if (getRole.Role?.AssumeRolePolicyDocument) {
|
|
221
221
|
policy = JSON.parse(
|
|
222
|
-
decodeURIComponent(getRole.Role.AssumeRolePolicyDocument)
|
|
222
|
+
decodeURIComponent(getRole.Role.AssumeRolePolicyDocument),
|
|
223
223
|
);
|
|
224
224
|
} else {
|
|
225
225
|
policy = {
|
|
@@ -240,7 +240,7 @@ export const OIDCProvider = Resource(
|
|
|
240
240
|
conditions.StringEquals["token.actions.githubusercontent.com:sub"] =
|
|
241
241
|
props.branches.map(
|
|
242
242
|
(branch) =>
|
|
243
|
-
`repo:${props.owner}/${props.repository}:ref:refs/heads/${branch}
|
|
243
|
+
`repo:${props.owner}/${props.repository}:ref:refs/heads/${branch}`,
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -248,7 +248,7 @@ export const OIDCProvider = Resource(
|
|
|
248
248
|
conditions.StringEquals["token.actions.githubusercontent.com:sub"] =
|
|
249
249
|
props.environments.map(
|
|
250
250
|
(env) =>
|
|
251
|
-
`repo:${props.owner}/${props.repository}:environment:${env}
|
|
251
|
+
`repo:${props.owner}/${props.repository}:environment:${env}`,
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -266,7 +266,7 @@ export const OIDCProvider = Resource(
|
|
|
266
266
|
// Remove any existing statement with our SID and add the new one
|
|
267
267
|
policy.Statement = [
|
|
268
268
|
...policy.Statement.filter(
|
|
269
|
-
(stmt: any) => stmt.Sid !== TRUST_POLICY_SID
|
|
269
|
+
(stmt: any) => stmt.Sid !== TRUST_POLICY_SID,
|
|
270
270
|
),
|
|
271
271
|
ourStatement,
|
|
272
272
|
];
|
|
@@ -276,7 +276,7 @@ export const OIDCProvider = Resource(
|
|
|
276
276
|
new UpdateAssumeRolePolicyCommand({
|
|
277
277
|
RoleName: props.roleArn.split("/").pop(),
|
|
278
278
|
PolicyDocument: JSON.stringify(policy),
|
|
279
|
-
})
|
|
279
|
+
}),
|
|
280
280
|
);
|
|
281
281
|
|
|
282
282
|
return this({
|
|
@@ -288,5 +288,5 @@ export const OIDCProvider = Resource(
|
|
|
288
288
|
console.error("Error configuring OIDC provider:", error);
|
|
289
289
|
throw error;
|
|
290
290
|
}
|
|
291
|
-
}
|
|
291
|
+
},
|
|
292
292
|
);
|
|
@@ -66,7 +66,7 @@ export const PolicyAttachment = Resource(
|
|
|
66
66
|
async function (
|
|
67
67
|
this: Context<PolicyAttachment>,
|
|
68
68
|
id: string,
|
|
69
|
-
props: PolicyAttachmentProps
|
|
69
|
+
props: PolicyAttachmentProps,
|
|
70
70
|
) {
|
|
71
71
|
const client = new IAMClient({});
|
|
72
72
|
|
|
@@ -76,19 +76,18 @@ export const PolicyAttachment = Resource(
|
|
|
76
76
|
new DetachRolePolicyCommand({
|
|
77
77
|
PolicyArn: props.policyArn,
|
|
78
78
|
RoleName: props.roleName,
|
|
79
|
-
})
|
|
80
|
-
)
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
81
81
|
);
|
|
82
82
|
return this.destroy();
|
|
83
|
-
} else {
|
|
84
|
-
await client.send(
|
|
85
|
-
new AttachRolePolicyCommand({
|
|
86
|
-
PolicyArn: props.policyArn,
|
|
87
|
-
RoleName: props.roleName,
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
83
|
}
|
|
84
|
+
await client.send(
|
|
85
|
+
new AttachRolePolicyCommand({
|
|
86
|
+
PolicyArn: props.policyArn,
|
|
87
|
+
RoleName: props.roleName,
|
|
88
|
+
}),
|
|
89
|
+
);
|
|
91
90
|
|
|
92
91
|
return this(props);
|
|
93
|
-
}
|
|
92
|
+
},
|
|
94
93
|
);
|
package/src/aws/policy.ts
CHANGED
|
@@ -230,7 +230,7 @@ export const Policy = Resource(
|
|
|
230
230
|
async function (
|
|
231
231
|
this: Context<Policy>,
|
|
232
232
|
id: string,
|
|
233
|
-
props: PolicyProps
|
|
233
|
+
props: PolicyProps,
|
|
234
234
|
): Promise<Policy> {
|
|
235
235
|
const client = new IAMClient({});
|
|
236
236
|
const policyArn = `arn:aws:iam::${process.env.AWS_ACCOUNT_ID}:policy${props.path || "/"}${props.policyName}`;
|
|
@@ -241,7 +241,7 @@ export const Policy = Resource(
|
|
|
241
241
|
const versions = await client.send(
|
|
242
242
|
new ListPolicyVersionsCommand({
|
|
243
243
|
PolicyArn: policyArn,
|
|
244
|
-
})
|
|
244
|
+
}),
|
|
245
245
|
);
|
|
246
246
|
|
|
247
247
|
for (const version of versions.Versions || []) {
|
|
@@ -250,7 +250,7 @@ export const Policy = Resource(
|
|
|
250
250
|
new DeletePolicyVersionCommand({
|
|
251
251
|
PolicyArn: policyArn,
|
|
252
252
|
VersionId: version.VersionId,
|
|
253
|
-
})
|
|
253
|
+
}),
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
@@ -259,7 +259,7 @@ export const Policy = Resource(
|
|
|
259
259
|
await client.send(
|
|
260
260
|
new DeletePolicyCommand({
|
|
261
261
|
PolicyArn: policyArn,
|
|
262
|
-
})
|
|
262
|
+
}),
|
|
263
263
|
);
|
|
264
264
|
} catch (error: any) {
|
|
265
265
|
if (error.name !== NoSuchEntityException.name) {
|
|
@@ -267,109 +267,106 @@ export const Policy = Resource(
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return this.destroy();
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
270
|
+
}
|
|
271
|
+
try {
|
|
272
|
+
// Check if policy exists
|
|
273
|
+
const existingPolicy = await client.send(
|
|
274
|
+
new GetPolicyCommand({
|
|
275
|
+
PolicyArn: policyArn,
|
|
276
|
+
}),
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
// Get current policy version
|
|
280
|
+
const currentVersion = await client.send(
|
|
281
|
+
new GetPolicyVersionCommand({
|
|
282
|
+
PolicyArn: policyArn,
|
|
283
|
+
VersionId: existingPolicy.Policy!.DefaultVersionId!,
|
|
284
|
+
}),
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
const currentDocument = JSON.parse(
|
|
288
|
+
decodeURIComponent(currentVersion.PolicyVersion!.Document!),
|
|
289
|
+
);
|
|
290
|
+
|
|
291
|
+
// If policy document changed, create new version
|
|
292
|
+
if (JSON.stringify(currentDocument) !== JSON.stringify(props.document)) {
|
|
293
|
+
// List versions to check if we need to delete old ones
|
|
294
|
+
const versions = await client.send(
|
|
295
|
+
new ListPolicyVersionsCommand({
|
|
282
296
|
PolicyArn: policyArn,
|
|
283
|
-
|
|
284
|
-
})
|
|
297
|
+
}),
|
|
285
298
|
);
|
|
286
299
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
300
|
+
// Delete oldest version if we have 5 versions (maximum allowed)
|
|
301
|
+
if (versions.Versions?.length === 5) {
|
|
302
|
+
const oldestVersion = versions.Versions.sort(
|
|
303
|
+
(a, b) => a.CreateDate!.getTime() - b.CreateDate!.getTime(),
|
|
304
|
+
)[0];
|
|
290
305
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
PolicyArn: policyArn,
|
|
299
|
-
})
|
|
300
|
-
);
|
|
301
|
-
|
|
302
|
-
// Delete oldest version if we have 5 versions (maximum allowed)
|
|
303
|
-
if (versions.Versions?.length === 5) {
|
|
304
|
-
const oldestVersion = versions.Versions.sort(
|
|
305
|
-
(a, b) => a.CreateDate!.getTime() - b.CreateDate!.getTime()
|
|
306
|
-
)[0];
|
|
307
|
-
|
|
308
|
-
if (!oldestVersion.IsDefaultVersion) {
|
|
309
|
-
await client.send(
|
|
310
|
-
new DeletePolicyVersionCommand({
|
|
311
|
-
PolicyArn: policyArn,
|
|
312
|
-
VersionId: oldestVersion.VersionId!,
|
|
313
|
-
})
|
|
314
|
-
);
|
|
315
|
-
}
|
|
306
|
+
if (!oldestVersion.IsDefaultVersion) {
|
|
307
|
+
await client.send(
|
|
308
|
+
new DeletePolicyVersionCommand({
|
|
309
|
+
PolicyArn: policyArn,
|
|
310
|
+
VersionId: oldestVersion.VersionId!,
|
|
311
|
+
}),
|
|
312
|
+
);
|
|
316
313
|
}
|
|
317
|
-
|
|
318
|
-
// Create new version
|
|
319
|
-
await client.send(
|
|
320
|
-
new CreatePolicyVersionCommand({
|
|
321
|
-
PolicyArn: policyArn,
|
|
322
|
-
PolicyDocument: JSON.stringify(props.document),
|
|
323
|
-
SetAsDefault: true,
|
|
324
|
-
})
|
|
325
|
-
);
|
|
326
314
|
}
|
|
327
315
|
|
|
328
|
-
|
|
329
|
-
|
|
316
|
+
// Create new version
|
|
317
|
+
await client.send(
|
|
318
|
+
new CreatePolicyVersionCommand({
|
|
330
319
|
PolicyArn: policyArn,
|
|
331
|
-
|
|
320
|
+
PolicyDocument: JSON.stringify(props.document),
|
|
321
|
+
SetAsDefault: true,
|
|
322
|
+
}),
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const policy = await client.send(
|
|
327
|
+
new GetPolicyCommand({
|
|
328
|
+
PolicyArn: policyArn,
|
|
329
|
+
}),
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
return this({
|
|
333
|
+
...props,
|
|
334
|
+
arn: policy.Policy!.Arn!,
|
|
335
|
+
defaultVersionId: policy.Policy!.DefaultVersionId!,
|
|
336
|
+
attachmentCount: policy.Policy!.AttachmentCount!,
|
|
337
|
+
createDate: policy.Policy!.CreateDate!,
|
|
338
|
+
updateDate: policy.Policy!.UpdateDate!,
|
|
339
|
+
isAttachable: policy.Policy!.IsAttachable!,
|
|
340
|
+
});
|
|
341
|
+
} catch (error: any) {
|
|
342
|
+
if (error.name === "NoSuchEntity") {
|
|
343
|
+
// Create new policy
|
|
344
|
+
const newPolicy = await client.send(
|
|
345
|
+
new CreatePolicyCommand({
|
|
346
|
+
PolicyName: props.policyName,
|
|
347
|
+
PolicyDocument: JSON.stringify(props.document),
|
|
348
|
+
Description: props.description,
|
|
349
|
+
Path: props.path,
|
|
350
|
+
Tags: props.tags
|
|
351
|
+
? Object.entries(props.tags).map(([Key, Value]) => ({
|
|
352
|
+
Key,
|
|
353
|
+
Value,
|
|
354
|
+
}))
|
|
355
|
+
: undefined,
|
|
356
|
+
}),
|
|
332
357
|
);
|
|
333
358
|
|
|
334
359
|
return this({
|
|
335
360
|
...props,
|
|
336
|
-
arn:
|
|
337
|
-
defaultVersionId:
|
|
338
|
-
attachmentCount:
|
|
339
|
-
createDate:
|
|
340
|
-
updateDate:
|
|
341
|
-
isAttachable:
|
|
361
|
+
arn: newPolicy.Policy!.Arn!,
|
|
362
|
+
defaultVersionId: newPolicy.Policy!.DefaultVersionId!,
|
|
363
|
+
attachmentCount: newPolicy.Policy!.AttachmentCount!,
|
|
364
|
+
createDate: newPolicy.Policy!.CreateDate!,
|
|
365
|
+
updateDate: newPolicy.Policy!.UpdateDate!,
|
|
366
|
+
isAttachable: newPolicy.Policy!.IsAttachable!,
|
|
342
367
|
});
|
|
343
|
-
} catch (error: any) {
|
|
344
|
-
if (error.name === "NoSuchEntity") {
|
|
345
|
-
// Create new policy
|
|
346
|
-
const newPolicy = await client.send(
|
|
347
|
-
new CreatePolicyCommand({
|
|
348
|
-
PolicyName: props.policyName,
|
|
349
|
-
PolicyDocument: JSON.stringify(props.document),
|
|
350
|
-
Description: props.description,
|
|
351
|
-
Path: props.path,
|
|
352
|
-
Tags: props.tags
|
|
353
|
-
? Object.entries(props.tags).map(([Key, Value]) => ({
|
|
354
|
-
Key,
|
|
355
|
-
Value,
|
|
356
|
-
}))
|
|
357
|
-
: undefined,
|
|
358
|
-
})
|
|
359
|
-
);
|
|
360
|
-
|
|
361
|
-
return this({
|
|
362
|
-
...props,
|
|
363
|
-
arn: newPolicy.Policy!.Arn!,
|
|
364
|
-
defaultVersionId: newPolicy.Policy!.DefaultVersionId!,
|
|
365
|
-
attachmentCount: newPolicy.Policy!.AttachmentCount!,
|
|
366
|
-
createDate: newPolicy.Policy!.CreateDate!,
|
|
367
|
-
updateDate: newPolicy.Policy!.UpdateDate!,
|
|
368
|
-
isAttachable: newPolicy.Policy!.IsAttachable!,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
throw error;
|
|
372
368
|
}
|
|
369
|
+
throw error;
|
|
373
370
|
}
|
|
374
|
-
}
|
|
371
|
+
},
|
|
375
372
|
);
|
package/src/aws/queue.ts
CHANGED
|
@@ -137,7 +137,7 @@ export const Queue = Resource(
|
|
|
137
137
|
async function (
|
|
138
138
|
this: Context<Queue>,
|
|
139
139
|
id: string,
|
|
140
|
-
props: QueueProps
|
|
140
|
+
props: QueueProps,
|
|
141
141
|
): Promise<Queue> {
|
|
142
142
|
const client = new SQSClient({});
|
|
143
143
|
// Don't automatically add .fifo suffix - user must include it in queueName
|
|
@@ -154,14 +154,14 @@ export const Queue = Resource(
|
|
|
154
154
|
const urlResponse = await client.send(
|
|
155
155
|
new GetQueueUrlCommand({
|
|
156
156
|
QueueName: queueName,
|
|
157
|
-
})
|
|
157
|
+
}),
|
|
158
158
|
);
|
|
159
159
|
|
|
160
160
|
// Delete the queue
|
|
161
161
|
await client.send(
|
|
162
162
|
new DeleteQueueCommand({
|
|
163
163
|
QueueUrl: urlResponse.QueueUrl,
|
|
164
|
-
})
|
|
164
|
+
}),
|
|
165
165
|
);
|
|
166
166
|
|
|
167
167
|
// Wait for queue to be deleted
|
|
@@ -171,7 +171,7 @@ export const Queue = Resource(
|
|
|
171
171
|
await client.send(
|
|
172
172
|
new GetQueueUrlCommand({
|
|
173
173
|
QueueName: queueName,
|
|
174
|
-
})
|
|
174
|
+
}),
|
|
175
175
|
);
|
|
176
176
|
// If we get here, queue still exists
|
|
177
177
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
@@ -190,140 +190,140 @@ export const Queue = Resource(
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return this.destroy();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
}
|
|
194
|
+
// Create queue with attributes
|
|
195
|
+
const attributes: Record<string, string> = {};
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
if (props.visibilityTimeout !== undefined) {
|
|
198
|
+
attributes.VisibilityTimeout = props.visibilityTimeout.toString();
|
|
199
|
+
}
|
|
200
|
+
if (props.messageRetentionPeriod !== undefined) {
|
|
201
|
+
attributes.MessageRetentionPeriod =
|
|
202
|
+
props.messageRetentionPeriod.toString();
|
|
203
|
+
}
|
|
204
|
+
if (props.maximumMessageSize !== undefined) {
|
|
205
|
+
attributes.MaximumMessageSize = props.maximumMessageSize.toString();
|
|
206
|
+
}
|
|
207
|
+
if (props.delaySeconds !== undefined) {
|
|
208
|
+
attributes.DelaySeconds = props.delaySeconds.toString();
|
|
209
|
+
}
|
|
210
|
+
if (props.receiveMessageWaitTimeSeconds !== undefined) {
|
|
211
|
+
attributes.ReceiveMessageWaitTimeSeconds =
|
|
212
|
+
props.receiveMessageWaitTimeSeconds.toString();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// FIFO specific attributes
|
|
216
|
+
if (props.fifo) {
|
|
217
|
+
attributes.FifoQueue = "true";
|
|
218
|
+
if (props.contentBasedDeduplication) {
|
|
219
|
+
attributes.ContentBasedDeduplication = "true";
|
|
206
220
|
}
|
|
207
|
-
if (props.
|
|
208
|
-
attributes
|
|
221
|
+
if (props.deduplicationScope) {
|
|
222
|
+
attributes.DeduplicationScope = props.deduplicationScope;
|
|
209
223
|
}
|
|
210
|
-
if (props.
|
|
211
|
-
attributes
|
|
212
|
-
props.receiveMessageWaitTimeSeconds.toString();
|
|
224
|
+
if (props.fifoThroughputLimit) {
|
|
225
|
+
attributes.FifoThroughputLimit = props.fifoThroughputLimit;
|
|
213
226
|
}
|
|
227
|
+
}
|
|
214
228
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
attributes["DeduplicationScope"] = props.deduplicationScope;
|
|
223
|
-
}
|
|
224
|
-
if (props.fifoThroughputLimit) {
|
|
225
|
-
attributes["FifoThroughputLimit"] = props.fifoThroughputLimit;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
229
|
+
// Convert tags to AWS format
|
|
230
|
+
const tags = props.tags
|
|
231
|
+
? Object.entries(props.tags).reduce(
|
|
232
|
+
(acc, [key, value]) => ({ ...acc, [key]: value }),
|
|
233
|
+
{},
|
|
234
|
+
)
|
|
235
|
+
: undefined;
|
|
228
236
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
try {
|
|
238
|
+
// Create the queue
|
|
239
|
+
const createResponse = await client.send(
|
|
240
|
+
new CreateQueueCommand({
|
|
241
|
+
QueueName: queueName,
|
|
242
|
+
Attributes: attributes,
|
|
243
|
+
tags,
|
|
244
|
+
}),
|
|
245
|
+
);
|
|
236
246
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
247
|
+
// Get queue attributes
|
|
248
|
+
const attributesResponse = await client.send(
|
|
249
|
+
new GetQueueAttributesCommand({
|
|
250
|
+
QueueUrl: createResponse.QueueUrl,
|
|
251
|
+
AttributeNames: ["QueueArn"],
|
|
252
|
+
}),
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
return this({
|
|
256
|
+
...props,
|
|
257
|
+
arn: attributesResponse.Attributes!.QueueArn!,
|
|
258
|
+
url: createResponse.QueueUrl!,
|
|
259
|
+
});
|
|
260
|
+
} catch (error: any) {
|
|
261
|
+
if (error.name === "QueueAlreadyExists") {
|
|
262
|
+
// Get existing queue URL
|
|
263
|
+
const urlResponse = await client.send(
|
|
264
|
+
new GetQueueUrlCommand({
|
|
241
265
|
QueueName: queueName,
|
|
242
|
-
|
|
243
|
-
tags,
|
|
244
|
-
})
|
|
266
|
+
}),
|
|
245
267
|
);
|
|
246
268
|
|
|
247
269
|
// Get queue attributes
|
|
248
270
|
const attributesResponse = await client.send(
|
|
249
271
|
new GetQueueAttributesCommand({
|
|
250
|
-
QueueUrl:
|
|
272
|
+
QueueUrl: urlResponse.QueueUrl,
|
|
251
273
|
AttributeNames: ["QueueArn"],
|
|
252
|
-
})
|
|
274
|
+
}),
|
|
253
275
|
);
|
|
254
276
|
|
|
255
277
|
return this({
|
|
256
278
|
...props,
|
|
257
279
|
arn: attributesResponse.Attributes!.QueueArn!,
|
|
258
|
-
url:
|
|
280
|
+
url: urlResponse.QueueUrl!,
|
|
259
281
|
});
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
QueueName: queueName,
|
|
266
|
-
})
|
|
267
|
-
);
|
|
268
|
-
|
|
269
|
-
// Get queue attributes
|
|
270
|
-
const attributesResponse = await client.send(
|
|
271
|
-
new GetQueueAttributesCommand({
|
|
272
|
-
QueueUrl: urlResponse.QueueUrl,
|
|
273
|
-
AttributeNames: ["QueueArn"],
|
|
274
|
-
})
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
return this({
|
|
278
|
-
...props,
|
|
279
|
-
arn: attributesResponse.Attributes!.QueueArn!,
|
|
280
|
-
url: urlResponse.QueueUrl!,
|
|
281
|
-
});
|
|
282
|
-
} else if (error.name === "QueueDeletedRecently") {
|
|
283
|
-
// Queue was recently deleted, wait and retry
|
|
284
|
-
const maxRetries = 3;
|
|
285
|
-
let retryCount = 0;
|
|
282
|
+
}
|
|
283
|
+
if (error.name === "QueueDeletedRecently") {
|
|
284
|
+
// Queue was recently deleted, wait and retry
|
|
285
|
+
const maxRetries = 3;
|
|
286
|
+
let retryCount = 0;
|
|
286
287
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
while (retryCount < maxRetries) {
|
|
289
|
+
try {
|
|
290
|
+
// Wait for 60 seconds before retrying
|
|
291
|
+
await new Promise((resolve) => setTimeout(resolve, 61000));
|
|
291
292
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
293
|
+
// Retry creating the queue
|
|
294
|
+
const createResponse = await client.send(
|
|
295
|
+
new CreateQueueCommand({
|
|
296
|
+
QueueName: queueName,
|
|
297
|
+
Attributes: attributes,
|
|
298
|
+
tags,
|
|
299
|
+
}),
|
|
300
|
+
);
|
|
300
301
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
302
|
+
// Get queue attributes
|
|
303
|
+
const attributesResponse = await client.send(
|
|
304
|
+
new GetQueueAttributesCommand({
|
|
305
|
+
QueueUrl: createResponse.QueueUrl,
|
|
306
|
+
AttributeNames: ["QueueArn"],
|
|
307
|
+
}),
|
|
308
|
+
);
|
|
308
309
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
retryCount++;
|
|
310
|
+
return this({
|
|
311
|
+
...props,
|
|
312
|
+
arn: attributesResponse.Attributes!.QueueArn!,
|
|
313
|
+
url: createResponse.QueueUrl!,
|
|
314
|
+
});
|
|
315
|
+
} catch (retryError: any) {
|
|
316
|
+
if (
|
|
317
|
+
retryError.name !== "QueueDeletedRecently" ||
|
|
318
|
+
retryCount === maxRetries - 1
|
|
319
|
+
) {
|
|
320
|
+
throw retryError;
|
|
322
321
|
}
|
|
322
|
+
retryCount++;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
throw error;
|
|
326
325
|
}
|
|
326
|
+
throw error;
|
|
327
327
|
}
|
|
328
|
-
}
|
|
328
|
+
},
|
|
329
329
|
);
|