Setup
Prerequisites
Section titled “Prerequisites”- Node.js 24.11.1+ or Bun
- An AWS account and an IAM identity with permission to create the resources you plan to deploy
Create a project
Section titled “Create a project”mkdir my-app && cd my-app && pnpm initmkdir my-app && cd my-app && bun init -ymkdir my-app && cd my-app && npm init -ymkdir my-app && cd my-app && yarn init -yInstall
Section titled “Install”pnpm add https://pkg.alchemy.run/alchemy/9c58f00 https://pkg.alchemy.run/@alchemy.run/aws/9c58f00 effect @effect/platform-bun @effect/platform-nodebun add https://pkg.alchemy.run/alchemy/9c58f00 https://pkg.alchemy.run/@alchemy.run/aws/9c58f00 effect @effect/platform-bun @effect/platform-nodenpm install https://pkg.alchemy.run/alchemy/9c58f00 https://pkg.alchemy.run/@alchemy.run/aws/9c58f00 effect @effect/platform-bun @effect/platform-nodeyarn add https://pkg.alchemy.run/alchemy/9c58f00 https://pkg.alchemy.run/@alchemy.run/aws/9c58f00 effect @effect/platform-bun @effect/platform-nodeHow Alchemy gets AWS credentials
Section titled “How Alchemy gets AWS credentials”Connect AWS with alchemy profile edit --add AWS and pick an
authentication method. The choice is saved to your default
profile and reused on every subsequent
command; a deploy with nothing configured fails with that exact
command to run. Authentication changes only through the profile command.
Locally, pick AWS CLI profile and name a profile from ~/.aws/config. Alchemy reads what kind of profile it is and handles each one as below. If you don’t have a profile yet, start with console login unless your organization already signs in through IAM Identity Center.
alchemy profile edit --add AWS --method aws-profile --set awsProfile=<name>Console login (recommended)
Section titled “Console login (recommended)”Console login is AWS’s keyless sign-in for every account. You sign in to the AWS Management Console in your browser, as the root user, an IAM user or through federation, and the AWS CLI receives short-lived credentials for that same identity. There’s nothing to set up in the account, and no long-lived access keys on your machine.
Alchemy runs aws login --profile <name> (AWS CLI v2.32+) for you and loads the session it writes to ~/.aws/config (login_session). When the session expires, run alchemy profile refresh.
SSO through IAM Identity Center
Section titled “SSO through IAM Identity Center”SSO is for organizations that have set up IAM Identity Center: a single sign-in for many accounts, with users and permission sets managed centrally, often connected to Okta, Google Workspace or Entra ID. It takes setup in an AWS Organization, so it pays off when a team works across several accounts.
Alchemy runs aws sso login --profile <name> for you and loads credentials from the AWS SSO cache. The profile you pick in ~/.aws/config decides the account and region. When the session expires, run alchemy profile refresh.
Any other AWS CLI profile
Section titled “Any other AWS CLI profile”A profile that uses credential_process, role_arn with source_profile or credential_source, web_identity_token_file, or keys in ~/.aws/credentials works as it does for the AWS CLI and SDKs. Alchemy resolves it on each command and saves only the profile name and account ID.
[profile sandbox]credential_process = /usr/local/bin/sandbox-aws-credentialsregion = us-east-1Alchemy can’t sign these profiles in for you, so alchemy profile refresh only checks that the profile still resolves. When it doesn’t, fix the profile itself; aws sts get-caller-identity --profile <name> shows the same error. Profiles with mfa_serial aren’t supported, since there’s no prompt for the MFA code.
The region is AWS_REGION when it’s set, otherwise the profile’s own region, otherwise AWS_DEFAULT_REGION. A set AWS_REGION overrides the profile’s region on every method.
Stored access keys
Section titled “Stored access keys”Paste an access key ID, secret access key, optional session
token, and region into the interactive prompt. Alchemy verifies
them against STS and saves them under
~/.alchemy/credentials/<profile>/ for future runs.
IAM user access keys don’t expire, so they stay usable until you rotate or delete them. Prefer an AWS CLI profile when you can: console login and SSO give you short-lived credentials, and a profile with keys in ~/.aws/credentials keeps them in one place for the AWS CLI and Alchemy alike.
CI environment credentials
Section titled “CI environment credentials”When CI=true, Alchemy bypasses profiles and reads the standard AWS
variables directly:
export AWS_ACCESS_KEY_ID=...export AWS_SECRET_ACCESS_KEY=...export AWS_SESSION_TOKEN=... # optionalexport AWS_REGION=us-east-1 # or AWS_DEFAULT_REGIONThe region is required. The account ID is taken from
AWS_ACCOUNT_ID if set, otherwise resolved once via STS
GetCallerIdentity. No profile is created or persisted in CI.
Managing credentials
Section titled “Managing credentials”Re-run the setup at any time (e.g. to switch from stored keys to
an AWS CLI profile, or to configure a separate prod profile):
alchemy profile edit --reconfigure AWSalchemy profile create prodalchemy profile edit --profile prod --add AWSInspect what’s stored (secrets are redacted):
alchemy profile showSee Profiles for switching between
profiles with --profile or $ALCHEMY_PROFILE.
State storage
Section titled “State storage”For AWS stacks, pass AWS.state() as the Stack’s state
option. Deploy state is stored in a DynamoDB table
(alchemy-state), created lazily on the first deploy. In CI,
provision it once with alchemy state bootstrap --backend aws.
For purely local iteration, Alchemy.localState() writes state
under .alchemy/ next to your code instead.
State from earlier versions lives in an S3 bucket; move it with
alchemy state migrate. See
Migrating from the S3 store.
Next steps
Section titled “Next steps”- AWS overview — pick a runtime and resources.
- Lambda — deploy your first function with a public URL.
- Secrets & env — profile credentials deploy the stack; app secrets are bindings on the function.