alchemy-effect 0.1.0 → 0.3.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/bin/alchemy-effect.js +55038 -8
- package/bin/alchemy-effect.js.map +1 -1
- package/bin/alchemy-effect.ts +266 -10
- package/lib/$.d.ts +5 -0
- package/lib/$.d.ts.map +1 -0
- package/lib/$.js +9 -0
- package/lib/$.js.map +1 -0
- package/lib/app.d.ts +7 -15
- package/lib/app.d.ts.map +1 -1
- package/lib/app.js +1 -20
- package/lib/app.js.map +1 -1
- package/lib/apply.d.ts +15 -19
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +173 -82
- package/lib/apply.js.map +1 -1
- package/lib/assert-never.d.ts +12 -0
- package/lib/assert-never.d.ts.map +1 -0
- package/lib/assert-never.js +11 -0
- package/lib/assert-never.js.map +1 -0
- package/lib/aws/account.d.ts +13 -3
- package/lib/aws/account.d.ts.map +1 -1
- package/lib/aws/account.js +19 -4
- package/lib/aws/account.js.map +1 -1
- package/lib/aws/arn.d.ts +1 -5
- package/lib/aws/arn.d.ts.map +1 -1
- package/lib/aws/client.d.ts.map +1 -1
- package/lib/aws/client.js +8 -1
- package/lib/aws/client.js.map +1 -1
- package/lib/aws/config.d.ts +15 -0
- package/lib/aws/config.d.ts.map +1 -0
- package/lib/aws/config.js +1 -0
- package/lib/aws/config.js.map +1 -0
- package/lib/aws/credentials.d.ts +11 -1
- package/lib/aws/credentials.d.ts.map +1 -1
- package/lib/aws/credentials.js +73 -47
- package/lib/aws/credentials.js.map +1 -1
- package/lib/aws/dynamodb/attribute-value.d.ts +20 -0
- package/lib/aws/dynamodb/attribute-value.d.ts.map +1 -0
- package/lib/aws/dynamodb/attribute-value.js +217 -0
- package/lib/aws/dynamodb/attribute-value.js.map +1 -0
- package/lib/aws/dynamodb/client.d.ts +12 -0
- package/lib/aws/dynamodb/client.d.ts.map +1 -0
- package/lib/aws/{sqs/queue.client.js → dynamodb/client.js} +6 -6
- package/lib/aws/dynamodb/client.js.map +1 -0
- package/lib/aws/dynamodb/expr.d.ts +41 -0
- package/lib/aws/dynamodb/expr.d.ts.map +1 -0
- package/lib/aws/dynamodb/expr.js +1 -0
- package/lib/aws/dynamodb/expr.js.map +1 -0
- package/lib/aws/dynamodb/index.d.ts +10 -0
- package/lib/aws/dynamodb/index.d.ts.map +1 -0
- package/lib/aws/dynamodb/index.js +9 -0
- package/lib/aws/dynamodb/index.js.map +1 -0
- package/lib/aws/dynamodb/projection.d.ts +25 -0
- package/lib/aws/dynamodb/projection.d.ts.map +1 -0
- package/lib/aws/dynamodb/projection.js +1 -0
- package/lib/aws/dynamodb/projection.js.map +1 -0
- package/lib/aws/dynamodb/secondary-index.d.ts +26 -0
- package/lib/aws/dynamodb/secondary-index.d.ts.map +1 -0
- package/lib/aws/dynamodb/secondary-index.js +4 -0
- package/lib/aws/dynamodb/secondary-index.js.map +1 -0
- package/lib/aws/dynamodb/table.d.ts +59 -0
- package/lib/aws/dynamodb/table.d.ts.map +1 -0
- package/lib/aws/dynamodb/table.get-item.d.ts +57 -0
- package/lib/aws/dynamodb/table.get-item.d.ts.map +1 -0
- package/lib/aws/dynamodb/table.get-item.js +77 -0
- package/lib/aws/dynamodb/table.get-item.js.map +1 -0
- package/lib/aws/dynamodb/table.js +4 -0
- package/lib/aws/dynamodb/table.js.map +1 -0
- package/lib/aws/dynamodb/table.provider.d.ts +7 -0
- package/lib/aws/dynamodb/table.provider.d.ts.map +1 -0
- package/lib/aws/dynamodb/table.provider.js +187 -0
- package/lib/aws/dynamodb/table.provider.js.map +1 -0
- package/lib/aws/ec2/client.d.ts +12 -0
- package/lib/aws/ec2/client.d.ts.map +1 -0
- package/lib/aws/ec2/client.js +11 -0
- package/lib/aws/ec2/client.js.map +1 -0
- package/lib/aws/ec2/index.d.ts +7 -0
- package/lib/aws/ec2/index.d.ts.map +1 -0
- package/lib/aws/ec2/index.js +7 -0
- package/lib/aws/ec2/index.js.map +1 -0
- package/lib/aws/ec2/subnet.d.ts +175 -0
- package/lib/aws/ec2/subnet.d.ts.map +1 -0
- package/lib/aws/ec2/subnet.js +4 -0
- package/lib/aws/ec2/subnet.js.map +1 -0
- package/lib/aws/ec2/subnet.provider.d.ts +4 -0
- package/lib/aws/ec2/subnet.provider.d.ts.map +1 -0
- package/lib/aws/ec2/subnet.provider.js +250 -0
- package/lib/aws/ec2/subnet.provider.js.map +1 -0
- package/lib/aws/ec2/vpc.d.ts +135 -0
- package/lib/aws/ec2/vpc.d.ts.map +1 -0
- package/lib/aws/ec2/vpc.js +4 -0
- package/lib/aws/ec2/vpc.js.map +1 -0
- package/lib/aws/ec2/vpc.provider.d.ts +6 -0
- package/lib/aws/ec2/vpc.provider.d.ts.map +1 -0
- package/lib/aws/ec2/vpc.provider.js +183 -0
- package/lib/aws/ec2/vpc.provider.js.map +1 -0
- package/lib/aws/index.d.ts +23 -16
- package/lib/aws/index.d.ts.map +1 -1
- package/lib/aws/index.js +10 -18
- package/lib/aws/index.js.map +1 -1
- package/lib/aws/lambda/client.d.ts +8 -0
- package/lib/aws/lambda/client.d.ts.map +1 -0
- package/lib/aws/lambda/client.js +7 -0
- package/lib/aws/lambda/client.js.map +1 -0
- package/lib/aws/lambda/consume.d.ts +10 -11
- package/lib/aws/lambda/consume.d.ts.map +1 -1
- package/lib/aws/lambda/consume.js +3 -3
- package/lib/aws/lambda/consume.js.map +1 -1
- package/lib/aws/lambda/function.d.ts +18 -15
- package/lib/aws/lambda/function.d.ts.map +1 -1
- package/lib/aws/lambda/function.handler.d.ts +1 -1
- package/lib/aws/lambda/function.handler.d.ts.map +1 -1
- package/lib/aws/lambda/function.handler.js.map +1 -1
- package/lib/aws/lambda/function.invoke.d.ts +7 -5
- package/lib/aws/lambda/function.invoke.d.ts.map +1 -1
- package/lib/aws/lambda/function.invoke.js +5 -3
- package/lib/aws/lambda/function.invoke.js.map +1 -1
- package/lib/aws/lambda/function.js +1 -1
- package/lib/aws/lambda/function.js.map +1 -1
- package/lib/aws/lambda/function.provider.d.ts +6 -5
- package/lib/aws/lambda/function.provider.d.ts.map +1 -1
- package/lib/aws/lambda/function.provider.js +150 -58
- package/lib/aws/lambda/function.provider.js.map +1 -1
- package/lib/aws/lambda/index.d.ts +2 -2
- package/lib/aws/lambda/index.d.ts.map +1 -1
- package/lib/aws/lambda/index.js +2 -1
- package/lib/aws/lambda/index.js.map +1 -1
- package/lib/aws/lambda/serve.d.ts +2 -4
- package/lib/aws/lambda/serve.d.ts.map +1 -1
- package/lib/aws/lambda/serve.js.map +1 -1
- package/lib/aws/profile.d.ts +2 -2
- package/lib/aws/profile.d.ts.map +1 -1
- package/lib/aws/profile.js +1 -1
- package/lib/aws/profile.js.map +1 -1
- package/lib/aws/region.d.ts +14 -1
- package/lib/aws/region.d.ts.map +1 -1
- package/lib/aws/region.js +26 -1
- package/lib/aws/region.js.map +1 -1
- package/lib/aws/sqs/client.d.ts +12 -0
- package/lib/aws/sqs/client.d.ts.map +1 -0
- package/lib/aws/sqs/client.js +11 -0
- package/lib/aws/sqs/client.js.map +1 -0
- package/lib/aws/sqs/index.d.ts +3 -1
- package/lib/aws/sqs/index.d.ts.map +1 -1
- package/lib/aws/sqs/index.js +3 -1
- package/lib/aws/sqs/index.js.map +1 -1
- package/lib/aws/sqs/queue.consume.d.ts +1 -10
- package/lib/aws/sqs/queue.consume.d.ts.map +1 -1
- package/lib/aws/sqs/queue.consume.js +0 -19
- package/lib/aws/sqs/queue.consume.js.map +1 -1
- package/lib/aws/sqs/queue.d.ts +6 -12
- package/lib/aws/sqs/queue.d.ts.map +1 -1
- package/lib/aws/sqs/queue.event-source.d.ts +22 -0
- package/lib/aws/sqs/queue.event-source.d.ts.map +1 -0
- package/lib/aws/sqs/queue.event-source.js +130 -0
- package/lib/aws/sqs/queue.event-source.js.map +1 -0
- package/lib/aws/sqs/queue.js +1 -1
- package/lib/aws/sqs/queue.js.map +1 -1
- package/lib/aws/sqs/queue.provider.d.ts +5 -4
- package/lib/aws/sqs/queue.provider.d.ts.map +1 -1
- package/lib/aws/sqs/queue.provider.js +6 -6
- package/lib/aws/sqs/queue.provider.js.map +1 -1
- package/lib/aws/sqs/queue.send-message.d.ts +8 -6
- package/lib/aws/sqs/queue.send-message.d.ts.map +1 -1
- package/lib/aws/sqs/queue.send-message.js +6 -4
- package/lib/aws/sqs/queue.send-message.js.map +1 -1
- package/lib/binding.d.ts +74 -26
- package/lib/binding.d.ts.map +1 -1
- package/lib/binding.js.map +1 -1
- package/lib/capability.d.ts +38 -0
- package/lib/capability.d.ts.map +1 -1
- package/lib/cli/components/ApprovePlan.d.ts +2 -2
- package/lib/cli/components/ApprovePlan.d.ts.map +1 -1
- package/lib/cli/components/ApprovePlan.js.map +1 -1
- package/lib/cli/components/Plan.d.ts +2 -2
- package/lib/cli/components/Plan.d.ts.map +1 -1
- package/lib/cli/components/Plan.js +3 -1
- package/lib/cli/components/Plan.js.map +1 -1
- package/lib/cli/components/PlanProgress.d.ts +8 -4
- package/lib/cli/components/PlanProgress.d.ts.map +1 -1
- package/lib/cli/components/PlanProgress.js +11 -1
- package/lib/cli/components/PlanProgress.js.map +1 -1
- package/lib/cli/index.d.ts +342 -213
- package/lib/cli/index.d.ts.map +1 -1
- package/lib/cli/index.js +26047 -11403
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/ink-service.d.ts +4 -0
- package/lib/cli/ink-service.d.ts.map +1 -0
- package/lib/cli/ink-service.js +43 -0
- package/lib/cli/ink-service.js.map +1 -0
- package/lib/cli/service.d.ts +21 -0
- package/lib/cli/service.d.ts.map +1 -0
- package/lib/cli/service.js +5 -0
- package/lib/cli/service.js.map +1 -0
- package/lib/cloudflare/account.d.ts +10 -0
- package/lib/cloudflare/account.d.ts.map +1 -0
- package/lib/cloudflare/account.js +24 -0
- package/lib/cloudflare/account.js.map +1 -0
- package/lib/cloudflare/api.d.ts +31 -19
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +95 -29
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/config.d.ts +9 -0
- package/lib/cloudflare/config.d.ts.map +1 -0
- package/lib/cloudflare/config.js +1 -0
- package/lib/cloudflare/config.js.map +1 -0
- package/lib/cloudflare/context.d.ts +27 -0
- package/lib/cloudflare/context.d.ts.map +1 -0
- package/lib/cloudflare/context.js +24 -0
- package/lib/cloudflare/context.js.map +1 -0
- package/lib/cloudflare/index.d.ts +7 -4
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +7 -4
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/kv/index.d.ts +4 -0
- package/lib/cloudflare/kv/index.d.ts.map +1 -0
- package/lib/cloudflare/kv/index.js +4 -0
- package/lib/cloudflare/kv/index.js.map +1 -0
- package/lib/cloudflare/kv/namespace.binding.d.ts +10 -0
- package/lib/cloudflare/kv/namespace.binding.d.ts.map +1 -0
- package/lib/cloudflare/kv/namespace.binding.js +15 -0
- package/lib/cloudflare/kv/namespace.binding.js.map +1 -0
- package/lib/cloudflare/kv/namespace.client.d.ts +11 -0
- package/lib/cloudflare/kv/namespace.client.d.ts.map +1 -0
- package/lib/cloudflare/kv/namespace.client.js +31 -0
- package/lib/cloudflare/kv/namespace.client.js.map +1 -0
- package/lib/cloudflare/kv/namespace.d.ts +24 -0
- package/lib/cloudflare/kv/namespace.d.ts.map +1 -0
- package/lib/cloudflare/kv/namespace.js +3 -0
- package/lib/cloudflare/kv/namespace.js.map +1 -0
- package/lib/cloudflare/kv/namespace.provider.d.ts +6 -0
- package/lib/cloudflare/kv/namespace.provider.d.ts.map +1 -0
- package/lib/cloudflare/kv/namespace.provider.js +81 -0
- package/lib/cloudflare/kv/namespace.provider.js.map +1 -0
- package/lib/cloudflare/live.d.ts +11 -0
- package/lib/cloudflare/live.d.ts.map +1 -0
- package/lib/cloudflare/live.js +15 -0
- package/lib/cloudflare/live.js.map +1 -0
- package/lib/cloudflare/r2/bucket.binding.d.ts +10 -0
- package/lib/cloudflare/r2/bucket.binding.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.binding.js +18 -0
- package/lib/cloudflare/r2/bucket.binding.js.map +1 -0
- package/lib/cloudflare/r2/bucket.client.d.ts +8 -0
- package/lib/cloudflare/r2/bucket.client.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.client.js +9 -0
- package/lib/cloudflare/r2/bucket.client.js.map +1 -0
- package/lib/cloudflare/r2/bucket.d.ts +33 -0
- package/lib/cloudflare/r2/bucket.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.del.d.ts +4 -0
- package/lib/cloudflare/r2/bucket.del.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.del.js +7 -0
- package/lib/cloudflare/r2/bucket.del.js.map +1 -0
- package/lib/cloudflare/r2/bucket.get.d.ts +5 -0
- package/lib/cloudflare/r2/bucket.get.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.get.js +7 -0
- package/lib/cloudflare/r2/bucket.get.js.map +1 -0
- package/lib/cloudflare/r2/bucket.head.d.ts +4 -0
- package/lib/cloudflare/r2/bucket.head.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.head.js +7 -0
- package/lib/cloudflare/r2/bucket.head.js.map +1 -0
- package/lib/cloudflare/r2/bucket.js +3 -0
- package/lib/cloudflare/r2/bucket.js.map +1 -0
- package/lib/cloudflare/r2/bucket.list.d.ts +5 -0
- package/lib/cloudflare/r2/bucket.list.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.list.js +7 -0
- package/lib/cloudflare/r2/bucket.list.js.map +1 -0
- package/lib/cloudflare/r2/bucket.multipart.d.ts +19 -0
- package/lib/cloudflare/r2/bucket.multipart.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.multipart.js +25 -0
- package/lib/cloudflare/r2/bucket.multipart.js.map +1 -0
- package/lib/cloudflare/r2/bucket.provider.d.ts +6 -0
- package/lib/cloudflare/r2/bucket.provider.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.provider.js +67 -0
- package/lib/cloudflare/r2/bucket.provider.js.map +1 -0
- package/lib/cloudflare/r2/bucket.put.d.ts +6 -0
- package/lib/cloudflare/r2/bucket.put.d.ts.map +1 -0
- package/lib/cloudflare/r2/bucket.put.js +8 -0
- package/lib/cloudflare/r2/bucket.put.js.map +1 -0
- package/lib/cloudflare/r2/index.d.ts +10 -0
- package/lib/cloudflare/r2/index.d.ts.map +1 -0
- package/lib/cloudflare/r2/index.js +10 -0
- package/lib/cloudflare/r2/index.js.map +1 -0
- package/lib/cloudflare/stream.d.ts +10 -0
- package/lib/cloudflare/stream.d.ts.map +1 -0
- package/lib/cloudflare/stream.js +16 -0
- package/lib/cloudflare/stream.js.map +1 -0
- package/lib/cloudflare/worker/assets.fetch.d.ts +9 -0
- package/lib/cloudflare/worker/assets.fetch.d.ts.map +1 -0
- package/lib/cloudflare/worker/assets.fetch.js +12 -0
- package/lib/cloudflare/worker/assets.fetch.js.map +1 -0
- package/lib/cloudflare/worker/assets.provider.d.ts +66 -0
- package/lib/cloudflare/worker/assets.provider.d.ts.map +1 -0
- package/lib/cloudflare/worker/assets.provider.js +145 -0
- package/lib/cloudflare/worker/assets.provider.js.map +1 -0
- package/lib/cloudflare/worker/index.d.ts +5 -0
- package/lib/cloudflare/worker/index.d.ts.map +1 -0
- package/lib/cloudflare/worker/index.js +5 -0
- package/lib/cloudflare/worker/index.js.map +1 -0
- package/lib/cloudflare/worker/worker.d.ts +66 -0
- package/lib/cloudflare/worker/worker.d.ts.map +1 -0
- package/lib/cloudflare/worker/worker.handler.d.ts +11 -0
- package/lib/cloudflare/worker/worker.handler.d.ts.map +1 -0
- package/lib/cloudflare/worker/worker.handler.js +15 -0
- package/lib/cloudflare/worker/worker.handler.js.map +1 -0
- package/lib/cloudflare/worker/worker.js +4 -0
- package/lib/cloudflare/worker/worker.js.map +1 -0
- package/lib/cloudflare/worker/worker.provider.d.ts +11 -0
- package/lib/cloudflare/worker/worker.provider.d.ts.map +1 -0
- package/lib/cloudflare/worker/worker.provider.js +194 -0
- package/lib/cloudflare/worker/worker.provider.js.map +1 -0
- package/lib/cloudflare/worker/worker.serve.d.ts +39 -0
- package/lib/cloudflare/worker/worker.serve.d.ts.map +1 -0
- package/lib/cloudflare/worker/worker.serve.js +4 -0
- package/lib/cloudflare/worker/worker.serve.js.map +1 -0
- package/lib/data.d.ts +3 -0
- package/lib/data.d.ts.map +1 -0
- package/lib/data.js +8 -0
- package/lib/data.js.map +1 -0
- package/lib/destroy.d.ts +1 -3
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +2 -0
- package/lib/destroy.js.map +1 -1
- package/lib/diff.d.ts +16 -0
- package/lib/diff.d.ts.map +1 -0
- package/lib/diff.js +9 -0
- package/lib/diff.js.map +1 -0
- package/lib/dot-alchemy.d.ts +3 -2
- package/lib/dot-alchemy.d.ts.map +1 -1
- package/lib/dot-alchemy.js +3 -2
- package/lib/dot-alchemy.js.map +1 -1
- package/lib/env.d.ts +5 -0
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +15 -29
- package/lib/env.js.map +1 -1
- package/lib/esbuild.d.ts +28 -0
- package/lib/esbuild.d.ts.map +1 -0
- package/lib/esbuild.js +63 -0
- package/lib/esbuild.js.map +1 -0
- package/lib/exports.d.ts +9 -0
- package/lib/exports.d.ts.map +1 -0
- package/lib/exports.js +13 -0
- package/lib/exports.js.map +1 -0
- package/lib/index.d.ts +11 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -5
- package/lib/index.js.map +1 -1
- package/lib/input.d.ts +32 -0
- package/lib/input.d.ts.map +1 -0
- package/lib/input.js +1 -0
- package/lib/input.js.map +1 -0
- package/lib/output.d.ts +143 -0
- package/lib/output.d.ts.map +1 -0
- package/lib/output.js +269 -0
- package/lib/output.js.map +1 -0
- package/lib/plan.d.ts +59 -29
- package/lib/plan.d.ts.map +1 -1
- package/lib/plan.js +347 -169
- package/lib/plan.js.map +1 -1
- package/lib/policy.d.ts +22 -5
- package/lib/policy.d.ts.map +1 -1
- package/lib/policy.js +10 -2
- package/lib/policy.js.map +1 -1
- package/lib/provider.d.ts +16 -18
- package/lib/provider.d.ts.map +1 -1
- package/lib/ref.d.ts +14 -0
- package/lib/ref.d.ts.map +1 -0
- package/lib/ref.js +21 -0
- package/lib/ref.js.map +1 -0
- package/lib/resource.d.ts +13 -16
- package/lib/resource.d.ts.map +1 -1
- package/lib/resource.js +1 -0
- package/lib/resource.js.map +1 -1
- package/lib/runtime.d.ts +8 -7
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/lib/schema.d.ts +37 -0
- package/lib/schema.d.ts.map +1 -0
- package/lib/schema.js +61 -0
- package/lib/schema.js.map +1 -0
- package/lib/service.d.ts +9 -6
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js.map +1 -1
- package/lib/sha256.d.ts +5 -0
- package/lib/sha256.d.ts.map +1 -0
- package/lib/sha256.js +16 -0
- package/lib/sha256.js.map +1 -0
- package/lib/stack.d.ts +60 -0
- package/lib/stack.d.ts.map +1 -0
- package/lib/stack.js +11 -0
- package/lib/stack.js.map +1 -0
- package/lib/stage.d.ts +39 -0
- package/lib/stage.d.ts.map +1 -0
- package/lib/stage.js +32 -0
- package/lib/stage.js.map +1 -0
- package/lib/state.d.ts +53 -11
- package/lib/state.d.ts.map +1 -1
- package/lib/state.js +33 -31
- package/lib/state.js.map +1 -1
- package/lib/tags.d.ts +17 -0
- package/lib/tags.d.ts.map +1 -0
- package/lib/tags.js +22 -0
- package/lib/tags.js.map +1 -0
- package/lib/test.d.ts +35 -0
- package/lib/test.d.ts.map +1 -0
- package/lib/test.js +68 -0
- package/lib/test.js.map +1 -0
- package/lib/tsconfig.test.tsbuildinfo +1 -0
- package/lib/type.d.ts +6 -0
- package/lib/type.d.ts.map +1 -0
- package/lib/type.js +3 -0
- package/lib/type.js.map +1 -0
- package/lib/unknown.d.ts +4 -0
- package/lib/unknown.d.ts.map +1 -0
- package/lib/unknown.js +4 -0
- package/lib/unknown.js.map +1 -0
- package/lib/user.d.ts +3 -0
- package/lib/user.d.ts.map +1 -0
- package/lib/user.js +3 -0
- package/lib/user.js.map +1 -0
- package/lib/util.d.ts +6 -0
- package/lib/util.d.ts.map +1 -0
- package/lib/util.js +9 -0
- package/lib/util.js.map +1 -0
- package/package.json +58 -7
- package/src/$.ts +17 -0
- package/src/app.ts +9 -37
- package/src/apply.ts +435 -289
- package/src/assert-never.ts +18 -0
- package/src/aws/account.ts +29 -7
- package/src/aws/arn.ts +1 -7
- package/src/aws/client.ts +14 -1
- package/src/aws/config.ts +16 -0
- package/src/aws/credentials.ts +213 -177
- package/src/aws/dynamodb/attribute-value.ts +240 -0
- package/src/aws/{sqs/queue.client.ts → dynamodb/client.ts} +9 -9
- package/src/aws/dynamodb/expr.ts +90 -0
- package/src/aws/dynamodb/index.ts +12 -0
- package/src/aws/dynamodb/projection.ts +159 -0
- package/src/aws/dynamodb/secondary-index.ts +45 -0
- package/src/aws/dynamodb/table.get-item.ts +173 -0
- package/src/aws/dynamodb/table.provider.ts +276 -0
- package/src/aws/dynamodb/table.ts +101 -0
- package/src/aws/ec2/client.ts +20 -0
- package/src/aws/ec2/index.ts +7 -0
- package/src/aws/ec2/subnet.provider.ts +358 -0
- package/src/aws/ec2/subnet.ts +213 -0
- package/src/aws/ec2/vpc.provider.ts +269 -0
- package/src/aws/ec2/vpc.ts +163 -0
- package/src/aws/index.ts +50 -45
- package/src/aws/lambda/client.ts +14 -0
- package/src/aws/lambda/consume.ts +8 -8
- package/src/aws/lambda/function.handler.ts +1 -1
- package/src/aws/lambda/function.invoke.ts +8 -4
- package/src/aws/lambda/function.provider.ts +208 -109
- package/src/aws/lambda/function.ts +21 -12
- package/src/aws/lambda/index.ts +3 -4
- package/src/aws/lambda/serve.ts +1 -1
- package/src/aws/profile.ts +1 -4
- package/src/aws/region.ts +43 -2
- package/src/aws/sqs/client.ts +20 -0
- package/src/aws/sqs/index.ts +4 -1
- package/src/aws/sqs/queue.consume.ts +1 -34
- package/src/aws/sqs/queue.event-source.ts +227 -0
- package/src/aws/sqs/queue.provider.ts +14 -7
- package/src/aws/sqs/queue.send-message.ts +7 -10
- package/src/aws/sqs/queue.ts +9 -4
- package/src/binding.ts +130 -34
- package/src/capability.ts +44 -0
- package/src/cli/components/ApprovePlan.tsx +2 -2
- package/src/cli/components/Plan.tsx +6 -3
- package/src/cli/components/PlanProgress.tsx +32 -14
- package/src/cli/index.ts +2 -6
- package/src/cli/ink-service.tsx +61 -0
- package/src/cli/service.ts +23 -0
- package/src/cloudflare/account.ts +37 -0
- package/src/cloudflare/api.ts +147 -63
- package/src/cloudflare/config.ts +7 -0
- package/src/cloudflare/context.ts +49 -0
- package/src/cloudflare/index.ts +8 -4
- package/src/cloudflare/kv/index.ts +3 -0
- package/src/cloudflare/kv/namespace.binding.ts +27 -0
- package/src/cloudflare/kv/namespace.client.ts +70 -0
- package/src/cloudflare/kv/namespace.provider.ts +100 -0
- package/src/cloudflare/kv/namespace.ts +30 -0
- package/src/cloudflare/live.ts +32 -0
- package/src/cloudflare/r2/bucket.binding.ts +29 -0
- package/src/cloudflare/r2/bucket.client.ts +22 -0
- package/src/cloudflare/r2/bucket.del.ts +11 -0
- package/src/cloudflare/r2/bucket.get.ts +13 -0
- package/src/cloudflare/r2/bucket.head.ts +11 -0
- package/src/cloudflare/r2/bucket.list.ts +12 -0
- package/src/cloudflare/r2/bucket.multipart.ts +55 -0
- package/src/cloudflare/r2/bucket.provider.ts +84 -0
- package/src/cloudflare/r2/bucket.put.ts +17 -0
- package/src/cloudflare/r2/bucket.ts +44 -0
- package/src/cloudflare/r2/index.ts +9 -0
- package/src/cloudflare/stream.ts +21 -0
- package/src/cloudflare/worker/assets.fetch.ts +29 -0
- package/src/cloudflare/worker/assets.provider.ts +249 -0
- package/src/cloudflare/worker/index.ts +4 -0
- package/src/cloudflare/worker/worker.handler.ts +39 -0
- package/src/cloudflare/worker/worker.provider.ts +249 -0
- package/src/cloudflare/worker/worker.serve.ts +22 -0
- package/src/cloudflare/worker/worker.ts +77 -0
- package/src/data.ts +18 -0
- package/src/destroy.ts +2 -3
- package/src/diff.ts +30 -0
- package/src/dot-alchemy.ts +3 -2
- package/src/env.ts +20 -32
- package/src/esbuild.ts +98 -0
- package/src/exports.ts +21 -0
- package/src/index.ts +12 -6
- package/src/input.ts +81 -0
- package/src/output.ts +518 -0
- package/src/plan.ts +544 -243
- package/src/policy.ts +58 -7
- package/src/provider.ts +27 -25
- package/src/ref.ts +48 -0
- package/src/resource.ts +23 -8
- package/src/runtime.ts +16 -9
- package/src/schema.ts +102 -0
- package/src/service.ts +11 -7
- package/src/sha256.ts +23 -0
- package/src/stack.ts +116 -0
- package/src/stage.ts +85 -0
- package/src/state.ts +141 -62
- package/src/tags.ts +38 -0
- package/src/test.ts +172 -0
- package/src/type.ts +6 -0
- package/src/unknown.ts +6 -0
- package/src/user.ts +4 -0
- package/src/util.ts +21 -0
- package/lib/approve.d.ts +0 -15
- package/lib/approve.d.ts.map +0 -1
- package/lib/approve.js +0 -7
- package/lib/approve.js.map +0 -1
- package/lib/aws/lambda/function.client.d.ts +0 -8
- package/lib/aws/lambda/function.client.d.ts.map +0 -1
- package/lib/aws/lambda/function.client.js +0 -7
- package/lib/aws/lambda/function.client.js.map +0 -1
- package/lib/aws/sqs/queue.client.d.ts +0 -12
- package/lib/aws/sqs/queue.client.d.ts.map +0 -1
- package/lib/aws/sqs/queue.client.js.map +0 -1
- package/lib/cli/approve.d.ts +0 -4
- package/lib/cli/approve.d.ts.map +0 -1
- package/lib/cli/approve.js +0 -18
- package/lib/cli/approve.js.map +0 -1
- package/lib/cli/clack.d.ts +0 -14
- package/lib/cli/clack.d.ts.map +0 -1
- package/lib/cli/clack.js +0 -12
- package/lib/cli/clack.js.map +0 -1
- package/lib/cli/main.d.ts +0 -2
- package/lib/cli/main.d.ts.map +0 -1
- package/lib/cli/main.js +0 -1
- package/lib/cli/main.js.map +0 -1
- package/lib/cli/plan.d.ts +0 -13
- package/lib/cli/plan.d.ts.map +0 -1
- package/lib/cli/plan.js +0 -1
- package/lib/cli/plan.js.map +0 -1
- package/lib/cli/progress.d.ts +0 -7
- package/lib/cli/progress.d.ts.map +0 -1
- package/lib/cli/progress.js +0 -29
- package/lib/cli/progress.js.map +0 -1
- package/lib/cli/spinner.d.ts +0 -2
- package/lib/cli/spinner.d.ts.map +0 -1
- package/lib/cli/spinner.js +0 -13
- package/lib/cli/spinner.js.map +0 -1
- package/lib/cloudflare/kv.d.ts +0 -29
- package/lib/cloudflare/kv.d.ts.map +0 -1
- package/lib/cloudflare/kv.js +0 -3
- package/lib/cloudflare/kv.js.map +0 -1
- package/lib/cloudflare/kv.provider.d.ts +0 -4
- package/lib/cloudflare/kv.provider.d.ts.map +0 -1
- package/lib/cloudflare/kv.provider.js +0 -39
- package/lib/cloudflare/kv.provider.js.map +0 -1
- package/lib/cloudflare/worker.d.ts +0 -33
- package/lib/cloudflare/worker.d.ts.map +0 -1
- package/lib/cloudflare/worker.js +0 -4
- package/lib/cloudflare/worker.js.map +0 -1
- package/src/approve.ts +0 -13
- package/src/aws/lambda/function.client.ts +0 -14
- package/src/cli/approve.tsx +0 -30
- package/src/cli/clack.ts +0 -22
- package/src/cli/main.ts +0 -0
- package/src/cli/plan.ts +0 -16
- package/src/cli/progress.tsx +0 -45
- package/src/cli/spinner.ts +0 -14
- package/src/cloudflare/kv.provider.ts +0 -51
- package/src/cloudflare/kv.ts +0 -20
- package/src/cloudflare/worker.ts +0 -34
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Schedule from "effect/Schedule";
|
|
3
|
+
|
|
4
|
+
import type { EC2 } from "itty-aws/ec2";
|
|
5
|
+
|
|
6
|
+
import type { VpcId } from "./vpc.ts";
|
|
7
|
+
import type { ScopedPlanStatusSession } from "../../cli/service.ts";
|
|
8
|
+
import { somePropsAreDifferent } from "../../diff.ts";
|
|
9
|
+
import type { ProviderService } from "../../provider.ts";
|
|
10
|
+
import { createTagger, createTagsList } from "../../tags.ts";
|
|
11
|
+
import { EC2Client } from "./client.ts";
|
|
12
|
+
import { Vpc, type VpcAttrs, type VpcProps } from "./vpc.ts";
|
|
13
|
+
import { Region } from "../region.ts";
|
|
14
|
+
import { Account } from "../account.ts";
|
|
15
|
+
|
|
16
|
+
export const vpcProvider = () =>
|
|
17
|
+
Vpc.provider.effect(
|
|
18
|
+
Effect.gen(function* () {
|
|
19
|
+
const ec2 = yield* EC2Client;
|
|
20
|
+
const region = yield* Region;
|
|
21
|
+
const accountId = yield* Account;
|
|
22
|
+
const tagged = yield* createTagger();
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
diff: Effect.fn(function* ({ news, olds }) {
|
|
26
|
+
if (
|
|
27
|
+
somePropsAreDifferent(olds, news, [
|
|
28
|
+
"cidrBlock",
|
|
29
|
+
"instanceTenancy",
|
|
30
|
+
"ipv4IpamPoolId",
|
|
31
|
+
"ipv6IpamPoolId",
|
|
32
|
+
"ipv6CidrBlock",
|
|
33
|
+
])
|
|
34
|
+
) {
|
|
35
|
+
return { action: "replace" };
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
|
|
39
|
+
create: Effect.fn(function* ({ id, news, session }) {
|
|
40
|
+
// 1. Prepare tags
|
|
41
|
+
const alchemyTags = tagged(id);
|
|
42
|
+
const userTags = news.tags ?? {};
|
|
43
|
+
const allTags = { ...alchemyTags, ...userTags };
|
|
44
|
+
|
|
45
|
+
// 2. Call CreateVpc
|
|
46
|
+
const createResult = yield* ec2.createVpc({
|
|
47
|
+
// TODO(sam): add all properties
|
|
48
|
+
AmazonProvidedIpv6CidrBlock: news.amazonProvidedIpv6CidrBlock,
|
|
49
|
+
InstanceTenancy: news.instanceTenancy,
|
|
50
|
+
CidrBlock: news.cidrBlock,
|
|
51
|
+
Ipv4IpamPoolId: news.ipv4IpamPoolId,
|
|
52
|
+
Ipv4NetmaskLength: news.ipv4NetmaskLength,
|
|
53
|
+
Ipv6Pool: news.ipv6Pool,
|
|
54
|
+
Ipv6CidrBlock: news.ipv6CidrBlock,
|
|
55
|
+
Ipv6IpamPoolId: news.ipv6IpamPoolId,
|
|
56
|
+
Ipv6NetmaskLength: news.ipv6NetmaskLength,
|
|
57
|
+
Ipv6CidrBlockNetworkBorderGroup:
|
|
58
|
+
news.ipv6CidrBlockNetworkBorderGroup,
|
|
59
|
+
TagSpecifications: [
|
|
60
|
+
{
|
|
61
|
+
ResourceType: "vpc",
|
|
62
|
+
Tags: createTagsList(allTags),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
DryRun: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const vpcId = createResult.Vpc!.VpcId! as VpcId;
|
|
69
|
+
yield* session.note(`VPC created: ${vpcId}`);
|
|
70
|
+
|
|
71
|
+
// 3. Modify DNS attributes if specified (separate API calls)
|
|
72
|
+
yield* ec2.modifyVpcAttribute({
|
|
73
|
+
VpcId: vpcId,
|
|
74
|
+
EnableDnsSupport: { Value: news.enableDnsSupport ?? true },
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (news.enableDnsHostnames !== undefined) {
|
|
78
|
+
yield* ec2.modifyVpcAttribute({
|
|
79
|
+
VpcId: vpcId,
|
|
80
|
+
EnableDnsHostnames: { Value: news.enableDnsHostnames },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 4. Wait for VPC to be available
|
|
85
|
+
const vpc = yield* waitForVpcAvailable(ec2, vpcId, session);
|
|
86
|
+
|
|
87
|
+
// 6. Return attributes
|
|
88
|
+
return {
|
|
89
|
+
vpcId,
|
|
90
|
+
vpcArn:
|
|
91
|
+
`arn:aws:ec2:${region}:${accountId}:vpc/${vpcId}` as VpcAttrs<VpcProps>["vpcArn"],
|
|
92
|
+
cidrBlock: vpc.CidrBlock!,
|
|
93
|
+
dhcpOptionsId: vpc.DhcpOptionsId!,
|
|
94
|
+
state: vpc.State!,
|
|
95
|
+
isDefault: vpc.IsDefault ?? false,
|
|
96
|
+
ownerId: vpc.OwnerId,
|
|
97
|
+
cidrBlockAssociationSet: vpc.CidrBlockAssociationSet?.map(
|
|
98
|
+
(assoc) => ({
|
|
99
|
+
associationId: assoc.AssociationId!,
|
|
100
|
+
cidrBlock: assoc.CidrBlock!,
|
|
101
|
+
cidrBlockState: {
|
|
102
|
+
state: assoc.CidrBlockState!.State!,
|
|
103
|
+
statusMessage: assoc.CidrBlockState!.StatusMessage,
|
|
104
|
+
},
|
|
105
|
+
}),
|
|
106
|
+
),
|
|
107
|
+
ipv6CidrBlockAssociationSet: vpc.Ipv6CidrBlockAssociationSet?.map(
|
|
108
|
+
(assoc) => ({
|
|
109
|
+
associationId: assoc.AssociationId!,
|
|
110
|
+
ipv6CidrBlock: assoc.Ipv6CidrBlock!,
|
|
111
|
+
ipv6CidrBlockState: {
|
|
112
|
+
state: assoc.Ipv6CidrBlockState!.State!,
|
|
113
|
+
statusMessage: assoc.Ipv6CidrBlockState!.StatusMessage,
|
|
114
|
+
},
|
|
115
|
+
networkBorderGroup: assoc.NetworkBorderGroup,
|
|
116
|
+
ipv6Pool: assoc.Ipv6Pool,
|
|
117
|
+
}),
|
|
118
|
+
),
|
|
119
|
+
} satisfies VpcAttrs<VpcProps>;
|
|
120
|
+
}),
|
|
121
|
+
|
|
122
|
+
update: Effect.fn(function* ({ news, olds, output, session }) {
|
|
123
|
+
const vpcId = output.vpcId;
|
|
124
|
+
|
|
125
|
+
// Only DNS and metrics settings can be updated
|
|
126
|
+
// Everything else requires replacement (handled by diff)
|
|
127
|
+
|
|
128
|
+
if (news.enableDnsSupport !== olds.enableDnsSupport) {
|
|
129
|
+
yield* ec2.modifyVpcAttribute({
|
|
130
|
+
VpcId: vpcId,
|
|
131
|
+
EnableDnsSupport: { Value: news.enableDnsSupport ?? true },
|
|
132
|
+
});
|
|
133
|
+
yield* session.note("Updated DNS support");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (news.enableDnsHostnames !== olds.enableDnsHostnames) {
|
|
137
|
+
yield* ec2.modifyVpcAttribute({
|
|
138
|
+
VpcId: vpcId,
|
|
139
|
+
EnableDnsHostnames: { Value: news.enableDnsHostnames ?? false },
|
|
140
|
+
});
|
|
141
|
+
yield* session.note("Updated DNS hostnames");
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Note: Tag updates would go here if we support user tag changes
|
|
145
|
+
|
|
146
|
+
return output; // VPC attributes don't change from these updates
|
|
147
|
+
}),
|
|
148
|
+
|
|
149
|
+
delete: Effect.fn(function* ({ output, session }) {
|
|
150
|
+
const vpcId = output.vpcId;
|
|
151
|
+
|
|
152
|
+
yield* session.note(`Deleting VPC: ${vpcId}`);
|
|
153
|
+
|
|
154
|
+
// 1. Attempt to delete VPC
|
|
155
|
+
yield* ec2
|
|
156
|
+
.deleteVpc({
|
|
157
|
+
VpcId: vpcId,
|
|
158
|
+
DryRun: false,
|
|
159
|
+
})
|
|
160
|
+
.pipe(
|
|
161
|
+
Effect.tapError(Effect.logDebug),
|
|
162
|
+
Effect.catchTag("InvalidVpcID.NotFound", () => Effect.void),
|
|
163
|
+
// Retry on dependency violations (resources still being deleted)
|
|
164
|
+
Effect.retry({
|
|
165
|
+
while: (e) => {
|
|
166
|
+
// DependencyViolation means there are still dependent resources
|
|
167
|
+
// This can happen if subnets/IGW are being deleted concurrently
|
|
168
|
+
return (
|
|
169
|
+
e._tag === "ValidationError" &&
|
|
170
|
+
e.message?.includes("DependencyViolation")
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
schedule: Schedule.exponential(1000, 1.5).pipe(
|
|
174
|
+
Schedule.intersect(Schedule.recurs(10)), // Try up to 10 times
|
|
175
|
+
Schedule.tapOutput(([, attempt]) =>
|
|
176
|
+
session.note(
|
|
177
|
+
`Waiting for dependencies to clear... (attempt ${attempt + 1})`,
|
|
178
|
+
),
|
|
179
|
+
),
|
|
180
|
+
),
|
|
181
|
+
}),
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// 2. Wait for VPC to be fully deleted
|
|
185
|
+
yield* waitForVpcDeleted(ec2, vpcId, session);
|
|
186
|
+
|
|
187
|
+
yield* session.note(`VPC ${vpcId} deleted successfully`);
|
|
188
|
+
}),
|
|
189
|
+
} satisfies ProviderService<Vpc>;
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Wait for VPC to be in available state
|
|
195
|
+
*/
|
|
196
|
+
const waitForVpcAvailable = (
|
|
197
|
+
ec2: EC2,
|
|
198
|
+
vpcId: string,
|
|
199
|
+
session?: ScopedPlanStatusSession,
|
|
200
|
+
) =>
|
|
201
|
+
Effect.retry(
|
|
202
|
+
Effect.gen(function* () {
|
|
203
|
+
const result = yield* ec2
|
|
204
|
+
.describeVpcs({ VpcIds: [vpcId] })
|
|
205
|
+
.pipe(
|
|
206
|
+
Effect.catchTag("InvalidVpcID.NotFound", () =>
|
|
207
|
+
Effect.succeed({ Vpcs: [] }),
|
|
208
|
+
),
|
|
209
|
+
);
|
|
210
|
+
const vpc = result.Vpcs![0];
|
|
211
|
+
|
|
212
|
+
if (vpc.State === "available") {
|
|
213
|
+
return vpc;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Still pending, fail to trigger retry
|
|
217
|
+
return yield* Effect.fail(new Error("VPC not yet available"));
|
|
218
|
+
}),
|
|
219
|
+
{
|
|
220
|
+
schedule: Schedule.fixed(2000).pipe(
|
|
221
|
+
// Check every 2 seconds
|
|
222
|
+
Schedule.intersect(Schedule.recurs(30)), // Max 60 seconds
|
|
223
|
+
Schedule.tapOutput(([, attempt]) =>
|
|
224
|
+
session
|
|
225
|
+
? session.note(
|
|
226
|
+
`Waiting for VPC to be available... (${(attempt + 1) * 2}s)`,
|
|
227
|
+
)
|
|
228
|
+
: Effect.void,
|
|
229
|
+
),
|
|
230
|
+
),
|
|
231
|
+
},
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Wait for VPC to be deleted
|
|
236
|
+
*/
|
|
237
|
+
const waitForVpcDeleted = (
|
|
238
|
+
ec2: EC2,
|
|
239
|
+
vpcId: string,
|
|
240
|
+
session: ScopedPlanStatusSession,
|
|
241
|
+
) =>
|
|
242
|
+
Effect.gen(function* () {
|
|
243
|
+
yield* Effect.retry(
|
|
244
|
+
Effect.gen(function* () {
|
|
245
|
+
const result = yield* ec2.describeVpcs({ VpcIds: [vpcId] }).pipe(
|
|
246
|
+
Effect.tapError(Effect.logDebug),
|
|
247
|
+
Effect.catchTag("InvalidVpcID.NotFound", () =>
|
|
248
|
+
Effect.succeed({ Vpcs: [] }),
|
|
249
|
+
),
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
if (!result.Vpcs || result.Vpcs.length === 0) {
|
|
253
|
+
return; // Successfully deleted
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Still exists, fail to trigger retry
|
|
257
|
+
return yield* Effect.fail(new Error("VPC still exists"));
|
|
258
|
+
}),
|
|
259
|
+
{
|
|
260
|
+
schedule: Schedule.fixed(2000).pipe(
|
|
261
|
+
// Check every 2 seconds
|
|
262
|
+
Schedule.intersect(Schedule.recurs(15)), // Max 30 seconds
|
|
263
|
+
Schedule.tapOutput(([, attempt]) =>
|
|
264
|
+
session.note(`Waiting for VPC deletion... (${(attempt + 1) * 2}s)`),
|
|
265
|
+
),
|
|
266
|
+
),
|
|
267
|
+
},
|
|
268
|
+
);
|
|
269
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type * as EC2 from "itty-aws/ec2";
|
|
2
|
+
import type { Input } from "../../input.ts";
|
|
3
|
+
import { Resource } from "../../resource.ts";
|
|
4
|
+
import type { AccountID } from "../account.ts";
|
|
5
|
+
import type { RegionID } from "../region.ts";
|
|
6
|
+
|
|
7
|
+
export const Vpc = Resource<{
|
|
8
|
+
<const ID extends string, const Props extends VpcProps>(
|
|
9
|
+
id: ID,
|
|
10
|
+
props: Props,
|
|
11
|
+
): Vpc<ID, Props>;
|
|
12
|
+
}>("AWS.EC2.VPC");
|
|
13
|
+
|
|
14
|
+
export interface Vpc<
|
|
15
|
+
ID extends string = string,
|
|
16
|
+
Props extends VpcProps = VpcProps,
|
|
17
|
+
> extends Resource<
|
|
18
|
+
"AWS.EC2.VPC",
|
|
19
|
+
ID,
|
|
20
|
+
Props,
|
|
21
|
+
VpcAttrs<Input.Resolve<Props>>,
|
|
22
|
+
Vpc
|
|
23
|
+
> {}
|
|
24
|
+
|
|
25
|
+
export type VpcId = `vpc-${string}`;
|
|
26
|
+
export const VpcId = <const S extends string>(value: S): S & VpcId =>
|
|
27
|
+
value as S & VpcId;
|
|
28
|
+
|
|
29
|
+
export interface VpcProps {
|
|
30
|
+
/**
|
|
31
|
+
* The IPv4 network range for the VPC, in CIDR notation.
|
|
32
|
+
* Required unless using IPAM.
|
|
33
|
+
* @example "10.0.0.0/16"
|
|
34
|
+
*/
|
|
35
|
+
cidrBlock?: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
|
|
39
|
+
*/
|
|
40
|
+
ipv4IpamPoolId?: Input<string>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The netmask length of the IPv4 CIDR you want to allocate to this VPC from an IPAM pool.
|
|
44
|
+
*/
|
|
45
|
+
ipv4NetmaskLength?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The ID of an IPv6 IPAM pool which will be used to allocate this VPC an IPv6 CIDR.
|
|
49
|
+
*/
|
|
50
|
+
ipv6IpamPoolId?: Input<string>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The netmask length of the IPv6 CIDR you want to allocate to this VPC from an IPAM pool.
|
|
54
|
+
*/
|
|
55
|
+
ipv6NetmaskLength?: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.
|
|
59
|
+
*/
|
|
60
|
+
ipv6CidrBlock?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.
|
|
64
|
+
*/
|
|
65
|
+
ipv6Pool?: Input<string>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The Availability Zone or Local Zone Group name for the IPv6 CIDR block.
|
|
69
|
+
*/
|
|
70
|
+
ipv6CidrBlockNetworkBorderGroup?: Input<string>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The tenancy options for instances launched into the VPC.
|
|
74
|
+
* @default "default"
|
|
75
|
+
*/
|
|
76
|
+
instanceTenancy?: EC2.Tenancy;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Whether DNS resolution is supported for the VPC.
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
enableDnsSupport?: boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Whether instances launched in the VPC get DNS hostnames.
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
enableDnsHostnames?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.
|
|
92
|
+
*/
|
|
93
|
+
amazonProvidedIpv6CidrBlock?: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Tags to assign to the VPC.
|
|
97
|
+
* These will be merged with alchemy auto-tags (alchemy::app, alchemy::stage, alchemy::id).
|
|
98
|
+
*/
|
|
99
|
+
tags?: Record<string, Input<string>>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface VpcAttrs<_Props extends VpcProps = VpcProps> {
|
|
103
|
+
/**
|
|
104
|
+
* The ID of the VPC.
|
|
105
|
+
*/
|
|
106
|
+
vpcId: VpcId;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The Amazon Resource Name (ARN) of the VPC.
|
|
110
|
+
*/
|
|
111
|
+
vpcArn: `arn:aws:ec2:${RegionID}:${AccountID}:vpc/${this["vpcId"]}`;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The primary IPv4 CIDR block for the VPC.
|
|
115
|
+
*/
|
|
116
|
+
cidrBlock: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the set of DHCP options associated with the VPC.
|
|
120
|
+
*/
|
|
121
|
+
dhcpOptionsId: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The current state of the VPC.
|
|
125
|
+
*/
|
|
126
|
+
state: EC2.VpcState;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Whether the VPC is the default VPC.
|
|
130
|
+
*/
|
|
131
|
+
isDefault: boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The ID of the AWS account that owns the VPC.
|
|
135
|
+
*/
|
|
136
|
+
ownerId?: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Information about the IPv4 CIDR blocks associated with the VPC.
|
|
140
|
+
*/
|
|
141
|
+
cidrBlockAssociationSet?: Array<{
|
|
142
|
+
associationId: string;
|
|
143
|
+
cidrBlock: string;
|
|
144
|
+
cidrBlockState: {
|
|
145
|
+
state: EC2.VpcCidrBlockStateCode;
|
|
146
|
+
statusMessage?: string;
|
|
147
|
+
};
|
|
148
|
+
}>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Information about the IPv6 CIDR blocks associated with the VPC.
|
|
152
|
+
*/
|
|
153
|
+
ipv6CidrBlockAssociationSet?: Array<{
|
|
154
|
+
associationId: string;
|
|
155
|
+
ipv6CidrBlock: string;
|
|
156
|
+
ipv6CidrBlockState: {
|
|
157
|
+
state: EC2.VpcCidrBlockStateCode;
|
|
158
|
+
statusMessage?: string;
|
|
159
|
+
};
|
|
160
|
+
networkBorderGroup?: string;
|
|
161
|
+
ipv6Pool?: string;
|
|
162
|
+
}>;
|
|
163
|
+
}
|
package/src/aws/index.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
|
+
|
|
3
|
+
// oxlint-disable-next-line no-unused-vars - needed or else provider types are transitively resolved through DynamoDB.Provider<..> lol
|
|
4
|
+
import type { Provider } from "../provider.ts";
|
|
5
|
+
|
|
6
|
+
import * as ESBuild from "../esbuild.ts";
|
|
2
7
|
import * as Account from "./account.ts";
|
|
3
8
|
import * as Credentials from "./credentials.ts";
|
|
9
|
+
import * as DynamoDB from "./dynamodb/index.ts";
|
|
10
|
+
import * as EC2 from "./ec2/index.ts";
|
|
4
11
|
import * as IAM from "./iam.ts";
|
|
5
12
|
import * as Lambda from "./lambda/index.ts";
|
|
6
13
|
import * as Region from "./region.ts";
|
|
@@ -8,48 +15,46 @@ import * as S3 from "./s3.ts";
|
|
|
8
15
|
import * as SQS from "./sqs/index.ts";
|
|
9
16
|
import * as STS from "./sts.ts";
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
export const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export default live;
|
|
18
|
+
export { loadProfile, loadSSOCredentials } from "./credentials.ts";
|
|
19
|
+
|
|
20
|
+
import "./config.ts";
|
|
21
|
+
|
|
22
|
+
export const resources = () =>
|
|
23
|
+
Layer.mergeAll(
|
|
24
|
+
DynamoDB.tableProvider(),
|
|
25
|
+
EC2.subnetProvider(),
|
|
26
|
+
EC2.vpcProvider(),
|
|
27
|
+
Lambda.functionProvider(),
|
|
28
|
+
SQS.queueProvider(),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const bindings = () =>
|
|
32
|
+
Layer.mergeAll(
|
|
33
|
+
DynamoDB.getItemFromLambdaFunction(),
|
|
34
|
+
SQS.queueEventSourceProvider(),
|
|
35
|
+
SQS.sendMessageFromLambdaFunction(),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export const clients = () =>
|
|
39
|
+
Layer.mergeAll(
|
|
40
|
+
DynamoDB.client(),
|
|
41
|
+
EC2.client(),
|
|
42
|
+
IAM.client(),
|
|
43
|
+
Lambda.client(),
|
|
44
|
+
S3.client(),
|
|
45
|
+
SQS.client(),
|
|
46
|
+
// STS.client(),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const utils = () => Layer.mergeAll(ESBuild.layer());
|
|
50
|
+
|
|
51
|
+
export const providers = () =>
|
|
52
|
+
resources().pipe(
|
|
53
|
+
Layer.provideMerge(bindings()),
|
|
54
|
+
Layer.provideMerge(clients()),
|
|
55
|
+
Layer.provideMerge(utils()),
|
|
56
|
+
Layer.provideMerge(Account.fromStageConfig()),
|
|
57
|
+
Layer.provideMerge(STS.client()),
|
|
58
|
+
Layer.provideMerge(Region.fromStageConfig()),
|
|
59
|
+
Layer.provideMerge(Credentials.fromStageConfig()),
|
|
60
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
|
|
3
|
+
import { Lambda } from "itty-aws/lambda";
|
|
4
|
+
import { createAWSServiceClientLayer } from "../client.ts";
|
|
5
|
+
|
|
6
|
+
export class LambdaClient extends Context.Tag("AWS.Lambda.Client")<
|
|
7
|
+
LambdaClient,
|
|
8
|
+
Lambda
|
|
9
|
+
>() {}
|
|
10
|
+
|
|
11
|
+
export const client = createAWSServiceClientLayer<typeof LambdaClient, Lambda>(
|
|
12
|
+
LambdaClient,
|
|
13
|
+
Lambda,
|
|
14
|
+
);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { From } from "alchemy-effect";
|
|
2
|
-
import { declare } from "alchemy-effect";
|
|
3
1
|
import type {
|
|
4
2
|
Context as LambdaContext,
|
|
5
3
|
SQSBatchResponse,
|
|
@@ -7,11 +5,14 @@ import type {
|
|
|
7
5
|
} from "aws-lambda";
|
|
8
6
|
import * as Effect from "effect/Effect";
|
|
9
7
|
import * as S from "effect/Schema";
|
|
10
|
-
import
|
|
8
|
+
import { declare, type From } from "../../policy.ts";
|
|
11
9
|
import * as Lambda from "./function.ts";
|
|
10
|
+
import type { Queue } from "../sqs/queue.ts";
|
|
11
|
+
import type { Consume, QueueEvent } from "../sqs/queue.consume.ts";
|
|
12
|
+
import { QueueEventSource } from "../sqs/queue.event-source.ts";
|
|
12
13
|
|
|
13
14
|
export const consume =
|
|
14
|
-
<Q extends
|
|
15
|
+
<Q extends Queue, ID extends string, Req>(
|
|
15
16
|
id: ID,
|
|
16
17
|
{
|
|
17
18
|
queue,
|
|
@@ -19,8 +20,7 @@ export const consume =
|
|
|
19
20
|
}: {
|
|
20
21
|
queue: Q;
|
|
21
22
|
handle: (
|
|
22
|
-
|
|
23
|
-
event: SQS.QueueEvent<Q["props"]["schema"]["Type"]>,
|
|
23
|
+
event: QueueEvent<Q["props"]["schema"]["Type"]>,
|
|
24
24
|
context: LambdaContext,
|
|
25
25
|
) => Effect.Effect<SQSBatchResponse | void, never, Req>;
|
|
26
26
|
},
|
|
@@ -31,7 +31,7 @@ export const consume =
|
|
|
31
31
|
}: Props) =>
|
|
32
32
|
Lambda.Function(id, {
|
|
33
33
|
handle: Effect.fn(function* (event: SQSEvent, context: LambdaContext) {
|
|
34
|
-
yield* declare<
|
|
34
|
+
yield* declare<Consume<From<Q>>>();
|
|
35
35
|
const records = yield* Effect.all(
|
|
36
36
|
event.Records.map(
|
|
37
37
|
Effect.fn(function* (record) {
|
|
@@ -61,4 +61,4 @@ export const consume =
|
|
|
61
61
|
],
|
|
62
62
|
} satisfies SQSBatchResponse;
|
|
63
63
|
}),
|
|
64
|
-
})({ ...props, bindings: bindings.and(
|
|
64
|
+
})({ ...props, bindings: bindings.and(QueueEventSource(queue)) });
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Binding } from "../../binding.ts";
|
|
4
|
+
import type { Capability } from "../../capability.ts";
|
|
5
|
+
import { toEnvKey } from "../../env.ts";
|
|
6
|
+
import { declare, type On } from "../../policy.ts";
|
|
7
|
+
import type { $ } from "../../$.ts";
|
|
8
|
+
import { LambdaClient } from "./client.ts";
|
|
5
9
|
import { Function } from "./function.ts";
|
|
6
10
|
|
|
7
11
|
export interface InvokeFunction<Resource = unknown>
|
|
8
12
|
extends Capability<"AWS.Lambda.InvokeFunction", Resource> {}
|
|
9
13
|
|
|
10
14
|
export const InvokeFunction = Binding<
|
|
11
|
-
<F extends Function>(func: F) => Binding<Function, InvokeFunction
|
|
15
|
+
<F extends Function>(func: F) => Binding<Function, InvokeFunction<On<F>>>
|
|
12
16
|
>(Function, "AWS.Lambda.InvokeFunction");
|
|
13
17
|
|
|
14
18
|
export const invoke = <F extends Function>(func: F, input: any) =>
|
|
15
19
|
Effect.gen(function* () {
|
|
16
|
-
const lambda = yield*
|
|
20
|
+
const lambda = yield* LambdaClient;
|
|
17
21
|
const functionArn = process.env[`${func.id}-functionArn`]!;
|
|
18
22
|
yield* declare<InvokeFunction<F>>();
|
|
19
23
|
return yield* lambda.invoke({
|