-
Notifications
You must be signed in to change notification settings - Fork 674
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
SCC: adding datasources for automated WP connection and Profile attachments #5179
Conversation
could we get controls in the schema too pls, like here
|
needing to push documentation out for the new datasources |
need to add datasource_ibm_control_libraries |
datasource documentation added. |
@@ -876,6 +887,17 @@ func resourceIbmSccControlLibraryControlsInControlLibToMap(model *securityandcom | |||
return modelMap, nil | |||
} | |||
|
|||
// using the assessment_id for comparison | |||
func compareAssessmentSetFunc(v interface{}) int { | |||
m := v.(map[string]interface{}) |
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.
Can you add some checks to check len of map and element of map not nil to eliminate any nil pointer exceptions
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.
In schema assessment_id is defined as optional if user define
assessments = {
assessment_method = "XXXXX"
}
@@ -321,6 +324,16 @@ func resourceIbmSccProfileAttachmentCreate(context context.Context, d *schema.Re | |||
return resourceIbmSccProfileAttachmentRead(context, d, meta) | |||
} | |||
|
|||
func cmpAttachParamSetFunc(v interface{}) int { |
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.
same above commands holds here also
assId := (*id)[5:18] | ||
var i big.Int | ||
i.SetString(strings.Replace(assId, "-", "", 4), 16) | ||
val, _ := strconv.Atoi(i.String()) |
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.
don't supress errors log/throw back the error
i have implemented the checks that you have asked for. |
…hments (IBM-Cloud#5179) * init: pushing out the scc_profiles_datasource * feat: adding the data_source provider_types * fix: using TypeSet for unique assessments * bug: working on resource_ibm_scc_profile_test * Changing various resources to typeSet. * adding the datasource * adding the datasource control libraries and profiles * Updating some documentation * adding the updates to documentation and fmt'ing * Adding the err checks for interface conversion * making both fields to be required if instantiated * fixing the formatting of the test --------- Co-authored-by: Timothy-Yao <[email protected]>
Updates:
ibm_scc_control_libraries
that returns a list of control_libraries available to an instance.ibm_scc_profiles
that returns a list of profiles available to an instanceibm_scc_provider_types
that returns a list of provider available to an instanceCommunity Note
Closes #5186
Closes #5185
Closes #5208
Output from acceptance testing: