1. **Access the VPC dashboard**:
a. In the AWS Management Console, in the top menu bar, click **Services > Networking & Content Delivery > VPC**.
3. **Create the subnets**:
a. After creating the VPC, in the sidebar, click **Subnets**.
4. **Create the internet gateway (for the public subnets)**:
a. In the sidebar, click **Internet gateways**.
5. **Set up route tables (for the public subnets)**:
AWS automatically created a default route table in *Step 3 - Create the subnets*. To tailor your network architecture, you will create a new route table specifically for your public subnets, which will include a route to the internet gateway from *Step 4 - Create the internet gateway (for the public subnets)*.
a. In the sidebar, click *Route tables*.
b. Click **Create route table**.
c. Enter a **Name**.
d. Select the **VPC** from *Step 2 - Create the VPC*.
e. Click **Create route table**.
6. **Associate public subnets to the route table and internet gateway**:
a. Connect the **public subnets** to the **route table** from *Step 5 - Set up route tables (for the public subnets)*:
7. **Inspect the VPC resource map**:
You can check the configurations from the resource maps on the VPC details dashboard by clicking **Your VPCs** in the sidebar, clicking the **VPC ID** for your VPC, and then clicking the **Resource map** tab.
## Part II: Deploying the Unstructured API from the AWS Marketplace
8. **Go to the Unstructured API page on AWS Marketplace**:
a. Leaving the VPC dashboard from Part I open, in a separate web browser tab, go to the [Unstructured API](http://aws.amazon.com/marketplace/pp/prodview-fuvslrofyuato) product page in the AWS Marketplace.
b. Click **Continue to Subscribe**.
c. Review the terms and conditions.
d. Click **Continue to Configuration**.
9. **Configure the CloudFormation template**:
a. In the **Fulfillment option** dropdown list, select **CloudFormation Template**.
b. For **Fulfillment option** and **Software version**, leave the default `UnstructuredAPI` template and software version.
c. In the **Region** dropdown list, select the Region that corresponds to the VPC from Part I.
* *Note: You must select the same Region where you set up the VPC in Part I. To find the Region, on the VPC dashboard tab from Part I that you left open, with your VPC displayed, find the VPC's Region name next to your username in the top navigation bar.*
d. Click **Continue to Launch**.
e. In the **Choose Action** dropdown list, select **Launch CloudFormation**.
f. Click **Launch**.
10. **Create the CloudFormation stack**:
After you click **Launch**, the **Create stack** page appears in CloudFormation.
**Step 1: Create the stack**
a. Leave **Choose an existing template** selected.
b. Leave **Amazon S3 URL** selected and the default **Amazon S3 URL** value unchanged.
c. Click **Next**.
**Step 2: Specify the stack's details**
a. Enter some unique **Stack name**.
b. In the **Parameters** section, in the **InstanceType** drop-down list, select **m5.xlarge**.
c. In the **KeyName** drop-down list, select the name of the SSH key pair from the beginning of this article.
d. In the **LoadBalancerScheme** dropdown list, select **internet-facing**.
e. For **SSHLocation**, enter `0.0.0.0/0`, but only if you allow public access on the internet.
* **Note**: It is generally recommended to limit SSH access to a specific IP range for enhanced security. This can be done by setting the `SSHLocation` to the IP address or range associated with your organization. Please consult your IT department or VPN vendor to obtain the correct IP information for these settings.
* AWS provides `AWS Client VPN`, which is a managed client-based VPN service that enables secure access AWS resources and resources in your on-premises network. To learn more, see [Getting started with AWS Client VPN](https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-getting-started.html).
f. In the **Subnets** dropdown multiselect list, select the two public subnets and the private subnet from Part I.
g. In the **VPC** dropdown list, select the VPC from Part I.
h. You can leave the default values for all of the other **Parameters** fields.
i. Click **Next**.
**Step 3: Configure the stack's options**
a. You can leave the default values, or specify any non-default stack options.
b. Click **Next**.
**Step 4: Review**
a. Review the stack's settings.
b. Click **Submit**.
11. **Get the Unstructured API endpoint**:
a. The CloudFormation details page for the stack appears. If you do not see it, on the sidebar, click **Stacks**, and then click the name of your stack.
b. Check the status of the CloudFormation stack. A successful deployment will show a **CREATE\_COMPLETE** value for the **Status** field on the **Stack Info** tab on this stack's details page. The deployment can take several minutes.
c. After a successful deployment, click the **Resources** tab on this stack's details page. Then click the **Physical ID** link next to **ApplicationLoadBalancer** on this tab.
d. On the **EC2 > Load balancers > (Load balancer ID)** page that appears, copy the **DNS Name** value, which is shown as an **(A Record)** and ends with `.elb.amazonaws.com`.
* Note: You will use this **DNS Name** to replace the `
## Healthcheck
Perform a health check by running this [curl](https://curl.se/) command from a terminal on your local machine, replacing `
## Data processing
For example, run one of the following, setting the following environment variables to make your code more portable:
* Set `UNSTRUCTURED_API_URL` to `http://`, followed by your load balancer's DNS name, followed by `/general/v0/general`.
3. In the **Instance details** section, enter a name in the **Virtual machine name** field. Note this name, as you will need it later steps.
4. Select a **Region** from the dropdown menu.
5. For **Image**, select **Unstructured Customer Hosted API Hourly - x64 Gen2** (*default*).
6. For **Size**, select a VM size from the dropdown menu, or leave the default VM size selection. To learn more, see [Azure VM comparisons](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/).
7. In the **Administrator account** section, for **Authentication type**, select **SSH public key** or **Password**.
8. Enter the credential settings, depending on the authentication type.
4. Click **Create**.
4. The deployed endpoint URL is **http\://\| Dataset | | Base Model’ | | Notes |
|---|---|---|
| PubLayNet | [38] F/M | Layouts of modern scientific documents |
| PRImA [3] | M | Layouts of scanned modern magazines and scientific reports |
| Newspaper | F | Layouts of scanned US newspapers from the 20th century |
| TableBank | F | Table region on modern scientific and business document |
| HJDataset [31] | F/M | Layouts of history Japanese documents |
| Gels and karyotypes | 600 dpi (8 bit grayscale depth) |
| High pressure liquid chromatography | 300 |
4. In the **Paste cURL, Raw text or URL** box, enter the following URL, and then press `Enter`:
```
https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-POST.postman_collection.json
```
5. On the sidebar, click **Collections**.
6. Expand **Unstructured POST**.
7. Click **(Partition Endpoint) Basic Request**.
8. On the **Headers** tab, next to `unstructured-api-key`, enter your Unstructured API key in the **Value** column.
9. On the **Body** tab, next to `files`, click the **Select files** box in the **Value** column.
10. Click **New file from local machine**.
11. Browse to and select the file that you want Unstructured to process.
12. Click **Send**. Processing could take several minutes.
To download the processed data to your local machine, in the response area, click the ellipses, and then click **Save response to file**.
# Unstructured API Quickstart
Source: https://docs.unstructured.io/api-reference/legacy-api/partition/quickstart