Closed maheshwarishikha closed 4 days ago
@maheshwarishikha, Looks like the authorisation policy is not set right. It is not been used.. Can you use guid instead of id for target_instance_id? target_resource_instance_id = ibm_resource_instance.cos_instance.id ==> target_resource_instance_id = ibm_resource_instance.cos_instance.guid something like below?
resource "ibm_iam_authorization_policy" "cos_policy" {
source_service_name = "logs"
source_resource_group_id = data.ibm_resource_group.cos_group.id
roles = ["Writer"]
description = "Allow Cloud logs instances `Writer` access to the COS bucket."
target_service_name = "cloud-object-storage"
target_resource_instance_id = ibm_resource_instance.cos_instance.guid
}
Thanks for the response @kavya498
Actually that was typo when I created a test code, changing it to guid worked for me. But we have auth policy in GoldenEye code scoped to the bucket like this https://github.com/terraform-ibm-modules/terraform-ibm-observability-instances/blob/main/modules/cloud_logs/main.tf#L44 that was working all fine few days back and now giving error. Checking more on this...
@kavya498 , If we changed our auth policy like as below....i.e. scoped to the cos bucket
resource "ibm_iam_authorization_policy" "cos_policy" {
source_service_name = "logs"
source_resource_group_id = data.ibm_resource_group.cos_group.id
roles = ["Writer"]
description = "Allow Cloud logs instances `Writer` access to the COS bucket."
# target_service_name = "cloud-object-storage"
# target_resource_instance_id = ibm_resource_instance.cos_instance.guid
resource_attributes {
name = "serviceName"
operator = "stringEquals"
value = "cloud-object-storage"
}
resource_attributes {
name = "accountId"
operator = "stringEquals"
value = "xxx"
}
resource_attributes {
name = "serviceInstance"
operator = "stringEquals"
value = ibm_resource_instance.cos_instance.guid
}
resource_attributes {
name = "resourceType"
operator = "stringEquals"
value = "bucket"
}
resource_attributes {
name = "resource"
operator = "stringEquals"
value = "debug-icl-bucket"
}
}
ICL provisioning fails. It was working all fine few days back. Can you please help to find out whats missing in auth policy?? Or it is happening because of any change in provider code.
Nopes, recreated everything and it worked this time. Checking in GoldenEye Module now... .
@kavya498 It would be nice if the service could respond with a nicer error message if you know that its an issue related to auth policy. Is that something you plan on improving?
Issue identified is with the metrics bucket attachment. Cloud logs team is working on this currently - internal issue to track is https://github.ibm.com/Observability/logs-support/issues/223
Regarding the proper error message, it is being tracked by https://github.com/IBM-Cloud/terraform-provider-ibm/issues/5729
Regarding the fix related to metrics bucket attachment, we will receive an update via the support ticket. Hence closing this issue.
Provisioning of ICL fails if COS bucket details are provided in parameters, though all required auth policies are in-place.
Community Note
Terraform CLI and Terraform IBM Provider Version
tf 1.9.2 provider 1.70.0 / 1.71.1
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
It should create Cloud logs instance successfully.
Actual Behavior
Provisioning fails.
Steps to Reproduce
terraform apply
Important Factoids
References
0000