# CloudFormation Deployment

When you have completed prerequisites and have hosting domain information handy, you can continue deploying Code Ocean via AWS CloudFormation. Visit [AWS CloudFormation's website](https://aws.amazon.com/cloudformation/) for more information.

The deployment takes about 40 minutes to complete.

## Create CloudFormation Stack

Code Ocean deployment is publicly available via AWS S3. Go to AWS CloudFormation -> Stacks -> Create stack or [follow this link](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=codeocean\&templateURL=https://codeocean-vpc.s3.amazonaws.com/templates/v2.13.8/codeocean.template.yaml), to autofill all the fields, to start creating a deployment stack in CloudFormation, with Code Ocean's latest release template.

The following steps are consistent with the steps of creating a stack in AWS CloudFormation.

### Step 1 - Specify the template

1. Choose **Template is ready** in the Prerequisite section.
2. Choose **Amazon S3 URL** in the Specify template section.
3. Enter <https://codeocean-vpc.s3.amazonaws.com/templates/v2.13.8/codeocean.template.yaml>
4. Click **Next**.

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MYvHilOJIzh11VNxJoZ%2F-MYvI0tj7fRBFEL8QkmC%2Fimage.png?alt=media\&token=2255bf67-a36c-4055-88e3-f029a6a8017e)

### Step 2 - Specify stack details

Most configuration parameters are set to the recommended defaults.

1. Choose a name for the deployment stack, the default will be `codeocean`.
2. Set `DNS name` to `codeocean`.
3. Set `DNS Root Domain` to the hosting domain (e.g. `[company].com`). Visit [Prerequisites](https://docs.codeocean.com/admin-guide/v2.13/prerequisites#choose-a-hosting-domain) if you need more information.
4. Set `Availability Zone 1` and `Availability Zone 2` for the VPC
5. Scroll to the bottom and click **Next**.

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MhE5f7S8yMEv6CTESYl%2F-MhE6BQDA5iVzCnhMemW%2Fimage.png?alt=media\&token=68aa167a-3225-4092-8fde-9d5ab04bd0d6)

{% hint style="warning" %}
**Stack Parameters** are set by default to their recommended values for the default internet-facing deployment type. Please visit [Deployment Parameters](https://docs.codeocean.com/admin-guide/v2.13/deployment-guide/deployment-parameters) page for the full list of parameters and their purpose. Note that there are some changes required according to AWS region and/or deployment type.

Please contact our support or email <support@codeocean.com> if you have any questions or you need help regarding parameters values.
{% endhint %}

### Step 3 - Configure stack options (optional)

You can specify tags (key-value pairs) for resources in your stack and set advanced options.

Click **Next** when you are done.

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MZa4qJBVz4WN1BDWEwZ%2F-MZa7NmhoJKeKcHXi7D4%2FScreen%20Shot%202021-05-01%20at%2012.12.54%20AM.png?alt=media\&token=33efc0f9-ffcc-456e-b35a-a0f21d6e9262)

{% hint style="info" %}
Visit the [Resource tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) page on AWS for more information about specifying tags.

Visit the [AWS CloudFormation stack options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html) page on AWS for more information about advanced options.
{% endhint %}

### Step 4 - Review

1. Review and assure that all the details are correct.
2. Check the box to acknowledge that CloudFormation might create IAM resources.
3. Click **Create Stack** to start the deployment.

After you click on Create Stack, you will be redirected to the stack screen where you can follow the progress of your stack deployment :

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MYvHilOJIzh11VNxJoZ%2F-MYvIFxcfhWGgpxKNVqE%2Fimage.png?alt=media\&token=2a9c951c-7d5c-401e-aec8-4fdd705eb532)

## SSL Certificate Approval

{% hint style="info" %}
This section applies only to deployments that use Email Validation to provision an ACM SSL certificate. When using DNS Validation, the SSL Certificate will be approved automatically.

For more information, please refer to the [SSL Certificate Validation](https://docs.codeocean.com/admin-guide/v2.13/prerequisites#ssl-certificate-validation) section.
{% endhint %}

For the deployment to be completed successfully, you or your IT administrator must approve the SSL certificate request. You will receive an email from AWS asking you to approve the certificate.

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MYvHilOJIzh11VNxJoZ%2F-MYvIL9QzEdp4NbHviG-%2Fimage.png?alt=media\&token=6bf350d4-5c1c-4500-af9e-45436b84b7e7)

This email will be sent to the following email addresses:

* administrator\@your\_domain\_name
* hostmaster\@your\_domain\_name
* postmaster\@your\_domain\_name
* webmaster\@your\_domain\_name
* admin\@your\_domain\_name

To approve the certificate request:

1. Choose the **Amazon Certificate Approvals** link in the email.
2. Click **I Approve** on the page you get directed to.

## Deployment Completion

When the deployment is finished, the state of the CloudFormation stack will turn into `CREATE_COMPLETE` .

![](https://1798878876-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO74Ph1wHV3oYY-yd18%2F-MYvHilOJIzh11VNxJoZ%2F-MYvIQ0grjNJEJ9zEYMy%2Fimage.png?alt=media\&token=76105d91-7df8-4ab1-8a86-2c61eaf33239)

## Post Deployment

### Subscribing to AWS Alarms

We recommend subscribing to AWS Alarms, to prevent system issues. To subscribe and learn more about alarms, navigate to the [Alarms](https://docs.codeocean.com/admin-guide/v2.13/troubleshooting-guide/alarms) help page.
