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

[RDS] Error Deploying RDS inside a project with 1.2x version #561

Closed ypilpre closed 3 years ago

ypilpre commented 3 years ago

Hi there,

We encounter a bug when trying to deploy a RDS instance in a project. The loadUserProjects function in terraform-provider-flexibleengine/vendor/github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config/config.go return only the region main project and not subproject. This case occurs only in RDS deployment as far as we tested it. We didn't get this bug on 1.19 version.

Terraform Version

Terraform 1.0 (also checked with 0.13) FlexibleEngineCloudProvider : 1.21 or 1.20

Affected Resource(s)

flexibleengine_rds_instance_v3

Terraform Configuration Files

resource "flexibleengine_rds_instance_v3" "test_pg_instance" {
  name              = "terraform_test_rds_pg_instance"
  flavor            = "rds.pg.c6.xlarge.4"
  availability_zone = ["eu-west-0a"]
  security_group_id = "514ca93e-0901-42a3-9234-62396a203ff2"
  vpc_id            = "1d7fa70a-3ad1-4f48-a143-fc999514b463"
  subnet_id         = "0b03556e-d32e-4e4a-b485-ee9410a6448b"
  db {
    type     = "PostgreSQL"
    version  = "11"
    password = "********"
    port     = "5432"
  }
  volume {
    type = "COMMON"
    size = 100
  }

}

Debug Output

2021-06-23T18:53:52.987+0200 [DEBUG] plugin.terraform-provider-flexibleengine_v1.21.0: 2021/06/23 18:53:52 [DEBUG] FlexibleEngine Request URL: GET https://iam.eu-west-0.prod-cloud-ocb.orange-business.com/v3/projects?domain_id=2e599dc44af74b03b7007985fd4f73c8&name=eu-west-0

Expected Behavior

A successful RDS deployement

Actual Behavior

2021/06/23 18:53:53 [DEBUG] flexibleengine_rds_instance_v3.test_pg_instance: apply errored, but we're indicating that via the Error pointer rather than returning it: Error creating FlexibleEngine RDS instance: Action Forbidden
2021/06/23 18:53:53 [ERROR] eval: *terraform.EvalApplyPost, err: Error creating FlexibleEngine RDS instance: Action Forbidden
2021/06/23 18:53:53 [ERROR] eval: *terraform.EvalSequence, err: Error creating FlexibleEngine RDS instance: Action Forbidden

Error: Error creating FlexibleEngine RDS instance: Action Forbidden

  on rds.tf line 1, in resource "flexibleengine_rds_instance_v3" "test_pg_instance":
   1: resource "flexibleengine_rds_instance_v3" "test_pg_instance" 
ShiChangkuo commented 3 years ago

similar to #548, you can try the next release.

ShiChangkuo commented 3 years ago

@ypilpre have you try the v1.22.0 which will fix the issue?

ypilpre commented 3 years ago

I confirmed that 1.22.0 fix the issue