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

Why limit flexibleengine_identity_role_v3 limit to 9 policies ? #499

Closed screwyy closed 3 years ago

screwyy commented 3 years ago

Hi there,

I have 11 policies I want to add to a role in flexibleengine_identity_role_v3 but terraform complains that there is a limit of 9. If you go in the FE console you can add more than 9 policies, so why is this limitation ?

Terraform Version

0.12.28

Affected Resource(s)

flexibleengine_identity_role_v3

Terraform Configuration Files

I have 11 policies but terraform complains that there is a limit of 9. If you go in the FE console you can add more than 9 policies, so why is this limitation ?

resource "flexibleengine_identity_role_v3" "graphite_team_project_role" {
  name        = "graphite_team_project_role"
  description = "graphite_team custom project role with terraform"
  type        = "AX"
  policy      = <<POLICY
{
  "Version": "1.1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "obs:*:*"
      ],
      "Resource": [
        "obs:*:*:bucket:janusreports-${var.env}",
        "obs:*:*:object:janusreports-${var.env}/*"
      ]
    },
[...]
    {
      "Effect": "Allow",
      "Action": [
        "obs:bucket:ListAllMyBuckets"
      ]
    }
  ]
}
POLICY
}

Expected Behavior

create the role with more than 9 policies

Actual Behavior

Error: Error updating FlexibleEngine Role: Bad request with: [PATCH https://iam.eu-west-0.prod-cloud-ocb.orange-business.com/v3.0/OS-ROLE/roles/31065004d58d4abea9d9525376bb27d4], error message: {"error":{"message":"Role policy format invalid! Statement size [9] invalid, must greater than [0] and less than or equal to [8] !","code":400,"title":"Bad Request"}}

Steps to Reproduce

create a flexibleengine_identity_role_v3 role with more than 9 policies

ShiChangkuo commented 3 years ago

@screwyy the maximum of policy statements is limited by the cloud side, please refer to the API document.