Closed dacamposol closed 2 weeks ago
Okay, further research shows that the problem is that some services (as in this case aicore
) have what is called a non-numeric quota; and the quota of the service is shared across the whole Global Account without being able to establish anything at subaccount level:
A fixed quota for this plan is provided to your global account; however, this amount is available to every subaccount or managed directory to which you assign the plan. There is no manual distribution of this quota.
To make this plan available for use in a subaccount, you must assign this plan to the subaccount, without specifying an actual amount (also known as "non-numeric assignment").
Maybe could we do something so there isn't such a weird error on the Terraform side?
@dacamposol how did you create the entitlement for the AI Core service? If it is an ELASTIC_SERVICE
which has no quota and must be assigned differently than the services with a quota, which the provider steer via getting a quota or not.
If the entitlement was done via Terraform with a quota, the AICORE service is implementing the service broker in a wrong way as this should result in an error if a quota is supplied 😕
Long story short: the situation you are running into could/should not happen, the error would be happening in the initial assignment of the entitlement already.
@dacamposol how did you create the entitlement for the AI Core service? If it is an
ELASTIC_SERVICE
which has no quota and must be assigned differently than the services with a quota, which the provider steer via getting a quota or not. If the entitlement was done via Terraform with a quota, the AICORE service is implementing the service broker in a wrong way as this should result in an error if a quota is supplied 😕Long story short: the situation you are running into could/should not happen, the error would be happening in the initial assignment of the entitlement already.
I indeed imported my already existing infrastructure to Terraform, so that's why I didn't received that error beforehand. In order to import my resources, I used the same data that was provided by the BTP CLI.
When I imported this resource to my state, I had the block defined with a quota of 2, which was the original result from querying the CLI. It didn't complain and it never failed to apply the IaC up until I tried to scale it down. Probably since this value never changed, I didn't realise the incompatibility.
I analyzed the setup:
To resolve the situation, please execute a re-import via the following steps:
terraform state rm <address of the resource>
quota
attributeimport {
to = <address of the resource>
id = "<ID of your subaccount>,aicore,sap-internal"
}
terraform plan
/terraform apply
Is there an existing issue for this?
What version of the Terraform provider are you using?
1.8.0
What version of the Terraform CLI are you using?
1.9.8
What type of issue are you facing
bug report
Describe the bug
Received the following error when trying to scale down a service entitlement in a given subaccount:
Expected Behavior
Being able to scale down the quota of a service entitlement, if I consider that is not needed.
Steps To Reproduce
User's Role Collections
Add screenshots to help explain your problem
No response
Additional context
No response