Deploy the solution
The solution is deployed as an AWS CDK application, using the mdaa CLI.
Before you deploy, review the cost, architecture, and other considerations discussed earlier in this guide.
New to Secure AI Foundations? We recommend starting with the Secure AI Foundations (formerly MDAA) Workshop
Terminology
-
Deployment Account - The AWS account where deployment activities will be occurring. This includes source control, artifact building and publishing, and execution for Secure AI Foundations.
-
Target Account - The AWS account where Data Analytics Environment resources will ultimately be deployed by Secure AI Foundations. Note that Secure AI Foundations can execute in one account and deploy to another, or can execute and deploy to the same account.
Prerequisites for CDK Deployment
Manual Bootstrap (Single Deployment Source/Target Account)
-
Obtain AWS credentials for the account and place them into your credentials file or populate appropriate environment variables. These credentials should have sufficient permissions to create the following resources in the target account: * IAM Roles * SSM Parameters * S3 Buckets
-
Run the CDK bootstrap command. Multiple regions can be specified simultaneously:
export CDK_NEW_BOOTSTRAP=1 cdk bootstrap aws://<AWS Account Number>/<Target Region>...
For example:
export CDK_NEW_BOOTSTRAP=1 cdk bootstrap aws://123456789012/ca-central-1 aws://123456789012/us-east-1
Manual Bootstrap (Single Deployment Source Account and One or More Target Accounts)
This procedure should be executed for each target account. This procedure bootstraps the target account while establishing trust with the source account (where deployments will be triggered)
Obtain AWS credentials for the target account and place them into your credentials file or populate appropriate environment variables.
These credentials should have sufficient permissions to create the following resources in the target account: * IAM Roles * SSM Parameters * S3 Buckets
Run the CDK bootstrap command. Multiple regions can be specified simultaneously:
export CDK_NEW_BOOTSTRAP=1 cdk bootstrap --cloudformation-execution-policies <CDK Deployment IAM Policy Arns> --trust <Source Account Number> aws://<Target AWS Account Number>/<Target Region>...
Note that the permissions specified with cloudformation-execution-policies are granted to CloudFormation during deployment into the account. These permissions should be sufficient to deploy Secure AI Foundations resources, but not overly permissive.
Deployment
Deployment Overview
The following are procedures which can be executed in order to manually deploy Secure AI Foundations to target accounts. These procedures assume that the appropriate preparations have been made within the organizations accounts.
Deployment Patterns
Secure AI Foundations may be deployed using a number of patterns:
-
Same Deployment Source and Target Account (Centralized Data Environment)
-
Single Deployment Source account, One or More Separate Target Accounts (Centralized deployment governance, decentralized Data Environments)
Deployment Preparation
Node Installation
Install a version of Node.js using a method appropriate to your system. Secure AI Foundations requires nodejs 22.x and npm/npx version 10.x or greater.
As of Secure AI Foundations 1.8.0, the CLI is cross-platform: the shell commands it generates internally are emitted in the correct syntax for both POSIX shells and Windows cmd.exe, so the CLI runs on Windows as well as macOS and Linux. Note that the example commands shown throughout this guide use POSIX shell syntax; adapt them to your shell when running on Windows.
Environment Setup
Verify your credentials are populated either in your environment or in your ~/.aws/credentials file. Also, verify your AWS region is specified either in your environment or in your ~/.aws/config file:
[default] region=us-east-1
Deployment from Published NPM Packages
Secure AI Foundations can be installed from a private NPM package repo, and will also attempt to install its modules from a private NPM repo. This is necessary if specific Secure AI Foundations versions are specified in mdaa.yaml.
Verify that your private NPM repo is accessible and contains the appropriate Secure AI Foundations NPM artifacts. If using a localhost based NPM repo (such as Verdaccio), verify it is running on localhost and updated with the latest Secure AI Foundations packages from S3 (See PREDEPLOYMENTmdaa CLI will also attempt to NPM install each module from NPM repo.
Install Secure AI Foundations from your private NPM repository using:
Global Installation:
npm install -g @aws-mdaa/cli
Then, the mdaa CLI can be executed globally:
mdaa -h
Optionally, both the mdaa CLI can be instead npm installed in a local directory:
npm install @aws-mdaa/cli
mdaa commands can then be run within the local directory using NPX.
npx mdaa -h