Twine AWS Requirements
- IAM User
- Route 53
- DynamoDB
- Secrets Manager
- Elastic Beanstalk
- Certificate Manager
- ElastiCache for Redis
- Application Load Balancer
The Twine architecture is extensive and requires broad permissions. For smooth deployment, we recommend creating a new AWS account and ensuring that Node.js v18.x or greater is installed in your local environment. Complete the steps below to deploy Twine.
Step-by-step guide
- Sign up for a new AWS Account
- Sign in to your new AWS Account
- Click the second rightmost button in the top navbar
- Select the region where you will deploy Twine (Twine currently supports us-east-1 and ap-southeast-2)
- Type 'IAM' in the search bar at the top of the page
- Click on the 'IAM' service
- Click 'Users' in the sidebar
- Click 'Create User'
- Choose a user name and click 'Next'
- Select 'Attach Policies Directly'
- Type 'AdministratorAccess' in the 'Permissions Policies' searchbar
- Select 'AdministratorAccess' and click 'Next'
- Click 'Create User'
- Click 'Users' in the sidebar and select the user you created
- Click the 'Security Credentials' tab
- Click 'Create Access Key'
- Select 'Command Line Interface (CLI)'
- Click 'Next' and then click 'Create Access Key'
- Prepare to provide your access key and secret access key
Step-by-step guide
- Install the AWS CLI
- Execute
aws configure --profile new-profile-name
in terminal - Provide your access key and secret access key
- Provide the region that you previously determined (must match)
Step-by-step guide
- Enter the AWS Console and search for 'Route 53'
- Click 'Dashboard' in the Route 53 page sidebar
- Register a Route 53 domain (you will later use the domain name with the Twine client library)
Step-by-step guide
- Search for 'Certificate Manager'
- Click 'Request Certificate' in the Certificate Manager sidebar
- 'Request a Public Certificate' should be selected; click 'Next'
- Enter your new domain name
- Select your validation method of choice
- Select the 'RSA 2048' key algorithm
- Click 'Request'
- Validate the request
Step-by-step guide
- Clone this repository
- Open your terminal
- Navigate to the repository directory
- Execute
aws configure list
- If the 'Name' value is not your newly-created AWS CLI profile name, execute
export AWS_PROFILE=new-profile-name
(this command is different for Windows users) - Execute
aws configure list
again to confirm the change occurred - Execute
npm install
to install the Twine deployment dependencies - Execute
npm start
to launch the deployment process - Follow the instructions in your terminal
![Screenshot 2023-12-07 at 11 54 58 AM](https://private-user-images.githubusercontent.com/85587848/288576662-452f9608-e6c1-445a-a946-12b70d98477c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MDI5NzQsIm5iZiI6MTcyNDUwMjY3NCwicGF0aCI6Ii84NTU4Nzg0OC8yODg1NzY2NjItNDUyZjk2MDgtZTZjMS00NDVhLWE5NDYtMTJiNzBkOTg0NzdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDEyMzExNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjODZhOTZkZjgxYjE0OTM4ZWM2MGRiM2FkZjkwMzE2YmRkMTQ0NDBjYmNkNjUwMWQxMDIyOWY0N2U5OWQ4MjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xaSM8uyoMez6JvriLv1_yh5NWom-gl2q90HDoiKsFls)
The creation process can be observed in the 'Stacks' section of the AWS Cloud Formation page. After the process is complete, the Twine server will be running in the Elastic Beanstalk environment. However, to satisfy browser requirements, Twine must use your newly-created domain name instead of the load balancer endpoint.
Step-by-step guide
- Enter the AWS Console and search for 'Route 53'
- Click 'Hosted Zones' in the AWS Route 53 sidebar
- Click on the listed domain name
- Click 'Create Record'
- Ensure the Record Type is 'A' then click 'Alias'
- Set the 'Endpoint' to 'Alias to Application and Classic Load Balancer'
- Select the region name that you previously determined
- Select the single option for 'Choose Load Balancer'
- Click 'Create Records'
Record creation will take a few minutes. The Twine architecture will then be complete and ready for the Twine server/client library implementation. Please note that Twine issues third-party cookies for sticky sessions and to store WebSocket session data for connection state recovery. Your Twine API key (required to publish to the Twine API) is available on your newly-created AWS Secrets Manager page.