FlexibleEngineCloud / terraform-provider-flexibleengine

Terraform flexibleengine provider
https://www.terraform.io/docs/providers/flexibleengine/
Mozilla Public License 2.0
30 stars 53 forks source link

[flexibleengine_compute_instance_v2] network param is illegal #678

Closed aheritier-csgroup closed 2 years ago

aheritier-csgroup commented 2 years ago

Hi, The provided example does not work with simple ECS instance.

Terraform Version

Terraform v1.1.2 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

The ones from the example directory

Panic Output

Error: Error creating FlexibleEngine server: Bad request with: [POST https://ecs.eu-west-0.prod-cloud-ocb.orange-business.com/v2/26bf08cfcba14b0cb96a28870f89a748/servers], error message: {"badRequest":{"message":"network param is illegal, no virtual private cloud found","code":"400"}}

Expected Behavior

Instance should be created

Actual Behavior

API fails with "network param is illegal"

Steps to Reproduce

Play the example with instance,network and keypairs.

ShiChangkuo commented 2 years ago

@aheritier-csgroup the example is outdated, please ues flexibleengine_vpc_subnet_v1 to create the subnet.

You can use Terraform module to create vpc and ecs. https://registry.terraform.io/modules/FlexibleEngineCloud/vpc/flexibleengine/latest https://registry.terraform.io/modules/FlexibleEngineCloud/ecs/flexibleengine/latest

aheritier-csgroup commented 2 years ago

"please ues flexibleengine_vpc_subnet_v1 to create the subnet." Flexibleengine_compute_instance_v2 doesn't take a vpc id as a parameter.

Hasardine commented 2 years ago

@aheritier-csgroup, Here is a basic example to create a VPC, Subnet & ECS together using the Terraform modules. Corresponding to Router, network, subnet & ECS.

ECS take uuid as parameter. It is corresponding to "Network ID" in FE console shown in the "subnet information". If you're confortable with variables, use it to fill uuid or do your terraform apply in 2 steps.

Replace all the "XXXX" values by your own. main.txt

aheritier-csgroup commented 2 years ago

It doesn't work. Same error:

Error: Error creating FlexibleEngine server: Bad request with: [POST https://ecs.eu-west-0.prod-cloud-ocb.orange-business.com/v2/26bf08cfcba14b0cb96a28870f89a748/servers], error message: {"badRequest":{"message":"network param is illegal, no virtual private cloud found","code":"400"}}

The API doesn't implement the network param:

network {
      #Correspond to the "Network ID" in FE console shown in the "subnet information" 
    uuid = "XXXX"
  }
Hasardine commented 2 years ago

@aheritier-csgroup To help, you might share your logs or provide code. But it doesn't seem to be a problem with the API or the provider as it works for many of us.

ShiChangkuo commented 2 years ago

@aheritier-csgroup any updates?

ShiChangkuo commented 2 years ago

I'm going to close this issue because there are no updates for 20 days. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.