---
title: "Amazon Web Services"
url: "https://docs.yugabyte.com/stable/deploy/public-clouds/aws/cloudformation/"
---

# Amazon Web Services

Deploy a YugabyteDB cluster on Amazon Web Services using AWS CloudFormation

Deploy using AWS CloudFormation

- [CloudFormation](/stable/deploy/public-clouds/aws/cloudformation/)
- [Manual deployment](/stable/deploy/public-clouds/aws/manual-deployment/)

YugabyteDB maintains an AWS CloudFormation template for deploying YugabyteDB on AWS. This automated deployment:

- Creates a VPC with three public subnets.
- Creates an instance in each subnet.
- Deploys a YugabyteDB cluster across these three nodes.

The template is in the [AWS CloudFormation](https://github.com/yugabyte/aws-cloudformation "AWS CloudFormation") repository.

## 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.
   
   ```sh
   $ 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](https://github.com/yugabyte/aws-cloudformation/blob/master/yugabyte_ephemeral_nvme_cloudformation.yaml "this example") that demonstrates the use of different instance types.

## AWS Command Line

Create CloudFormation template:

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

Once resource creation completes, check that stack was created:

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

From this output, you can 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**.
   
   ![Cloud Formation dashboard](/images/deploy/aws/aws-cf-initial-dashboard.png "Cloud Formation dashboard")
2. Prepare a template using the downloaded template.
   
   ![Prepare template](/images/deploy/aws/aws-cf-prepare-template.png "Prepare template")
3. Specify the template file downloaded in Prerequisites: `yugabyte_cloudformation.yaml`
   
   ![Upload template](/images/deploy/aws/aws-cf-upload-template.png "Upload template")
4. Provide the required parameters. Each of these fields is prefilled with information from the configuration YAML file that was uploaded. `LatestAmiId` refers to the ID of the machine image to use, see [Find a Linux AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html "Find a Linux AMI").
   
   ![Provide Parameters](/images/deploy/aws/aws-cf-provide-parameters.png "Provide Parameters")
5. Configure stack options. For more information, see [Setting AWS CloudFormation stack options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html "Setting AWS CloudFormation stack options").
   
   ![Configure options](/images/deploy/aws/aws-cf-configure-options.png "Configure options")
6. Finalize changes before creation.
   
   ![Review stack](/images/deploy/aws/aws-cf-review-stack.png "Review stack")
7. Check stack output in the dashboard.
   
   ![Check output](/images/deploy/aws/aws-cf-check-output.png "Check output")
