-
Notifications
You must be signed in to change notification settings - Fork 2
Add feature to check the account type #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
| # Account Check | ||
|
|
||
| This module determines whether a given IBM Cloud account is part of an `Enterprise` or is a `Standalone (Normal)` account. | ||
| It uses the IBM Cloud Enterprise Management API and can be easily integrated into Terraform configurations via the external data source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the usage and required permissions here
| required_providers { | ||
| external = { | ||
| source = "hashicorp/external" | ||
| version = "2.3.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules should use a range. EG: >=2.3.5, <3.0.0
|
|
||
| # --- Output for Terraform --- | ||
| echo "{\"account_type\": \"${ACCOUNT_TYPE}\"}" | ||
| exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script needs to be updated so the endpoints can be overridden by environment variables, incase someone is using the to deploy to stage for example. See example
| source = "./modules/account_check" | ||
| target_account_id = local.target_account_id | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output of this has to be used in the restapi_object block as a new parameter. This should also have a count around it as its only needed if CSPM is enabled
| # Input Variables | ||
| ############################################################################## | ||
|
|
||
| variable "ibmcloud_api_key" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of added a new required input here, maybe it would be better to get the IAM token using a data lookup in the new submodule and pass the token value directly to the script?
Description
Release required?
x.x.X)x.X.x)X.x.x)Release notes content
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:
Checklist for reviewers
For mergers