Skip to content

Conversation

@arya-girish-k
Copy link
Contributor

@arya-girish-k arya-girish-k commented Jan 24, 2025

Description

Refactored the code logic for prefix variable by adding default value for prefix and marked as required in catalog manifest.Also allowed prefix to be "" (empty string) for advanced users.
#11959

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Add the default value for prefix variable and mark as required in catalog manifest. Also allowed prefix to be "" (empty string ).

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

@iamar7
Copy link
Member

iamar7 commented Jan 24, 2025

Re-running since the failure is not related to the changes made in this PR

TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ id: terraform-c24f9c05
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ summary: |
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   CreateSecretWithContext failed: You do not have the required permissions for this operation. Contact the account owner to verify your access. [secrets-manager.13022E]
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   {
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       "StatusCode": 403,
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       "Headers": {
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Cache-Control": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "no-store, no-cache, must-revalidate, proxy-revalidate,no-cache, max-age=0, no-store"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Cf-Cache-Status": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "DYNAMIC"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Cf-Ray": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "9070c6b2aec8eb07-ORD"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Content-Security-Policy": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "default-src 'none'"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Content-Type": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "application/json; charset=utf-8"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Correlation-Id": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "06c313c1-559e-1b6f-2911-24958d5ce46e"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Cross-Origin-Resource-Policy": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "same-origin"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Date": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "Fri, 24 Jan 2025 14:40:02 GMT"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Expires": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "0"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Pragma": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "no-cache"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Server": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "cloudflare"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Strict-Transport-Security": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "max-age=31536000; includeSubDomains; preload"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Surrogate-Control": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "no-store"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "Vary": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "Accept-Encoding"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "X-Content-Type-Options": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               "nosniff"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ]
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       },
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       "Result": {
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "errors": [
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               {
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │                   "code": "access_forbidden",
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │                   "message": "You do not have the required permissions for this operation. Contact the account owner to verify your access. [secrets-manager.[1302](https://github.com/terraform-ibm-modules/terraform-ibm-secrets-manager/actions/runs/12948536497/job/36126953637#step:7:1303)2E]",
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │                   "more_info": "https://cloud.ibm.com/apidocs/secrets-manager"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │               }
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           ],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "status_code": 403,
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │           "trace": "06c313c1-559e-1b6f-2911-24958d5ce46e"
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       },
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │       "RawResult": null
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   }
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ severity: error
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ resource: ibm_sm_service_credentials_secret
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ operation: create
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ component:
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   name: github.com/IBM-Cloud/terraform-provider-ibm
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   version: 1.74.0
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ ---
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ 
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ 
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   with module.secrets_manager.module.secrets.module.secrets["secrets-mgr-upg-bbatrs-service-credential"].ibm_sm_service_credentials_secret.service_credentials_secret[0],
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │   on .terraform/modules/secrets_manager.secrets.secrets/main.tf line 114, in resource "ibm_sm_service_credentials_secret" "service_credentials_secret":
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │  114: resource "ibm_sm_service_credentials_secret" "service_credentials_secret" {
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: │ 
TestRunUpgradeExample 2025-01-24T14:40:02Z logger.go:67: ╵
TestRunUpgradeExample 2025-01-24T14:40:02Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: ---

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

Complete example is failing in main branch .Created one issue regarding the same #276

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

Plan output for reference:
If providing prefix value as “dev”:


iam_engine_name      = "dev-base-sm-iam-engine”

kms_key_name         = "dev-sm-cos-key"
kms_key_ring_name    = "dev-sm-cos-key-ring"
resource_group_name  = "dev-arya-rg"
secrets_manager_name = "dev-base-security-services-sm"


If providing prefix as null or empty string:


iam_engine_name      = "base-sm-iam-engine”

kms_key_name         = "sm-cos-key"
kms_key_ring_name    = "sm-cos-key-ring"
resource_group_name  = "arya-rg"
secrets_manager_name = "base-security-services-sm"

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@maheshwarishikha maheshwarishikha merged commit 77597be into main Feb 3, 2025
2 checks passed
@maheshwarishikha maheshwarishikha deleted the 11959-prefix-sm branch February 3, 2025 08:01
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 1.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants