Detailed AWS setup

To work locally all you need is Node, any additional supported runtimes you plan to use, and the Architect CLI.

AWS deployment requirements

  1. Node.js for Architect
  2. Python for the AWS CLI
  3. Any additional supported runtimes you plan to use in your application
  4. AWS CLI
  5. AWS credentials
  6. Architect CLI

Runtime environments

Architect supports the following runtime versions:

  • Node.js: >= 14.x using npm
    • Unless otherwise specified in your project manifest, Node.js is the default runtime for new functions
  • Python: 3.9, 3.8, 3.7, or 3.6 using pip3
  • Ruby: 2.7 using bundle
  • Deno: 1.6.x (under development)

⚠️ Working locally with the Architect sandbox requires target runtimes to be available in your $PATH.

Additionally, all other standard AWS-managed runtimes are supported in Architect applications (but may not be supported in Sandbox), including:

  • Go: 1.x
  • .NET: 3.1
  • Java: 11, and 8

Architect also supports any custom runtime in using either Lambda Layers or Lambda container images.

Change a project’s default runtime by specifying an explicit environment or an alias in app.arc with the @aws pragma.

Examples

# version pins the default runtime to Python 3.8
@aws
runtime python3.8
# always run the latest supported version of Python
@aws
runtime python

ℹ️ This setting can be overridden on a per-function basis with config.arc.


AWS CLI

The AWS Command Line Interface is the main interface for interacting with all parts of AWS using your computer’s terminal. Architect uses the AWS CLI to package and deploy your app via CloudFormation. Follow this guide to installing the AWS CLI for your preferred environment.


Credentials

You’ll need an Amazon Web Services account and credentials set up on your development machine and / or CI systems. If you yet set it up, here’s a useful guide for Configuring the AWS CLI.

In the context of a deployment tool, Architect requires account credentials with IAM AdministratorAccess privileges. In turn, Architect will create and attach least-privilege IAM roles to runtime resources within your application, ensuring strict security boundaries by default.

ℹ️ While it is possible to limit Architect’s deployment credentials to specific IAM and CloudFormation privileges, such an exercise would only be performative. Credentials capable of creating IAM roles can grant and attach new roles with AdministratorAccess.

On *nix systems AWS Credentials are listed in:

~/.aws/credentials

Or on Windows systems:

C:\Users\USER_NAME\.aws\credentials

If that file doesn’t exist, create it, and add something like the following (assuming you have multiple AWS accounts):

[default]
aws_access_key_id=xxx
aws_secret_access_key=xxx

[work]
aws_access_key_id=xxx
aws_secret_access_key=xxx

[personal]
aws_access_key_id=xxx
aws_secret_access_key=xxx

While it is recommended to explicitly declare your application’s AWS profile and region, you may also want to use a default profile and region on your machine with the following environment variables:

  • AWS_PROFILE
  • AWS_REGION

To set these variables on Linux, macOS, or UNIX, use export in your shell’s configuration (e.g. ~/.zshrc or ~/.bashrc):

export AWS_PROFILE=work
export AWS_REGION=us-west-1

Or for Windows, add this to your PowerShell $profile:

$env:AWS_PROFILE='work'
$env:AWS_REGION='us-west-1'

If you prefer, you can also use: Control Panel » System » Advanced System Settings » Environment Variables.

Install Architect

The following command uses npm, the package manager for Node.js.

To create an entirely new Architect project:

Bash/cmd.exe
npm init @architect ./testapp
PowerShell
npm init "@architect" ./testapp

To install Architect locally into an existing project:

Bash/cmd.exe
npm init @architect ./testapp
PowerShell
npm init "@architect" ./testapp

Or you can install Architect globally, enabling you to use Architect from any directory on your computer. When doing so, you should also be sure to install the AWS SDK globally as well.

npm i -g @architect/architect aws-sdk