> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy 1Password Connect Server on AWS ECS Fargate with CloudFormation

1Password Connect works with [AWS Fargate <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html). AWS Fargate lets you leverage Amazon Elastic Container Service (ECS) to run containers without the need to manage clusters.

## Requirements

Before you can use 1Password CLI with your Connect server, you must:

* [Sign up for 1Password](https://1password.com/pricing/password-manager).
* [Create a 1Password Connect server](/connect/get-started/#step-1) in your infrastructure.
* Sign up with [AWS Fargate <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html).

## Example

You can use 1Password's [example CloudFormation template (`connect-server.yaml`) <Icon icon="github" />](https://github.com/1Password/connect/blob/main/examples/aws-ecs-fargate/connect-server.yaml) as a starting place for deploying Connect on AWS Fargate.

The example [CloudFormation template <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html#cfn-concepts-templates) creates the necessary networking resources, ECS resources, rules, groups, and policies. See [Resources](#resources) for more details.

The result is a publicly accessible hostname that routes requests to a 1Password Connect Server deployment running in AWS Fargate.

<Tip>
  You can also use this example CloudFormation file to deploy into an existing [AWS virtual private cloud (VPC) <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/vpc/latest/privatelink/concepts.html) or an existing [Amazon Elastic Container (AWS ECS) <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/ecs/) cluster. You can modify it using a text editor or using Amazon's [CloudFormation Designer <Icon icon="arrow-up-right-from-square" />](https://console.aws.amazon.com/cloudformation/designer) tool.
</Tip>

### Resources

The example CloudFormation template creates the following network resources:

* A virtual private cloud (VPC)
* Two public subnets
* An [Internet gateway <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-internetgateway.html)
* An [Application Load Balancer (ALB) <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html)

The example CloudFormation template creates the following ECS resources:

* An [ECS cluster <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AmazonECS/latest/userguide/clusters-concepts.html)
* Two [task definitions <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-tasks-services.html)
  * A `1password/connect-api` container
  * A `1password/connect-sync` container

## Get started

To use the example `connect-server.yaml` file to deploy a Connect server on AWS Fargate (using CloudFormation):

1. [Start the **AWS Create Stack** wizard. <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html#cfn-using-console-initiating-stack-creation)
2. Select the example [`connect-server.yaml` file <Icon icon="github" />](https://github.com/1Password/connect/blob/main/examples/aws-ecs-fargate/connect-server.yaml) as the stack template. See [Selecting a stack template <Icon icon="arrow-up-right-from-square" />](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-console-create-stack-template.html).
3. Provide a Base64 URL encoded version of your Connect server's `1password-credentials.json` file.

When importing this CloudFormation template, it prompts you to provide a Base64 URL encoded version of the `1password-credentials.json`. You can generate this encoded value with the following shell command:

```shell theme={null}
cat 1password-credentials.json | base64 | tr '/+' '_-' | tr -d '=' | tr -d '\n'
```
