Skip to content
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

fix: update scc_profile_attachment parameters #5551

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

tyao117
Copy link
Contributor

@tyao117 tyao117 commented Aug 6, 2024

  • verify that a diff change seen
  • verify that that a PUT is made from the diff change

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #5535
Depends on #5509

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

- verify that a PUT is being used
@tyao117
Copy link
Contributor Author

tyao117 commented Aug 6, 2024

evidence of the PUT request:

2024/08/06 12:26:13 [Debug] Request:
PUT /instances/b934a69c-5020-44c9-baa0-XXXXXXXXXXXX/v3/profiles/48279384-3d29-4089-8259-XXXXXXXXXXXX/attachments/63b76851-cc1a-4285-XXXXXXXXXXXX HTTP/1.1
Host: us-east.compliance.test.cloud.ibm.com
User-Agent: scc-go-sdk/5.1.6 (lang=go; arch=arm64; os=darwin; go.version=go1.22.5)
Content-Length: 1706
Accept: application/json
Authorization: [redacted]
Content-Type: application/json
X-Original-User-Agent: terraform-provider-ibm/1.68.0
Accept-Encoding: gzip

{
   "attachment_parameters":[
      {
         "assessment_type":"automated",
         "assessment_id":"rule-9653d2c7-6290-4128-a5a3-65487ba40370",
         "parameter_name":"rdp_port",
         "parameter_value":"1234",
         "parameter_display_name":"Security group rule RDP allow port number",
         "parameter_type":"numeric"
      },
      {
         "assessment_type":"automated",
         "assessment_id":"rule-e16fcfea-fe21-4d30-a721-423611481fea",
         "parameter_name":"tls_version",
         "parameter_value":"['1.2', '1.3']",
         "parameter_display_name":"IBM Cloud Internet Services TLS version",
         "parameter_type":"string_list"
      },
      {
         "assessment_type":"automated",
         "assessment_id":"rule-f1e80ee7-88d5-4bf2-b42f-c863bb24601c",
         "parameter_name":"rdp_port",
         "parameter_value":"4000",
         "parameter_display_name":"Disallowed IPs for ingress to RDP port",
         "parameter_type":"numeric"
      },
      {
         "assessment_type":"automated",
         "assessment_id":"rule-f9137be8-2490-4afb-8cd5-a201cb167eb2",
         "parameter_name":"ssh_port",
         "parameter_value":"8080",
         "parameter_display_name":"Network ACL rule for allowed IPs to SSH port",
         "parameter_type":"numeric"
      },
      {
         "assessment_type":"automated",
         "assessment_id":"rule-7c5f6385-67e4-4edf-bec8-c722558b2dec",
         "parameter_name":"ssh_port",
         "parameter_value":"23",
         "parameter_display_name":"Security group rule SSH allow port number",
         "parameter_type":"numeric"
      }
   ],
   "description":"scc_profile_attachment_description",
   "instance_id":"b934a69c-5020-44c9-baa0-c3e4fcfe349e",
   "name":"profile_attachment_name",
   "notifications":{
      "enabled":false,
      "controls":{
         "threshold_limit":14
      }
   },
   "profile_id":"48279384-3d29-4089-8259-8ed354774b4a",
   "schedule":"every_30_days",
   "scope":[
      {
         "environment":"ibm-cloud",
         "properties":[
            {
               "name":"scope_id",
               "value":"62ecf99b240144dea9125666249edfcb"
            },
            {
               "name":"scope_type",
               "value":"account"
            }
         ]
      }
   ],
   "status":"disabled"
}

return schema.HashString(id)
}

func stringHashcode(s string) int {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have this common function already in
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" please reuse it instead of duplicate

@tyao117 tyao117 marked this pull request as ready for review August 30, 2024 14:27
@hkantare hkantare merged commit eede48c into IBM-Cloud:master Aug 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ibm_scc_profile_attachment does not update attachment parameters
2 participants