Skip to content

Commit

Permalink
Merge pull request #120 from megaport/fix/more-guide-docs
Browse files Browse the repository at this point in the history
docs: additional examples
  • Loading branch information
MegaportPhilipBrowne authored Jul 24, 2024
2 parents 9e83389 + 8116e4d commit 699c869
Show file tree
Hide file tree
Showing 26 changed files with 1,339 additions and 181 deletions.
166 changes: 166 additions & 0 deletions docs/guides/full_ecosystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
page_title: "Full Ecosystem"
description: |-
Full Ecosystem Deployment
---

# Full Ecosystem

This guide provides an example configuration for deploying a full ecosystem of Megaport services.

## Example Configuration

This example configuration creates a Megaport Port, a Megaport LAG Port, a Megaport MCR, and three VXCs connecting the services to each other and to partners.

```terraform
provider "megaport" {
environment = "staging"
access_key = "access_key"
secret_key = "secret_Key"
accept_purchase_terms = true
}
data "megaport_location" "bne_nxt1" {
name = "NextDC B1"
}
data "megaport_location" "bne_nxt2" {
name = "NextDC B2"
}
data "megaport_location" "syd_gs" {
name = "Global Switch Sydney West"
}
data "megaport_partner" "aws_port" {
connect_type = "AWS"
company_name = "AWS"
product_name = "Asia Pacific (Sydney) (ap-southeast-2)"
location_id = data.megaport_location.syd_gs.id
}
resource "megaport_port" "port" {
product_name = "Megaport Port Example"
port_speed = 1000
location_id = data.megaport_location.bne_nxt1.id
contract_term_months = 12
marketplace_visibility = false
cost_centre = "Megaport Single Port Example"
}
resource "megaport_lag_port" "lag_port" {
product_name = "Megaport Lag Port Example"
port_speed = 10000
location_id = data.megaport_location.bne_nxt2.id
contract_term_months = 12
marketplace_visibility = false
lag_count = 1
cost_centre = "Lag Port Example"
}
resource "megaport_mcr" "mcr" {
product_name = "Megaport MCR Example"
port_speed = 2500
location_id = data.megaport_location.bne_nxt1.id
contract_term_months = 1
asn = 64555
}
resource "megaport_vxc" "port_vxc" {
product_name = "Megaport Port-to-Port VXC"
rate_limit = 1000
contract_term_months = 12
a_end = {
requested_product_uid = megaport_port.port.product_uid
}
b_end = {
requested_product_uid = megaport_lag_port.lag_port.product_uid
}
}
resource "megaport_vxc" "mcr_vxc" {
product_name = "Megaport Port-to-MCR VXC"
rate_limit = 1000
contract_term_months = 12
a_end = {
requested_product_uid = megaport_port.port.product_uid
ordered_vlan = 181
}
b_end = {
requested_product_uid = megaport_mcr.mcr.product_uid
ordered_vlan = 181
}
}
resource "megaport_vxc" "aws_vxc" {
product_name = "Megaport VXC Example - AWS"
rate_limit = 1000
contract_term_months = 1
a_end = {
requested_product_uid = megaport.mcr.mcr.product_uid
ordered_vlan = 191
}
b_end = {
requested_product_uid = data.megaport_partner.aws_port.product_uid
}
b_end_partner_config = {
partner = "aws"
aws_config = {
name = "Megaport VXC Example - AWS"
asn = 64550
type = "private"
connect_type = "AWS"
amazon_asn = 64551
owner_account = "123456789012"
}
}
}
resource "megaport_vxc" "gcp_vxc" {
product_name = "Megaport VXC Example - Google"
rate_limit = 1000
contract_term_months = 12
a_end = {
requested_product_uid = megaport_mcr.mcr.product_uid
ordered_vlan = 182
}
b_end = {}
b_end_partner_config = {
partner = "google"
google_config = {
pairing_key = "7e51371e-72a3-40b5-b844-2e3efefaee59/australia-southeast1/2"
}
}
}
resource "megaport_vxc" "azure_vxc" {
product_name = "Megaport VXC Example - Azure"
rate_limit = 200
contract_term_months = 12
a_end = {
requested_product_uid = megaport_mcr.mcr.product_uid
ordered_vlan = 0
}
b_end = {}
b_end_partner_config = {
partner = "azure"
azure_config = {
port_choice = "primary"
service_key = "1b2329a5-56dc-45d0-8a0d-87b706297777"
}
}
}
```
40 changes: 40 additions & 0 deletions docs/guides/lag_port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
page_title: "LAG Port"
description: |-
Lag Port Deployment
---

# LAG Port

This guide provides an example configuration for deploying a LAG Port.

## Example Configuration

This example configuration creates a LAG Port.

```terraform
provider "megaport" {
environment = "staging"
access_key = "access_key"
secret_key = "secret_Key"
accept_purchase_terms = true
}
data "megaport_location" "bne_nxt1" {
name = "NextDC B1"
}
resource "megaport_lag_port" "lag_port" {
product_name = "Megaport Lag Port Example"
port_speed = 10000
location_id = data.megaport_location.bne_nxt1.id
contract_term_months = 1
marketplace_visibility = false
lag_count = 1
cost_centre = "Lag Port Example"
}
```

## LAG Port Documentation

For more information on creating and using LAG ports with Megaport, please see [Creating a Link Aggregation Group (LAG) Port](https://docs.megaport.com/connections/lag/) and [Adding a Port to a LAG](https://docs.megaport.com/connections/lag-adding/).
56 changes: 56 additions & 0 deletions docs/guides/mcr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
page_title: "Megaport Cloud Router (MCR)"
description: |-
Megaport Cloud Router (MCR) Deployment
---

# Megaport Cloud Router (MCR)

This guide provides an example configuration for deploying a Megaport Cloud Router (MCR).

## Example Configuration

This example configuration creates a Megaport Cloud Router (MCR) with a prefix filter list.

```terraform
provider "megaport" {
environment = "staging"
access_key = "access_key"
secret_key = "secret_Key"
accept_purchase_terms = true
}
data "megaport_location" "bne_nxt1" {
name = "NextDC B1"
}
resource "megaport_mcr" "mcr" {
product_name = "Megaport MCR Example"
port_speed = 1000
location_id = data.megaport_location.bne_nxt1.id
contract_term_months = 1
prefix_filter_lists = [{
description = "Megaport Example Prefix Filter List"
address_family = "IPv4"
entries = [
{
action = "permit"
prefix = "10.0.1.0/24"
ge = 24
le = 24
},
{
action = "deny"
prefix = "10.0.2.0/24"
ge = 24
le = 24
}
]
}]
}
```

## Megaport Cloud Router Documentation

For more information on creating and using a Megaport Cloud Router, additional documentation is available [here](https://docs.megaport.com/mcr/).
Loading

0 comments on commit 699c869

Please sign in to comment.