terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

Direct Link: Dedicated VLAN Mapping

Open MalarvizhiK opened this issue 2 years ago • 2 comments

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

MalarvizhiK avatar Nov 03 '23 13:11 MalarvizhiK

@MalarvizhiK Can you fix the checks

hkantare avatar Nov 15 '23 05:11 hkantare

The GA for the feature is scheduled in 1Q 2024. Hence, I will wait some more time.

MalarvizhiK avatar Dec 05 '23 10:12 MalarvizhiK

@hkantare As mentioned earlier, VLAN tagging enablement for DL dedicated feature is GAed.

We want to publish the terraform code for the same.

MalarvizhiK avatar Mar 08 '24 05:03 MalarvizhiK

Output from acceptance testing:

malark@Malars-MacBook-Pro terraform-provider-ibm %  make testacc TEST=./ibm/service/directlink TESTARGS='-run=TestAccIBMDLGatewayVC_basic'     
==> Checking that code complies with gofmt requirements...

....
=== RUN   TestAccIBMDLGatewayVC_basic
Create Gateway ....0 VLAN Value Create 0 VLAN Value Create --- PASS: TestAccIBMDLGatewayVC_basic (131.31s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink	133.202s

MalarvizhiK avatar Mar 08 '24 17:03 MalarvizhiK

Output from acceptance testing

malark@Malars-MacBook-Pro terraform-provider-ibm %  make testacc TEST=./ibm/service/directlink TESTARGS='-run=TestAccIBMDLGatewayConnect_basic'
==> Checking that code complies with gofmt requirements...

=== RUN   TestAccIBMDLGatewayConnect_basic
Create Gateway ....--- PASS: TestAccIBMDLGatewayConnect_basic (649.04s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink	650.940s

MalarvizhiK avatar Mar 08 '24 17:03 MalarvizhiK

Output from acceptance testing

malark@Malars-MacBook-Pro terraform-provider-ibm %  make testacc TEST=./ibm/service/directlink TESTARGS='-run=TestAccIBMDLGateway_basic'
==> Checking that code complies with gofmt requirements...

=== RUN   TestAccIBMDLGateway_basic
Create Gateway ....0 VLAN Value Create 0 VLAN Value Create 
--- PASS: TestAccIBMDLGateway_basic (109.77s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/directlink	111.629s

MalarvizhiK avatar Mar 08 '24 17:03 MalarvizhiK

Share test execuitpn results of respective res/ds

hkantare avatar Mar 12 '24 14:03 hkantare

Resource block results

malark@Malars-MacBook-Pro dl-test % terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # ibm_dl_gateway.test_dl_gateway_new will be created
  + resource "ibm_dl_gateway" "test_dl_gateway_new" {
      + bfd_status                      = (known after apply)
      + bfd_status_updated_at           = (known after apply)
      + bgp_asn                         = 64999
      + bgp_cer_cidr                    = (known after apply)
      + bgp_ibm_asn                     = (known after apply)
      + bgp_ibm_cidr                    = (known after apply)
      + bgp_status                      = (known after apply)
      + bgp_status_updated_at           = (known after apply)
      + carrier_name                    = "myCarrierName"
      + change_request                  = (known after apply)
      + completion_notice_reject_reason = (known after apply)
      + connection_mode                 = (known after apply)
      + created_at                      = (known after apply)
      + crn                             = (known after apply)
      + cross_connect_router            = "LAB-xcr01.dal09"
      + customer_name                   = "myCustomerName"
      + default_export_route_filter     = (known after apply)
      + default_import_route_filter     = (known after apply)
      + global                          = true
      + id                              = (known after apply)
      + link_status                     = (known after apply)
      + link_status_updated_at          = (known after apply)
      + loa_reject_reason               = (known after apply)
      + location_display_name           = (known after apply)
      + location_name                   = "dal09"
      + metered                         = true
      + name                            = "gatewaynew"
      + operational_status              = (known after apply)
      + port                            = (known after apply)
      + provider_api_managed            = (known after apply)
      + remove_vlan                     = false
      + resource_controller_url         = (known after apply)
      + resource_crn                    = (known after apply)
      + resource_group                  = "bf823d4f45b64ceaa4671bee0479346e"
      + resource_group_name             = (known after apply)
      + resource_name                   = (known after apply)
      + resource_status                 = (known after apply)
      + speed_mbps                      = 1000
      + tags                            = (known after apply)
      + type                            = "dedicated"
      + vlan                            = 3967
    }

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: Argument is deprecated
│ 
│   with provider["registry.terraform.io/ibm-cloud/ibm"],
│   on main.tf line 19, in provider "ibm":
│   19:   generation = 2
│ 
│ The generation field is deprecated and will be removed after couple of releases
│ 
│ (and one more similar warning elsewhere)
╵

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

ibm_dl_gateway.test_dl_gateway_new: Creating...
ibm_dl_gateway.test_dl_gateway_new: Still creating... [10s elapsed]
ibm_dl_gateway.test_dl_gateway_new: Still creating... [20s elapsed]
ibm_dl_gateway.test_dl_gateway_new: Creation complete after 22s [id=35e37215-e349-459e-a45f-82eb4adfadf1]
╷
│ Warning: Argument is deprecated
│ 
│   with provider["registry.terraform.io/ibm-cloud/ibm"],
│   on main.tf line 19, in provider "ibm":
│   19:   generation = 2
│ 
│ The generation field is deprecated and will be removed after couple of releases
╵

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
malark@Malars-MacBook-Pro dl-test % terraform show
# ibm_dl_gateway.test_dl_gateway_new:
resource "ibm_dl_gateway" "test_dl_gateway_new" {
    bgp_asn                     = 64999
    bgp_cer_cidr                = "169.254.0.22/30"
    bgp_ibm_asn                 = 13884
    bgp_ibm_cidr                = "169.254.0.21/30"
    bgp_status                  = "idle"
    bgp_status_updated_at       = "2024-03-13T06:46:43.074Z"
    carrier_name                = "myCarrierName"
    connection_mode             = "direct"
    created_at                  = "2024-03-13T06:46:46.475Z"
    crn                         = "crn:v1:staging:public:directlink:dal09:a/3b1bd7fa2bc3406ea70ba4ade8aa3f1b::dedicated:35e37215-e349-459e-a45f-82eb4adfadf1"
    cross_connect_router        = "LAB-xcr01.dal09"
    customer_name               = "myCustomerName"
    default_export_route_filter = "permit"
    default_import_route_filter = "permit"
    global                      = true
    id                          = "35e37215-e349-459e-a45f-82eb4adfadf1"
    link_status                 = "down"
    link_status_updated_at      = "2024-03-13T06:46:43.074Z"
    location_display_name       = "Dallas 09"
    location_name               = "dal09"
    metered                     = true
    name                        = "gatewaynew"
    operational_status          = "awaiting_loa"
    remove_vlan                 = false
    resource_controller_url     = "https://test.cloud.ibm.com/interconnectivity/direct-link"
    resource_crn                = "crn:v1:staging:public:directlink:dal09:a/3b1bd7fa2bc3406ea70ba4ade8aa3f1b::dedicated:35e37215-e349-459e-a45f-82eb4adfadf1"
    resource_group              = "bf823d4f45b64ceaa4671bee0479346e"
    resource_group_name         = "bf823d4f45b64ceaa4671bee0479346e"
    resource_name               = "gatewaynew"
    resource_status             = "awaiting_loa"
    speed_mbps                  = 1000
    tags                        = []
    type                        = "dedicated"
    vlan                        = 3967
}
malark@Malars-MacBook-Pro dl-test % 

MalarvizhiK avatar Mar 13 '24 06:03 MalarvizhiK

Data block results

data "ibm_dl_gateway" "test_dl_gateway" {
                        name = ibm_dl_gateway.test_dl_gateway_new.name
                 }

output "dl_instances" {
  value = data.ibm_dl_gateway.test_dl_gateway
}

Outputs:


dl_instances = {
    as_prepends                 = []
    bgp_asn                     = 64999
    bgp_cer_cidr                = "169.254.0.22/30"
    bgp_ibm_asn                 = 13884
    bgp_ibm_cidr                = "169.254.0.21/30"
    bgp_status                  = "connect"
    bgp_status_updated_at       = "2024-03-13T07:00:38.738Z"
    connection_mode             = "direct"
    created_at                  = "2024-03-13T06:46:46.475Z"
    crn                         = "crn:v1:staging:public:directlink:dal09:a/3b1bd7fa2bc3406ea70ba4ade8aa3f1b::dedicated:35e37215-e349-459e-a45f-82eb4adfadf1"
    cross_connect_router        = "LAB-xcr01.dal09"
    default_export_route_filter = "permit"
    default_import_route_filter = "permit"
    gateway_vcs                 = []
    global                      = true
    id                          = "35e37215-e349-459e-a45f-82eb4adfadf1"
    link_status                 = "down"
    link_status_updated_at      = "2024-03-13T06:46:43.074Z"
    location_display_name       = "Dallas 09"
    location_name               = "dal09"
    metered                     = true
    name                        = "gatewaynew"
    operational_status          = "awaiting_loa"
    resource_group              = "bf823d4f45b64ceaa4671bee0479346e"
    speed_mbps                  = 1000
    type                        = "dedicated"
    vlan                        = 3967
}



MalarvizhiK avatar Mar 13 '24 07:03 MalarvizhiK