terraform-ibm-modules / terraform-ibm-cloudability-onboarding

A deployable architecture which will fully onboard a standard or enterprise IBM Cloud account to IBM Cloudability.
Apache License 2.0
0 stars 0 forks source link

Failing tests due to conflict with existing policy granted from a previous run #19

Closed chrisw-ibm closed 1 month ago

chrisw-ibm commented 1 month ago

Affected modules

*modules/cloudability-enterprise-access

Terraform CLI and Terraform provider versions

Terraform output

2024-10-06T19:16:44.8410630Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   on modules/cloudability-enterprise-access/main.tf line 37, in resource "ibm_iam_service_policy" "billing_policy":
2024-10-06T19:16:44.8413236Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   37: resource "ibm_iam_service_policy" "billing_policy" {
2024-10-06T19:16:44.8415080Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ 
2024-10-06T19:16:44.8416290Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ ---
2024-10-06T19:16:44.8417705Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ id: terraform-18b2e257
2024-10-06T19:16:44.8419380Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ summary: |
2024-10-06T19:16:44.8423475Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   [ERROR] Error creating servicePolicy: The policy wasn't created because an access policy with identical attributes already exists. Please update the roles in the existing policy (beb6f099-27d6-46d9-852a-eaaca5669554), or update the one you're trying to assign to include a different attribute assignment. {
2024-10-06T19:16:44.8427456Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       "StatusCode": 409,
2024-10-06T19:16:44.8428973Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       "Headers": {
2024-10-06T19:16:44.8430517Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Akamai-Grn": [
2024-10-06T19:16:44.8432225Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "0.c50e2017.1728242115.5145a9b6"
2024-10-06T19:16:44.8433966Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8435567Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Cache-Control": [
2024-10-06T19:16:44.8437225Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "no-cache,no-store"
2024-10-06T19:16:44.8438724Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8440264Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Content-Length": [
2024-10-06T19:16:44.8441823Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "1268"
2024-10-06T19:16:44.8443238Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8444894Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Content-Type": [
2024-10-06T19:16:44.8446647Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "application/json; charset=utf-8"
2024-10-06T19:16:44.8448210Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8449635Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Date": [
2024-10-06T19:16:44.8451286Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "Sun, 06 Oct 2024 19:15:17 GMT"
2024-10-06T19:16:44.8452853Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8454442Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Expires": [
2024-10-06T19:16:44.8456168Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "Thursday, 1 January 1970 00:00:00 GMT"
2024-10-06T19:16:44.8457750Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8459189Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Pragma": [
2024-10-06T19:16:44.8460732Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "no-cache"
2024-10-06T19:16:44.8462176Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8464083Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Response-Time": [
2024-10-06T19:16:44.8465281Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "378.608ms"
2024-10-06T19:16:44.8466202Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8467205Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Strict-Transport-Security": [
2024-10-06T19:16:44.8468346Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "max-age=31536000; includeSubDomains"
2024-10-06T19:16:44.8469602Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8470561Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "Transaction-Id": [
2024-10-06T19:16:44.8471668Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "cb75aa9c98ec4ce6a62b1f61e1262ccb"
2024-10-06T19:16:44.8472813Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8474045Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "X-Proxy-Upstream-Service-Time": [
2024-10-06T19:16:44.8475138Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "1884"
2024-10-06T19:16:44.8476016Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8477132Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "X-Response-Time": [
2024-10-06T19:16:44.8478447Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               "380.519ms"
2024-10-06T19:16:44.8479361Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ]
2024-10-06T19:16:44.8480183Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       },
2024-10-06T19:16:44.8481036Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       "Result": {
2024-10-06T19:16:44.8481967Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "errors": [
2024-10-06T19:16:44.8482867Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               {
2024-10-06T19:16:44.8484035Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                   "code": "policy_conflict_error",
2024-10-06T19:16:44.8485005Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                   "details": {
2024-10-06T19:16:44.8485968Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                       "conflicts_with": {
2024-10-06T19:16:44.8487034Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                           "etag": "1-09487a6612d3e9ce63a1cac5ca78c8e9",
2024-10-06T19:16:44.8488053Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                           "policy": {
2024-10-06T19:16:44.8489093Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "created_at": "2024-10-05T02:41:54.802Z",
2024-10-06T19:16:44.8490170Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "created_by_id": "IBMid-666000KAO3",
2024-10-06T19:16:44.8491459Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "href": "https://iam.cloud.ibm.com/v1/policies/beb6f099-27d6-46d9-852a-eaaca5669554",
2024-10-06T19:16:44.8492737Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "id": "beb6f099-27d6-46d9-852a-eaaca5669554",
2024-10-06T19:16:44.8493949Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "last_modified_at": "2024-10-05T02:41:54.802Z",
2024-10-06T19:16:44.8495056Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "last_modified_by_id": "IBMid-666000KAO3",
2024-10-06T19:16:44.8496130Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "resources": [
2024-10-06T19:16:44.8497096Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   {
2024-10-06T19:16:44.8498085Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       "attributes": [
2024-10-06T19:16:44.8499351Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           {
2024-10-06T19:16:44.8500417Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "name": "serviceName",
2024-10-06T19:16:44.8501498Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "operator": "stringEquals",
2024-10-06T19:16:44.8502737Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "value": "billing"
2024-10-06T19:16:44.8503977Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           },
2024-10-06T19:16:44.8504958Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           {
2024-10-06T19:16:44.8505984Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "name": "accountId",
2024-10-06T19:16:44.8507082Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "operator": "stringEquals",
2024-10-06T19:16:44.8508215Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "value": "abac0df06b644a9cabc6e44f55b3880e"
2024-10-06T19:16:44.8509277Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           }
2024-10-06T19:16:44.8510244Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       ]
2024-10-06T19:16:44.8511190Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   }
2024-10-06T19:16:44.8512116Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               ],
2024-10-06T19:16:44.8513089Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "roles": [
2024-10-06T19:16:44.8514154Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   {
2024-10-06T19:16:44.8515370Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       "description": "As a viewer, you can view service instances, but you can't modify them.",
2024-10-06T19:16:44.8516613Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       "display_name": "Viewer",
2024-10-06T19:16:44.8517849Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       "role_id": "crn:v1:bluemix:public:iam::::role:Viewer"
2024-10-06T19:16:44.8518924Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   }
2024-10-06T19:16:44.8519859Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               ],
2024-10-06T19:16:44.8520843Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "state": "active",
2024-10-06T19:16:44.8521847Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "subjects": [
2024-10-06T19:16:44.8522806Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   {
2024-10-06T19:16:44.8523992Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       "attributes": [
2024-10-06T19:16:44.8525009Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           {
2024-10-06T19:16:44.8526032Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "name": "iam_id",
2024-10-06T19:16:44.8527394Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                               "value": "iam-ServiceId-6bf7af4e-6f07-4894-ab72-ff539dfb951a"
2024-10-06T19:16:44.8528512Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                           }
2024-10-06T19:16:44.8529658Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                       ]
2024-10-06T19:16:44.8530773Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                                   }
2024-10-06T19:16:44.8531704Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               ],
2024-10-06T19:16:44.8532683Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                               "type": "access"
2024-10-06T19:16:44.8533747Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                           }
2024-10-06T19:16:44.8534636Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                       }
2024-10-06T19:16:44.8535492Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                   },
2024-10-06T19:16:44.8537590Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │                   "message": "The policy wasn't created because an access policy with identical attributes already exists. Please update the roles in the existing policy (beb6f099-27d6-46d9-852a-eaaca5669554), or update the one you're trying to assign to include a different attribute assignment."
2024-10-06T19:16:44.8539485Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │               }
2024-10-06T19:16:44.8540273Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           ],
2024-10-06T19:16:44.8541133Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "status_code": 409,
2024-10-06T19:16:44.8542160Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │           "trace": "cb75aa9c98ec4ce6a62b1f61e1262ccb"
2024-10-06T19:16:44.8543066Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       },
2024-10-06T19:16:44.8543981Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │       "RawResult": null
2024-10-06T19:16:44.8544764Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   }
2024-10-06T19:16:44.8545534Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ severity: error
2024-10-06T19:16:44.8546424Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ resource: ibm_iam_service_policy
2024-10-06T19:16:44.8547307Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ operation: create
2024-10-06T19:16:44.8548111Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │ component:
2024-10-06T19:16:44.8549073Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   name: github.com/IBM-Cloud/terraform-provider-ibm
2024-10-06T19:16:44.8550032Z TestRunDefaultSolution 2024-10-06T19:16:44Z logger.go:66: │   version: 1.70.0

Debug output

Expected behavior

the test should pass

Actual behavior

the test is failing

Steps to reproduce (including links and screen captures)

make run-tests-local

Anything else


By submitting this issue, you agree to follow our Code of Conduct

terraform-ibm-modules-ops commented 1 month ago

:tada: This issue has been resolved in version 1.0.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: