Monday, March 14, 2022

Using Terraform on NSX-T on VMC/AWS - Part 3

 Create your first resource on VMC via Terraform


The HCL code on githup


terraform {

  required_providers {

    nsxt = {

      source = "vmware/nsxt"

      version = "3.2.5"

    }

  }

}

# The below Token and NSX host are just for explanation :-) , they are not real data

provider "nsxt" {

  host                 = "https://nsx-1-38-60-79.rp.vmwarevmc.com/vmc/reverse-proxy/api/orgs/53045f5a-59f7-4921-8bcb-0b09e8c3ac16/sddcs/24163dc6-2b22-475b-b197-167932ef5124/sks-nsxt-manager"

  vmc_token            = "12345IZf8Elb9VFTorfvnoyk6CsDXi15678utfdsFHfdsdafsadfasfIUTdghuy7815"

  allow_unverified_ssl = true

  enforcement_point    = "vmc-enforcementpoint"

}


resource "nsxt_policy_fixed_segment" "Terraform-segment1" {

  display_name      = "Terraform-segment1"

  description       = "Terraform provisioned Segment"

  connectivity_path = "/infra/tier-1s/cgw"


  subnet {

    cidr        = "12.12.2.1/24"

    dhcp_ranges = ["12.12.2.100-12.12.2.160"]


    dhcp_v4_config {

      server_address = "12.12.2.2/24"

      lease_time     = 36000

    

    }

  }

}

No comments:

Post a Comment

NSX-T (local log in) with VIDM integration

We will explain how to log in with a local account to your NSX-T which integrated with VIDM. We integrated our NSX-T into the VIDM. We had a...