Skip to content

Commit

Permalink
feat: adding the fields region and instance_id in the service scc (#4823
Browse files Browse the repository at this point in the history
)

* adding the utility file for generic use

* adding the usage of instanceID to control library, profile, profile attachment, rule

* updated all testing

* Adding the ability to change the URL from provider field, and updated resource docs

* updated the docs with the usage of instance_id

* added instance_id to the examples

* Using the new version of scc-go-sdk

* Formatting the docs and added the warn in acctest

Signed-off-by: Timothy-Yao <timothy.yao@ibm.com>

* modifying the PreCheck for Tests

* adding the additional line for accPreCheck

* Took out os from the testing packages.

* Upgrading scc-go-sdk to 5.1.2 and updated functions

---------

Signed-off-by: Timothy-Yao <timothy.yao@ibm.com>
Co-authored-by: Timothy-Yao <timothy.yao@ibm.com>
  • Loading branch information
tyao117 and tyao117 authored Sep 28, 2023
1 parent ddaf693 commit 52e3872
Show file tree
Hide file tree
Showing 74 changed files with 1,012 additions and 607 deletions.
1 change: 1 addition & 0 deletions examples/ibm-scc/control_library/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "ibm_scc_control_library" "scc_demo_control_library" {
instance_id = "00000000-1111-2222-3333-444444444444"
control_library_name = var.scc_control_library_name
control_library_description = var.scc_control_library_description
control_library_type = "custom"
Expand Down
1 change: 1 addition & 0 deletions examples/ibm-scc/integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "ibm_scc_provider_type_instance" "scc_provider_type_instance_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
provider_type_id = var.scc_provider_type_id
name = var.scc_provider_type_instance_instance
attributes = var.scc_provider_type_instance_attributes
Expand Down
2 changes: 2 additions & 0 deletions examples/ibm-scc/profile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ data "ibm_scc_control_library" "scc_control_library" {
}

resource "ibm_scc_profile" "scc_demo_profile" {
instance_id = "00000000-1111-2222-3333-444444444444"
profile_type = "custom"
profile_description = var.ibm_scc_profile_description
profile_name = var.ibm_scc_profile_name
Expand All @@ -15,6 +16,7 @@ resource "ibm_scc_profile" "scc_demo_profile" {
}

resource "ibm_scc_profile_attachment" "scc_demo_profile_attachment" {
instance_id = "00000000-1111-2222-3333-444444444444"
profile_id = resource.ibm_scc_profile.scc_demo_profile.id
name = var.ibm_scc_profile_attachment_name
description = var.ibm_scc_profile_attachment_description
Expand Down
8 changes: 8 additions & 0 deletions examples/ibm-scc/report/main.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
data "ibm_scc_latest_reports" "scc_latest_reports_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
sort = "profile_name"
}

data "ibm_scc_report_rule" "scc_report_rule_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
rule_id = var.scc_rule_id
}

data "ibm_scc_report_tags" "scc_report_tags_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}

data "ibm_scc_report_evaluations" "scc_report_evaluations_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}

data "ibm_scc_report_controls" "scc_report_controls_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}

data "ibm_scc_report_summary" "scc_report_summary_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}

data "ibm_scc_report_violation_drift" "scc_report_violation_drift_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}

data "ibm_scc_report" "scc_report_instance" {
instance_id = "00000000-1111-2222-3333-444444444444"
report_id = var.scc_report_id
}
1 change: 1 addition & 0 deletions examples/ibm-scc/rule/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Provision scc_rule resource instance
resource "ibm_scc_rule" "scc_rule_tf_demo" {
instance_id = "00000000-1111-2222-3333-444444444444"
description = var.scc_description
target {
service_name = "cloud-object-storage"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/IBM/platform-services-go-sdk v0.48.1
github.com/IBM/project-go-sdk v0.0.10
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/scc-go-sdk/v5 v5.0.2
github.com/IBM/scc-go-sdk/v5 v5.1.2
github.com/IBM/schematics-go-sdk v0.2.1
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.0
github.com/IBM/vpc-beta-go-sdk v0.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ github.com/IBM/project-go-sdk v0.0.10 h1:vHSuemwZ4S4c6BEb22tzsEcPTs/5LnZ0yKpP3GG
github.com/IBM/project-go-sdk v0.0.10/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0=
github.com/IBM/scc-go-sdk/v5 v5.0.2 h1:OUqkzLfJqozp2aqylNurwaJd1SmY8o7KturFse6R2xM=
github.com/IBM/scc-go-sdk/v5 v5.0.2/go.mod h1:YtAVlzq10bwR82QX4ZavhDIwa1s85RuVO9N/KmXVcuk=
github.com/IBM/scc-go-sdk/v5 v5.1.2 h1:9axGtNlP3bHhoE9yJgCuc+g5/VdyhYqfhZ5oS3ovCFI=
github.com/IBM/scc-go-sdk/v5 v5.1.2/go.mod h1:YtAVlzq10bwR82QX4ZavhDIwa1s85RuVO9N/KmXVcuk=
github.com/IBM/schematics-go-sdk v0.2.1 h1:byATysGD+Z1k/wdtNqQmKALcAPjgSLuSyzcabh1jRAw=
github.com/IBM/schematics-go-sdk v0.2.1/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ=
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.0 h1:Lx4Bvim/MfoHEYR+n312bty5DirAJypBGGS9YZo3zCw=
Expand Down
Loading

0 comments on commit 52e3872

Please sign in to comment.