Open Kostoprav19 opened 4 months ago
And If I add vnics I also get error regarding vncics:
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# megaport_mve.fortigate will be updated in-place
~ resource "megaport_mve" "fortigate" {
~ vnics = [
~ {
~ description = "Data Plane" -> "mgmt"
},
+ {
+ description = "to_ipxgrx"
},
+ {
+ description = "to_aws"
},
+ {
+ description = "reserved1"
},
+ {
+ description = "reserved2"
},
]
# (31 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
╷
│ Warning: Value for undeclared variable
│
│ The root module does not declare a variable named "tags" but a value was found in file "test-config.tfvars". If you meant to use this value, add a "variable" block to the configuration.
│
│ To silence these warnings, use TF_VAR_... environment variables to provide certain "global" settings to all configurations in your organization. To reduce the verbosity of these warnings, use the -compact-warnings option.
╵
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
megaport_mve.fortigate: Modifying...
megaport_mve.fortigate: Still modifying... [10s elapsed]
megaport_mve.fortigate: Still modifying... [20s elapsed]
megaport_mve.fortigate: Still modifying... [30s elapsed]
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .vnics[0].description: was cty.StringVal("mgmt"), but now cty.StringVal("Data Plane").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .vnics: element 1 has vanished.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .vnics: element 2 has vanished.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .vnics: element 3 has vanished.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .vnics: element 4 has vanished.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to megaport_mve.fortigate, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .last_updated: was cty.StringVal("Monday, 17-Jun-24 18:14:56 EEST"), but now cty.StringVal("Monday, 17-Jun-24 18:16:18 EEST").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
The product name should be fixed, and we updated the vnics field so the description can't be updated without replacing the resource. You can't update VNICs after the MVE is created, so that's why those errors were happening.
I can confirm that now MVE is updated through recreation. But I have issues with related to MVE VXC's. They are failing to update with error Product [xxx-xxx-xxx-xxx-xxx] Not Found
terraform apply -var-file test-config.tfvars
data.aws_secretsmanager_secret.megaport: Reading...
data.aws_secretsmanager_secret.megaport: Read complete after 0s [id=arn:aws:secretsmanager:eu-central-1:893677514652:secret:megaport-dev-EMVzzv]
data.aws_secretsmanager_secret_version.megaport: Reading...
data.aws_secretsmanager_secret_version.megaport: Read complete after 0s [id=arn:aws:secretsmanager:eu-central-1:893677514652:secret:megaport-dev-EMVzzv|AWSCURRENT]
data.megaport_location.default: Reading...
data.megaport_location.aws[0]: Reading...
data.megaport_location.default: Read complete after 4s [name=Equinix PA2/3]
megaport_port.ipxgrx: Refreshing state...
data.megaport_partner.internet: Reading...
megaport_mve.fortigate: Refreshing state...
data.megaport_location.aws[0]: Read complete after 4s [name=Interxion PAR5]
data.megaport_partner.aws_port: Reading...
data.megaport_partner.internet: Read complete after 1s
megaport_vxc.ipxgrx[0]: Refreshing state...
megaport_vxc.internet: Refreshing state...
data.megaport_partner.aws_port: Read complete after 2s
megaport_vxc.aws[0]: Refreshing state...
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
-/+ destroy and then create replacement
Terraform will perform the following actions:
# megaport_mve.fortigate must be replaced
-/+ resource "megaport_mve" "fortigate" {
~ admin_locked = false -> (known after apply)
~ attribute_tags = {} -> (known after apply)
~ buyout_port = false -> (known after apply)
~ cancelable = true -> (known after apply)
~ company_name = "1NCE GmbH" -> (known after apply)
~ company_uid = "e5f088f0-15b6-44da-88a9-3ef8569b94ec" -> (known after apply)
~ contract_end_date = "Wednesday, 25-Jun-25 17:00:00 EEST" -> (known after apply)
~ contract_start_date = "Wednesday, 26-Jun-24 12:13:27 EEST" -> (known after apply)
~ create_date = "Wednesday, 26-Jun-24 12:12:30 EEST" -> (known after apply)
~ created_by = "4603ba5d-50e2-42d2-a03d-b103b29c1c0c" -> (known after apply)
~ last_updated = "Wednesday, 26-Jun-24 12:18:13 EEST" -> (known after apply)
~ live_date = "Wednesday, 26-Jun-24 12:13:27 EEST" -> (known after apply)
~ location_details = {
~ city = "Paris" -> (known after apply)
~ country = "France" -> (known after apply)
~ metro = "Paris" -> (known after apply)
~ name = "Equinix PA2/3" -> (known after apply)
} -> (known after apply)
~ locked = false -> (known after apply)
~ market = "FR" -> (known after apply)
~ marketplace_visibility = false -> (known after apply)
~ mve_size = "MEDIUM" -> (known after apply)
~ product_id = 202118 -> (known after apply)
~ product_type = "MVE" -> (known after apply)
~ product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ provisioning_status = "LIVE" -> (known after apply)
~ resources = {
+ interface = (known after apply)
~ virtual_machine = [
- {
- cpu_count = 4 -> null
- id = 0 -> null
- image = {
- id = 58 -> null
- product = "FortiGate-VM" -> null
- vendor = "Fortinet" -> null
- version = "7.4.3" -> null
} -> null
- resource_type = "virtual_machine" -> null
- up = true -> null
- vnics = [
- {
- description = "mgmt" -> null
- vlan = 3905 -> null
},
- {
- description = "to_ipxgrx" -> null
- vlan = 2730 -> null
},
- {
- description = "to_aws" -> null
- vlan = 599 -> null
},
] -> null
},
] -> (known after apply)
} -> (known after apply)
+ secondary_name = (known after apply)
+ terminate_date = (known after apply)
~ usage_algorithm = "POST_PAID_FIXED" -> (known after apply)
~ vendor = "FORTINET" -> (known after apply)
~ virtual = false -> (known after apply)
~ vnics = [ # forces replacement
~ {
~ description = "mgmt" -> "mgmt1"
},
# (2 unchanged elements hidden)
]
~ vxc_auto_approval = false -> (known after apply)
~ vxc_permitted = true -> (known after apply)
# (5 unchanged attributes hidden)
}
# megaport_vxc.aws[0] will be updated in-place
~ resource "megaport_vxc" "aws" {
~ a_end = {
~ current_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ inner_vlan = 3203 -> (known after apply)
~ location = "Equinix PA2/3" -> (known after apply)
~ location_id = 515 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "e5f088f0-15b6-44da-88a9-3ef8569b94ec" -> (known after apply)
~ product_name = "LBO-EU-Paris-ICSS-MVE" -> (known after apply)
~ requested_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ secondary_name = "" -> (known after apply)
# (3 unchanged attributes hidden)
}
~ admin_locked = false -> (known after apply)
~ attribute_tags = {} -> (known after apply)
~ b_end = {
~ current_product_uid = "09e400a0-1b72-49ec-8ff0-5a71a4fc7774" -> (known after apply)
~ inner_vlan = 0 -> (known after apply)
~ location = "Interxion PAR5" -> (known after apply)
~ location_id = 527 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "605cb850-dfb4-4a05-a171-8bf17757b3a2" -> (known after apply)
~ product_name = "EU (Paris) (eu-west-3)" -> (known after apply)
~ secondary_name = "" -> (known after apply)
~ vnic_index = 0 -> (known after apply)
# (3 unchanged attributes hidden)
}
~ b_end_partner_config = {
+ partner_a_end_config = (known after apply)
# (2 unchanged attributes hidden)
}
~ cancelable = true -> (known after apply)
~ company_name = "1NCE GmbH" -> (known after apply)
~ contract_end_date = "Thursday, 25-Jul-24 17:00:00 EEST" -> (known after apply)
~ contract_start_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ create_date = "Wednesday, 26-Jun-24 12:13:08 EEST" -> (known after apply)
~ csp_connections = [
- {
- bandwidth = 100 -> null
- bandwidths = [
- 100,
] -> null
- connect_type = "AWSHC" -> null
- connection_id = "" -> null
- name = "LBO-EU-Paris-ICSS-AWS" -> null
- owner_account = "893677514652" -> null
- resource_name = "b_csp_connection" -> null
- resource_type = "csp_connection" -> null
},
] -> (known after apply)
~ distance_band = "METRO" -> (known after apply)
~ last_updated = "Wednesday, 26-Jun-24 12:18:46 EEST" -> (known after apply)
~ live_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ locked = false -> (known after apply)
+ port_interfaces = (known after apply)
~ product_type = "VXC" -> (known after apply)
~ provisioning_status = "LIVE" -> (known after apply)
+ secondary_name = (known after apply)
~ service_id = 0 -> (known after apply)
~ shutdown = false -> (known after apply)
~ usage_algorithm = "POST_PAID_HOURLY_SPEED_METRO_VXC" -> (known after apply)
+ virtual_router = (known after apply)
~ vll = {
~ a_vlan = 599 -> (known after apply)
~ b_vlan = 599 -> (known after apply)
~ description = "" -> (known after apply)
~ id = 0 -> (known after apply)
~ name = "" -> (known after apply)
~ rate_limit_mbps = 100 -> (known after apply)
~ resource_name = "vll" -> (known after apply)
~ resource_type = "vll" -> (known after apply)
} -> (known after apply)
~ vxc_approval = {
~ message = "" -> (known after apply)
~ new_speed = 0 -> (known after apply)
~ status = "" -> (known after apply)
~ type = "" -> (known after apply)
~ uid = "" -> (known after apply)
} -> (known after apply)
# (8 unchanged attributes hidden)
}
# megaport_vxc.internet will be updated in-place
~ resource "megaport_vxc" "internet" {
~ a_end = {
~ current_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ inner_vlan = 2981 -> (known after apply)
~ location = "Equinix PA2/3" -> (known after apply)
~ location_id = 515 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "e5f088f0-15b6-44da-88a9-3ef8569b94ec" -> (known after apply)
~ product_name = "LBO-EU-Paris-ICSS-MVE" -> (known after apply)
~ requested_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ secondary_name = "" -> (known after apply)
# (3 unchanged attributes hidden)
}
~ admin_locked = false -> (known after apply)
~ attribute_tags = {} -> (known after apply)
~ b_end = {
~ current_product_uid = "52cb6573-5cc8-45cc-8af1-d21db1fe3485" -> (known after apply)
~ inner_vlan = 0 -> (known after apply)
~ location = "Equinix PA2/3" -> (known after apply)
~ location_id = 515 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "2f83dc65-5d4c-4730-a66d-926db48a0326" -> (known after apply)
~ product_name = "Megaport Internet" -> (known after apply)
~ secondary_name = "" -> (known after apply)
~ vnic_index = 0 -> (known after apply)
# (3 unchanged attributes hidden)
}
~ cancelable = true -> (known after apply)
~ company_name = "1NCE GmbH" -> (known after apply)
~ contract_end_date = "Wednesday, 25-Jun-25 17:00:00 EEST" -> (known after apply)
~ contract_start_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ create_date = "Wednesday, 26-Jun-24 12:13:06 EEST" -> (known after apply)
~ csp_connections = [
- {
- connect_type = "TRANSIT" -> null
- customer_ip4_address = "162.43.161.29/31" -> null
- customer_ip6_network = "2a0a:1800:1c:e::/64" -> null
- ipv4_gateway_address = "162.43.161.28" -> null
- ipv6_gateway_address = "2a0a:1800:1c:e::1" -> null
- resource_name = "b_csp_connection" -> null
- resource_type = "csp_connection" -> null
},
] -> (known after apply)
~ distance_band = "METRO" -> (known after apply)
~ last_updated = "Wednesday, 26-Jun-24 12:18:45 EEST" -> (known after apply)
~ live_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ locked = false -> (known after apply)
+ port_interfaces = (known after apply)
~ product_type = "VXC" -> (known after apply)
~ provisioning_status = "LIVE" -> (known after apply)
+ secondary_name = (known after apply)
~ service_id = 0 -> (known after apply)
~ shutdown = false -> (known after apply)
~ usage_algorithm = "POST_PAID_HOURLY_NORMALISED_SPEED" -> (known after apply)
+ virtual_router = (known after apply)
~ vll = {
~ a_vlan = 3905 -> (known after apply)
~ b_vlan = 3905 -> (known after apply)
~ description = "" -> (known after apply)
~ id = 0 -> (known after apply)
~ name = "" -> (known after apply)
~ rate_limit_mbps = 100 -> (known after apply)
~ resource_name = "vll" -> (known after apply)
~ resource_type = "vll" -> (known after apply)
} -> (known after apply)
~ vxc_approval = {
~ message = "" -> (known after apply)
~ new_speed = 0 -> (known after apply)
~ status = "" -> (known after apply)
~ type = "" -> (known after apply)
~ uid = "" -> (known after apply)
} -> (known after apply)
# (8 unchanged attributes hidden)
}
# megaport_vxc.ipxgrx[0] will be updated in-place
~ resource "megaport_vxc" "ipxgrx" {
~ a_end = {
~ current_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ inner_vlan = 2532 -> (known after apply)
~ location = "Equinix PA2/3" -> (known after apply)
~ location_id = 515 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "e5f088f0-15b6-44da-88a9-3ef8569b94ec" -> (known after apply)
~ product_name = "LBO-EU-Paris-ICSS-MVE" -> (known after apply)
~ requested_product_uid = "42f8f153-8acc-498c-b1d3-6577f93dd97f" -> (known after apply)
~ secondary_name = "" -> (known after apply)
# (3 unchanged attributes hidden)
}
~ admin_locked = false -> (known after apply)
~ attribute_tags = {} -> (known after apply)
~ b_end = {
~ current_product_uid = "32ec2948-7f34-4ebd-b052-97c9d0bc5cf6" -> (known after apply)
~ inner_vlan = 0 -> (known after apply)
~ location = "Equinix PA2/3" -> (known after apply)
~ location_id = 515 -> (known after apply)
~ ordered_vlan = 0 -> (known after apply)
~ owner_uid = "e5f088f0-15b6-44da-88a9-3ef8569b94ec" -> (known after apply)
~ product_name = "LBO-EU-Paris-ICSS-Port" -> (known after apply)
~ secondary_name = "" -> (known after apply)
~ vnic_index = 0 -> (known after apply)
# (3 unchanged attributes hidden)
}
~ cancelable = true -> (known after apply)
~ company_name = "1NCE GmbH" -> (known after apply)
~ contract_end_date = "Thursday, 25-Jul-24 17:00:00 EEST" -> (known after apply)
~ contract_start_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ create_date = "Wednesday, 26-Jun-24 12:13:06 EEST" -> (known after apply)
+ csp_connections = (known after apply)
~ distance_band = "METRO" -> (known after apply)
~ last_updated = "Wednesday, 26-Jun-24 12:18:45 EEST" -> (known after apply)
~ live_date = "Wednesday, 26-Jun-24 12:14:07 EEST" -> (known after apply)
~ locked = false -> (known after apply)
+ port_interfaces = (known after apply)
~ product_type = "VXC" -> (known after apply)
~ provisioning_status = "LIVE" -> (known after apply)
+ secondary_name = (known after apply)
~ service_id = 0 -> (known after apply)
~ shutdown = false -> (known after apply)
~ usage_algorithm = "POST_PAID_HOURLY_SPEED_METRO_VXC" -> (known after apply)
+ virtual_router = (known after apply)
~ vll = {
~ a_vlan = 2730 -> (known after apply)
~ b_vlan = 2730 -> (known after apply)
~ description = "" -> (known after apply)
~ id = 0 -> (known after apply)
~ name = "" -> (known after apply)
~ rate_limit_mbps = 100 -> (known after apply)
~ resource_name = "vll" -> (known after apply)
~ resource_type = "vll" -> (known after apply)
} -> (known after apply)
~ vxc_approval = {
~ message = "" -> (known after apply)
~ new_speed = 0 -> (known after apply)
~ status = "" -> (known after apply)
~ type = "" -> (known after apply)
~ uid = "" -> (known after apply)
} -> (known after apply)
# (8 unchanged attributes hidden)
}
Plan: 1 to add, 3 to change, 1 to destroy.
╷
│ Warning: Value for undeclared variable
│
│ The root module does not declare a variable named "tags" but a value was found in file "test-config.tfvars". If you meant to use this value, add a "variable" block to the configuration.
│
│ To silence these warnings, use TF_VAR_... environment variables to provide certain "global" settings to all configurations in your organization. To reduce the verbosity of these warnings, use the -compact-warnings option.
╵
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
megaport_mve.fortigate: Destroying...
megaport_mve.fortigate: Destruction complete after 8s
megaport_mve.fortigate: Creating...
megaport_mve.fortigate: Still creating... [10s elapsed]
megaport_mve.fortigate: Still creating... [20s elapsed]
megaport_mve.fortigate: Still creating... [30s elapsed]
megaport_mve.fortigate: Creation complete after 39s
megaport_vxc.ipxgrx[0]: Modifying...
megaport_vxc.internet: Modifying...
megaport_vxc.aws[0]: Modifying...
╷
│ Error: Error Updating VXC
│
│ with megaport_vxc.internet,
│ on main.tf line 44, in resource "megaport_vxc" "internet":
│ 44: resource "megaport_vxc" "internet" {
│
│ Could not update VXC with ID a72a9c71-0749-44a2-94b7-6d9ee7dc4f29: PUT https://api-staging.megaport.com/v3/product/vxc/a72a9c71-0749-44a2-94b7-6d9ee7dc4f29: 400 (trace_id "6903799dab688b27e7ff9d9549861c70") Product [a72a9c71-0749-44a2-94b7-6d9ee7dc4f29] Not Found
╵
╷
│ Error: Error Updating VXC
│
│ with megaport_vxc.ipxgrx[0],
│ on main.tf line 61, in resource "megaport_vxc" "ipxgrx":
│ 61: resource "megaport_vxc" "ipxgrx" {
│
│ Could not update VXC with ID 8fd729b3-6635-4e56-8a04-9f15a3300dff: PUT https://api-staging.megaport.com/v3/product/vxc/8fd729b3-6635-4e56-8a04-9f15a3300dff: 400 (trace_id "f3d8d656372326307ec083d422488dc3") Product [8fd729b3-6635-4e56-8a04-9f15a3300dff] Not Found
╵
╷
│ Error: Error Updating VXC
│
│ with megaport_vxc.aws[0],
│ on main.tf line 82, in resource "megaport_vxc" "aws":
│ 82: resource "megaport_vxc" "aws" {
│
│ Could not update VXC with ID a7b44cda-28bc-4d64-b05b-8703114a8fcd: PUT https://api-staging.megaport.com/v3/product/vxc/a7b44cda-28bc-4d64-b05b-8703114a8fcd: 400 (trace_id "89b4016d9f9d0b7545987092d0b17493") Product [a7b44cda-28bc-4d64-b05b-8703114a8fcd] Not Found
This is also waiting on #95, the VXC is deleted when the MVE is but the provider doesn't correctly remove it from the state. Once that change is in it will correctly identify the VXC as deleted and recreate it.
Hey we're still working on this one, but in the mean time a workaround would be to add
lifecycle {
create_before_destroy = true
}
To your MVE. This will make sure that a new MVE is created, then the VXC is updated, then the old MVE is deleted. Without it the MVE is deleted and the VXC goes with it.
Hello!
When I try do modify
product_name
of megaport_mve resource I receive provider error:error message appear during apply phase: