AWS Services code generation
Effect AWS uses code generation to create the Effectful services. The generated services are based on the AWS SDK v3 specifications which are located in the github.com/aws/aws-sdk-js-v3/codegen/sdk-codegen/aws-models
.
The specs are read by pnpm codegen-client
cli wizard. This command generates the Effect AWS services in the packages
directory with the initial AWS client name, then they are published to npm as @effect-aws/<service-name>
packages.
WARNING
Some service names are normalized to be more consistent and readable. For example, apigatewayv2
becomes api-gateway-v2
, and apigatewaymanagementapi
becomes api-gateway-management-api
.
Not all AWS services are generated and published currently, but the goal is to generate all of them.
How to contribute
To add a new service, follow these steps:
- Define a new package in
scripts/client-singularities.ts
(the package must have the same name as the AWS client) and update normalization mapping inscripts/utils.ts
if necessary. - Run
pnpm default
to generate the packages folder structure usingprojen
. - Run
pnpm codegen-client
, select the packages to generate, and follow the prompts to complete the generation process. - Commit the changes and open a pull request to the
main
branch.
NOTE
The process is not perfect, but at least it reduces creating boilerplate code. In most cases the services generated with the defined steps should work as is, but sometimes it requires some manual adjustments.