Prerequisites
AWS
- ECS Cluster (Fargate)
- ECR
- Load Balancer
- Target Group
- RDS (Engine: MySQL Community)
- Cloud Map
- EFS
- CloudWatch Logs groups
Ansible Execution Environment
- Python (3.12 or later)
- Python modules: boto3, botocore, requests
- Ansible (11.5.0 or later)
- AWS CLI
- Docker
- Crane (https://github.com/google/go-containerregistry/tree/main/cmd/crane)
Installation Steps
Setup Phase: Authlete
1. Create an Organization
- Log in to the Authlete Console.
- Create an organization for your company.
- Note down the Organization ID.
2. Request Access
- Share the Organization ID and Organization Name with Authlete Support.
- Authlete will authorize registry access for your organization.
3. Generate Organization Token
- In the Authlete Console, generate a Token for your organization.
- Keep the Organization ID and Token handy for authentication.
Setup Phase: Ansible Execution Environment
Setup Ansible execution environment.1. Install Python Requirements:
Installboto3 and botocore for AWS interactions. Use the following command:
requests module which you can install with the following command:
2. Install Ansible
To installansible, run the following: Ansible version (>=11.5.0) is recommended.
3. Install Ansible Collections
Option 1: Install the latest Ansible collection:community.aws and amazon.aws dependency:
community.aws collection and amazon.aws dependency to a requirements.yml file:
4. Setup AWS CLI Environment
Before anything, you will need to set up your AWS account. Contact your AWS administrator and have them create credentials for you. Install AWS CLI Use the following guide to install or update to the latest version of AWS CLI. Skip this step if your AWS CLI environment is already up to date. AWS Configuration If you do not have a pre-existing folder, create~/.aws.
Once done, create a ~/.aws/credentials file containing the following information :
AWS IAM account settings.
Then, create another ~/.aws/config file containing the following information :
Preparation and Configuration Phase
1. Pull the ansible-playbook
First, log into the artifact registry using your organization identifiers :group_vars/aws_ecs.yml file provided by Ansible for configuration details.
This file contains all the required keys with dummy placeholder values that need to be replaced with your AWS resource identifiers.
ecs_cluster_nameexecution_role_arnefs_filesystem_idefs_access_point_idefs_access_point_arnaws_logs_groupscloudmap_registry_arns
group_vars/aws_ecs.yml file.
2. Create AWS ECS
Once your AWS account is set up, create aFargate ECS cluster with a name of your choosing.
Use the following aws cli command to display your ECS cluster information:
group_vars/aws_ecs.yml file, you can now replace the following AWS resource identifiers with your AWS ECS values:
3. Create AWS ECR Repositories
Create ECR repositories. Navigate to the ECR dashboard and create the following repositories:<CLUSTER_NAME>/server-db-schema<CLUSTER_NAME>/server<CLUSTER_NAME>/idp-db-schema<CLUSTER_NAME>/idp<CLUSTER_NAME>/authlete-bootstrapper<CLUSTER_NAME>/console<CLUSTER_NAME>/nginx<CLUSTER_NAME>/alpine<CLUSTER_NAME>/valkey(Optional, you can disable thevalkeyoption in theall.ymlfile)
namespace in the repository name must be the same as your <CLUSTER_NAME>.
To correctly setup the ecr_repo_url, copy/paste the URI of one of your ECR repositories, and remove the repository name at the end (the final result should end with amazonaws.com)
Use the following command to list your repositories.
group_vars/aws_ecs.yml file, replace the value of repo. Make sure not to configure the container images and tags.
4. Create AWS ECS Task
From your AWS ECS cluster, go to Tasks and follow instructions to create your taskrole and execution.
When your task is launched, find and replace the following AWS resource identifiers with your AWS ECS values.
-
The
execution_role_arnandtask_role_arnvalues can be found under the task definitions. -
The
subnet_idvalues can be found under the tasks.
group_vars/aws_ecs.yml file, configure the following:
5. Create AWS Target Groups
In the AWS EC2 dashboard, underLoad Balancing, create the following target groups:
authlete-console-tgauthlete-idp-tgauthlete-api-tgauthlete-proxy-tg, Health check path=/healthauthlete-valkey-tg
IP address and use the corresponding container port number.
Finally, in the group_vars/aws_ecs.yml file, replace the following target group ARNs with your AWS EC2 resource identifiers.
6. Create AWS ALB
Create the following load balancers:authlete-lbidp-lbconsole-lbproxy-lb
- Availability zones
- Security group
- Listener port and forwarding
- Certificate (required for HTTPS protocol only)
7. Create AWS Cloud Map
- Navigate to AWS Cloud Map and create a new namespace. This namespace must have the same name as your previously created ECS cluster.
CloudMap namespace and create the following services:
- console
- idp
- authlete-api
group_vars/aws_ecs.yml file, configure the following:
CloudMap namespace ARN, then replace namespace/... with service/{SERVICE_ID} for each registry
8. Create AWS CloudWatch Log Group
In theAWS CloudWatch dashboard, under Logs, create a new log group with a name of your choosing.
In the group_vars/aws_ecs.yml file:
9. Create AWS RDS Database
Create an AWS RDS Database with the following configurations:- Engine type: MySQL
- Engine version: 8.0.X
10. Create AWS EFS
- Create an Amazon EFS and replace the following AWS resource identifiers with your Amazon EFS Filesystem values.
group_vars/aws_ecs.yml file, configure the following EFS values:
11. Container Images
The Ansible playbook automates the transfer of Authlete-provided container images to a customer’s own container registry. This avoids direct runtime dependency on Authlete’s registry, and ensures reproducible deployments.- Make sure not to modify the following container images and tags in the
group_vars/aws_ecs.ymlfile.
| Image | Description | Supported Version Tags |
|---|---|---|
| server | Core API server that handles OAuth 2.0 and OpenID Connect operations | 3.0.11 |
| server-db-schema | Database schema initialization tool for the API server | v3.0.11 |
| idp | Identity Provider server for user authentication and management | 1.0.5 |
| idp-db-schema | Database schema initialization tool for the IDP server | v1.0.5 |
| console | React based management console for platform configuration and monitoring | v1.0.5 |
| nginx | Nginx-based reverse proxy for handling TLS termination and routing | 1.26.3 |
| valkey | Caching service for improved performance and reduced database load | 8.0.1 |
| alpine | A minimal Docker image based on Alpine Linux, designed for security, simplicity, and resource efficiency. Commonly used as a base image for lightweight containers. | 3.18 |
| authlete-bootstrapper | Initialization service for the platform. Only used during first deployment. | 1.0.0 |
12. Authlete URLs
Configure Authlete URLs: Make sure you follow the required format to avoid errors: In thegroup_vars/aws_ecs.yml file, configure the following:
authlete_api_urlauthlete_idp_base_urlauthlete_idp_console_url
13. Authlete Email and Password
Configure youradmin_user_email and admin_user_password
- Your first Authlete user will be instantiated with these values.
group_vars/aws_ecs.yml file, configure the following:
14. Configure Authlete Organization ID and Token
Log into the Authlete console and find the AuthleteOrganization Id and Organization Token for the following step.
Configure your Authlete Organization Id and Organization Token in the group_vars/all.yml file:
Validation Phase
Now that you have created and configured all the required AWS resources, you will need to update values in the Ansible group_vars so that your installation correctly points towards them. Run the environment validation playbook to verify that all required AWS infrastructure is in place. However, you may choose to skip this step as it will be automatically executed during the installation process. Run the following ansible playbook command:failed=0, it means this step is completed.
Deployment Phase
1. Install the Authlete Stack
- To install the Full Authlete Stack, run the following ansible commands:
Uninstall Phase
1. Uninstall the Stack
- To uninstall the full Authlete Stack:
Manage Individual Components
1. Authlete API
- To install:
- To uninstall:
- Rolling upgrade:
2. Authlete IDP
- To install:
- To uninstall:
3. Authlete Console
- To install:
- To uninstall:
- Rolling upgrade: