Prerequisites

  1. You need to have an IAM user who has AWSCloudFormationFullAccess, AmazonEC2FullAccess and ssm:GetParameters privilege.
  2. If you are going to create the stack via AWS Console then make sure the user also has s3:CreateBucket, s3:PutObject and s3:GetObject policies.
  3. Create an SSH key pair that you want to attach to the nodes.
  4. In the region you want to bring up the stack, make sure you can launch new VPCs.
  5. Download the template file.
$ wget https://raw.githubusercontent.com/yugabyte/aws-cloudformation/master/yugabyte_cloudformation.yaml

Note

When using an instance with local disks (as opposed to EBS), the .yaml file needs to be changed for YugabyteDB to recognize the local disks, as per this example that demonstrates the use of different instance types.

AWS Command Line

Create CloudFormation template:

$ aws cloudformation create-stack \
  --stack-name <stack-name> \
  --template-body file://yugabyte_cloudformation.yaml \
  --parameters  ParameterKey=DBVersion,ParameterValue=2.1.6.0 ParameterKey=KeyName,ParameterValue=<ssh-key-name> \
  --region <aws-region>

Once resource creation completes, check that stack was created:

$ aws cloudformation describe-stacks \
  --stack-name <stack-name> \
  --region <aws-region>

From this output, you will be able to get the VPC id and YugabyteDB admin URL.

Because the stack creates a security group that restricts access to the database, you might need to update the security group inbound rules if you have trouble connecting to the DB.

AWS Console

  1. Navigate to your AWS console and open the CloudFormation dashboard. Click Create Stack.

  1. Prepare template using the downloaded template

  1. Specify the template file downloaded in Prerequisites: yugabyte_cloudformation.yaml

  1. Provide the required parameters. Each of these fields are prefilled with information from the configuration YAML file that was uploaded. LatestAmiId refers to the id of the machine image to use, see more.

  1. Configure Stack options. For more information about these options, click here.

  1. Finalize changes before creation

  1. Check stack output in dashboard