> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring and Maintaining AWS Hosted VIFs

> This help topic describes how to configure and maintain AWS Hosted VIF connections with Megaport.

export const Video = ({url, text, duration, description}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Video -';
  if (typeof url !== 'string') {
    url = String(url);
  }
  if (typeof text !== 'string') {
    text = String(text);
  }
  if (!url || url === 'undefined') {
    console.error(`${errorPrefix} the \`url\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (!text || text === 'undefined') {
    console.error(`${errorPrefix} the \`text\` property is required — rendering an empty string instead`);
    return <></>;
  }
  const youtubeIconMask = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath d='M549.7 124.1c-6.3-23.7-24.8-42.3-48.3-48.6C458.8 64 288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zM232 336V176l142.7 80z'/%3E%3C/svg%3E\")";
  return <div className="video-callout">
      <div className="callout my-4 flex gap-3 overflow-hidden rounded-2xl border px-5 py-4">
        <div className="mt-0.5 w-4 shrink-0" data-component-part="callout-icon">
          <svg aria-hidden="true" className="size-4 shrink-0" style={{
    WebkitMaskImage: youtubeIconMask,
    maskImage: youtubeIconMask,
    WebkitMaskRepeat: 'no-repeat',
    maskRepeat: 'no-repeat',
    WebkitMaskPosition: 'center',
    maskPosition: 'center',
    backgroundColor: '#0284c7'
  }} />
        </div>
        <div className="min-w-0 w-full text-sm" data-component-part="callout-content">
          <strong>
            Video:{' '}
            <a href={url} target="_blank" rel="noopener noreferrer">
              {text}
              <span className="sr-only"> (opens in a new tab)</span>
            </a>
          </strong>
          {}
          {duration && <> ({duration})</>}
          {}
          {description && <p className="mt-1 mb-0 text-xs text-gray-500 dark:text-gray-400">
              {description}
            </p>}
        </div>
      </div>
    </div>;
};

export const Image = ({src, alt = '', caption, width, height, shadow}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Image -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  const img = <img className={['mega-image-style', shadow ? 'shadow' : ''].join(' ')} src={src} alt={alt} width={width} height={height} style={{
    display: 'block'
  }} />;
  return caption ? <figure>
      {img}
      <figcaption style={{
    textAlign: 'center',
    width
  }}>{caption}</figcaption>
    </figure> : img;
};

export const Gloss = ({term, anchor, langDir = 'en'}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Gloss -';
  if (typeof term !== 'string') {
    term = String(term);
  }
  if (typeof anchor !== 'string') {
    anchor = String(anchor);
  }
  if (!term || term === 'undefined') {
    console.error(`${errorPrefix} the \`term\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (!anchor || anchor === 'undefined') {
    console.error(`${errorPrefix} the \`anchor\` property is required — rendering an empty string instead`);
    return <></>;
  }
  const lang = langDir === 'en' ? '/' : '/' + langDir + '/';
  const glossaryPage = lang + 'glossary/#' + anchor;
  return <a href={glossaryPage}>{term}</a>;
};

export const Link = ({href, children}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Link -';
  if (typeof href !== 'string') {
    href = String(href);
  }
  if (!href || href === 'undefined') {
    console.error(`${errorPrefix} the \`href\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (href.includes('{') || href.toUpperCase().includes('%7B')) {
    console.error(`${errorPrefix} could not resolve a variable in href "${href}" — rendering an empty string instead`);
    return <></>;
  }
  const isExternal = (/^https?:\/\//).test(href);
  return <a href={href} className="link" target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noreferrer' : undefined}>
      {children ?? href}
      {isExternal && <span className="sr-only"> (opens in a new tab)</span>}
    </a>;
};

To deploy an AWS Hosted VIF, you need your
[AWS Account number](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingYourAccountIdentifiers) and the details of the VPC environment.

<Video url="https://youtu.be/U2s7diWUg8I" text="How to Set Up AWS Direct Connect with Megaport" duration="17:09" description="This video shows how to provision an AWS Direct Connect Port, select an AWS region, and configure a hosted virtual interface using the Megaport Portal and the AWS Management Console." />

<Note>
  You can deploy multiple VXCs to the same VPC (for redundancy); however, you cannot deploy a single VXC to multiple VPCs. You need a separate VXC to connect to each AWS VPC.
</Note>

<Note>
  AWS Hosted Virtual Interfaces (Hosted VIF) do not support diversity zones. To ensure connection diversity for Hosted VIFs, create VXCs to two destination ports in different data centers, instead of two ports in separate diversity zones.
</Note>

**To create a Hosted VIF connection**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page and select the Port you want to use.\
   If you haven’t already created a Port, see [Creating a Port](/connections/creating-port).

2. Add an AWS connection for the Port.\
   If this is the first connection for the Port, click the AWS tile. The tile is a shortcut to the configuration page. Alternatively, click **+Connection**, click **Cloud**, then click **AWS**.
   <Image src="/images/cloud/megaport/aws/aws-new-connection.png" alt="Add AWS connection" shadow={true} width={700} />

3. Select AWS as the service provider, select Hosted VIF as the AWS Connection Type, select the destination port, then click **Next**.\
   You can use the Select Destination Port search field to narrow the selection.
   <Image src="/images/cloud/megaport/aws/aws-hosted-vif.png" alt="Add Hosted VIF connection" shadow={true} width={700} />

4. Specify the connection details:

   * **Connection Name** -- The name of your VXC to be shown in the <Link href="https://portal.megaport.com">Megaport Portal</Link>.

     <Tip>
       Match this to the VXC name on the next screen for easy mapping.
     </Tip>

   * **Service Level Reference** (optional) -- Specify a unique identifying number for your Megaport service to be used for billing purposes, such as a cost center number, unique customer ID, or purchase order number. The service level reference number appears for each service under the Product section of the invoice. You can also edit this field for an existing service.

   * **Rate Limit** -- The speed of your connection in Mbps. Accepted values start at 1 Mbps and scale in 1 Mbps increments. Maximum available speed depends on location and service availability. Note the sum of all hosted virtual VXCs to a service can exceed the Port capacity (for example, 10 Gbps, 100 Gbps, or higher) but the total aggregate will never burst beyond the Port capacity.

   * **VXC State** -- Select **Enabled** or **Shut Down** to define the initial state of the connection. For more information, see [Shutting Down a VXC for Failover Testing](/connections/shut-down-vxc).

     <Note>
       If you select **Shut Down**, traffic will not flow through this service and it will behave as if it was down on the Megaport network. Billing for this service will remain active and you will still be charged for this connection.
     </Note>

   * **Preferred A-End VLAN** (optional) -- Specify an unused VLAN ID for this connection. This must be a unique VLAN ID on this Port and can range from 2 to 4093. If you specify a VLAN ID that is already in use, the system displays the next available VLAN number. The VLAN ID must be unique to proceed with the order. If you don't specify a value, Megaport will assign one.

     Alternatively, you can select **Untagged** to remove the VLAN tagging for this connection. The untagged option limits you to only one VXC deployed on this Port. The VLAN for the AWS side termination will be automatically allocated and will not affect your Megaport details. You must use untagged VLANs if you are creating a MACsec connection.

   * **Minimum Term** -- Select No Minimum Term, 12 Months, 24 Months, 36 Months, 48 Months, or 60 Months. Longer terms result in a lower monthly rate. *12 Months* is selected by default. Take note of the information on the screen to avoid early termination fees (ETF).

     Enable the [Minimum Term Renewal](/portal-admin/auto-renew/#auto-renew) option for services with a 12, 24, 36, 48 or 60-month term to automatically renew the contract at the same discounted price and term length at the end of the contract. If you don't renew the contract, at the end of the term,  the contract will automatically roll over to month-to-month contract for the following billing period, at the same price, without term discounts.

     For more information, see [VXC Pricing and Contract Terms](/finance/vxc-pricing) and [VXC, Megaport Internet, and IX Billing](/finance/billing-details).

   * **Resource Tags** -- You can use resource tags to add your own reference metadata to a Megaport service.\
     To add a tag:
     1. Click **Add Tags**.
     2. Click  **Add New Tag**.
     3. Enter details into the fields:
        * **Key** -- string maximum length 128. Valid values are a-z 0-9 \_ : . / \ -
        * **Value** -- string maximum length 256. Valid values are a-z A-Z 0-9 \_ : . @ / + \ - (space)
     4. Click **Save**.
        If you already have resource tags for that service, you can manage them by clicking **Manage Tags**.
     <Warning>
       Never include sensitive information in a resource tag. Sensitive information includes commands that return existing tag definitions and information that will identify a person or company.
     </Warning>

   <Image src="/images/cloud/megaport/port-cloud-create-details.png" alt="AWS Hosted VIF connection" shadow={true} width={500} />

5. Click **Next**.

6. Specify the cloud details.

   * Select **Public** or **Private**.

     * **Private** -- Access private AWS services such as a VPC, EC2 instances, load balancers, RDS DB instances, on private IP address space.
     * **Public** -- Access public AWS services such as Amazon Simple Storage Service (S3), DynamoDB, CloudFront, and Glacier. You will also receive [Amazon's global IP prefixes](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html) (approximately 2,000 prefixes).

       <Note>
         Public VIFs require manual intervention from Amazon and could take up to 72 hours. For more information, see [Configuring Public AWS Connections with IP Addresses Provided by AWS](/cloud/megaport/aws/aws-public-ip).
       </Note>

   * **AWS Connection Name** -- This is a text field and will be the name of your virtual interface that appears in the AWS console. For easy mapping, use the same name for this field as you did for the VXC name on the previous screen.

   * **AWS Account ID** -- This is the ID of the account you want to connect. You can find this value in the management section of your AWS console.

   * **Customer ASN** -- Your network's autonomous system number (ASN). For private Direct Connects, this must be a private ASN in the range 64512 - 65535. For public Direct Connects, this can be a private or public ASN in the range 2 - 4294967294. If using a public ASN, you must own it.

   * **BGP Auth Key** (optional) -- Specify the BGP <Gloss term="MD5" anchor="md5" /> key. If you leave this blank, Megaport negotiates a key automatically for you with AWS which will be displayed in the Megaport Portal. The key is not displayed in the AWS console.
     <Note>
       The BGP Auth Key is generated during the ordering process when this field is left blank. It will not be displayed on the Summary page when ordering. To see the key, view the Connection Settings after the service has been deployed and is live.
     </Note>

   * **Customer IP Address** -- The IP Address space (in CIDR format) you will use on your network for peering. For private connections, this field is optional and if left blank, Megaport assigns a private /30 address. For public connections, this field is required and needs public IPs (/30) allocated by you for BGP connectivity. You must own the public IPs.

   * **Amazon IP Address** -- The IP address space in CIDR format assigned in the AWS VPC network for peering. For private connections, this field is optional and if left blank, Megaport automatically assigns a private /30 address. For public connections, this field is required and needs public IPs (/30) allocated by you for BGP connectivity. You must own the public IPs.

   * **Prefixes** -- For Public connections only - IP Prefixes to announce to AWS. RIR-assigned IPv4 addresses only. Specify the prefixes you will advertise when deploying a Public Direct Connect.

     Once you configure Prefixes for a Public connection, you cannot change them and the field is grayed out. To change this value, create a support ticket with AWS so they can make this change a non-impacting way. Or you can cancel the Hosted VIF and reorder. In both cases, you need to wait for AWS to manually approve the request.

     <Image src="/images/cloud/megaport/aws/aws-hv-aws-details.png" alt="AWS details for Hosted VIF connection" shadow={true} width={700} />

7. Click **Next**.\
   A summary page appears that includes the monthly cost. Click **Back** to make changes or click **Add VXC** to move this configuration to your cart. Once you have finished this configuration, you can configure additional VXCs or proceed through the checkout process.

   <Image src="/images/cloud/megaport/aws/aws-hv-summary.png" alt="AWS details for Hosted VIF connection" shadow={true} width={700} />

8. Click **Review Order** to proceed through the checkout process, or click **Save** to save the configured services before placing the order.

9. Review the Important Information section and confirm agreement with the Service Agreements.

   If you do not have a promotion code, skip to the **Order Now** step. If you do have a promotion code, enter it into the **Enter discount code** field then click **Apply**. Alternatively, if a code already appears in the **Discounts** field, verify it is correct and click **Apply**.

   The promotional discount appears below the Standard Term discount.  This discount is not reflected in the Monthly Rate shown here, it is applied at the time of billing.  If an invalid or expired code causes an error with your order, contact your Megaport Account Manager for a replacement code.

   <Image src="/images/snippets/add-promo-code.png" alt="Add Promo Code" shadow={true} width={750} />

   If you entered an incorrect promotion code, you can remove it by clicking **Remove**.

10. Click **Order Now**.

11. Accept the virtual interface in AWS.\
    To review and accept in the AWS console, go to **Services** >
    **AWS Direct Connect** for the Direct Connect dashboard. For a
    private virtual interface, you must also have an existing virtual
    private gateway or Direct Connect gateway. For more information, see the
    [AWS documentation](https://docs.aws.amazon.com/directconnect/latest/UserGuide/accepthostedvirtualinterface.html).

Once you accept the hosted VIF in AWS, the VXC state changes to configured in the Megaport Portal. You can review the configuration details to get the A-End VLAN ID, BGP Auth Key, and IP addresses that you need to configure your router.

**To edit a Hosted Virtual Interface**

* Click the gear icon next to the connection in the Megaport Portal to make changes.

  <Image src="/images/cloud/megaport/aws/aws-gear-icon.png" alt="Edit a Hosted VIF" shadow={true} width={200} />

  If you have permissions to edit VXCs, you can modify the details on
  the Megaport side including the connection name, VLAN ID, Service Level Reference, and rate limit.\
  If this is a termed connection, you cannot reduce the term.\
  Once submitted, those changes take effect in a few minutes.

  You can also make changes to the AWS details of a VXC. When you
  change the AWS details, the service will be rebuilt and you need to
  accept changes to the connection in AWS.

**To delete a Hosted Virtual Interface**

* Click the trash icon next to the connection in the Megaport Portal.

  <Image src="/images/cloud/megaport/aws/aws-trash-icon.png" alt="Trash icon" shadow={true} width={200} />

  For more information, see [Terminating a VXC](/connections/terminating-vxc).
