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: add depends for cos #74

Merged
merged 7 commits into from
Apr 15, 2024
Merged

fix: add depends for cos #74

merged 7 commits into from
Apr 15, 2024

Conversation

jor2
Copy link
Member

@jor2 jor2 commented Apr 14, 2024

Description

Fixing this error:

        	Error Trace:	/go/pkg/mod/github.com/terraform-ibm-modules/[email protected]/testhelper/tests.go:827
        	            				/go/pkg/mod/github.com/terraform-ibm-modules/[email protected]/testhelper/tests.go:760
        	            				/__w/terraform-ibm-scc-da/terraform-ibm-scc-da/tests/pr_test.go:175
        	Error:      	Expected nil, but got: retry.FatalError{Underlying:(*shell.ErrWithCmdOutput)(0xc000bae5e8)}
        	Test:       	TestRunExistingResourcesInstances
        	Messages:   	Failed%!(EXTRA retry.FatalError=FatalError{Underlying: error while running command: exit status 1; ╷
        	            	│ Error: UpdateSettingsWithContext failed A service-to-service authorization policy is missing between Cloud Object Storage and Security and Compliance Center.

terraform-ibm-modules/terraform-ibm-scc-da#23

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (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:

/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.

@jor2 jor2 self-assigned this Apr 14, 2024
@jor2
Copy link
Member Author

jor2 commented Apr 14, 2024

/run pipeline

@jor2
Copy link
Member Author

jor2 commented Apr 14, 2024

/run pipeline

@jor2 jor2 requested a review from ocofaigh April 15, 2024 00:07
Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

@jor2 can you update the main.tf so the resource blocks are in the order of the actual dependency tree? It makes it alot easier to follow and review

@jor2
Copy link
Member Author

jor2 commented Apr 15, 2024

/run pipeline

@jor2 jor2 requested a review from ocofaigh April 15, 2024 09:51
Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

see latest comments

@@ -71,6 +71,25 @@ resource "ibm_iam_authorization_policy" "scc_wp_s2s_access" {
data "ibm_iam_account_settings" "iam_account_settings" {
}

resource "ibm_scc_instance_settings" "scc_instance_settings" {
Copy link
Member

Choose a reason for hiding this comment

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

can you leave a code comment above this resource block to explain what its doing (aka attaching a COS bucket and an event notifications instance)

main.tf Outdated
@@ -28,7 +28,7 @@ locals {
}

resource "ibm_scc_provider_type_instance" "scc_provider_type_instance_instance" {
Copy link
Member

Choose a reason for hiding this comment

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

can you leave a code comment above this resource block to explain what its doing (aka attaching an SCC Workload Protection instance)

main.tf Outdated
@@ -28,7 +28,7 @@ locals {
}

resource "ibm_scc_provider_type_instance" "scc_provider_type_instance_instance" {
depends_on = [time_sleep.wait_for_authorization_policy]
depends_on = [time_sleep.wait_for_scc_wp_authorization_policy]
Copy link
Member

Choose a reason for hiding this comment

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

if this depends on the time_sleep which depends on the auth policy then I expect to see those resource blocks above this one in the code. Like I said try to keep the dependency flow the same in the code as the dependncy tree order itself.

Copy link
Member

Choose a reason for hiding this comment

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

This should actually also depend_on ibm_scc_instance_settings.scc_instance_settings because the COS integration must be done before you can use the SCC instance (which means the ibm_scc_instance_settings resource block should also be above this in the code)

@jor2
Copy link
Member Author

jor2 commented Apr 15, 2024

/run pipeline

@jor2 jor2 requested a review from ocofaigh April 15, 2024 11:15
@ocofaigh ocofaigh merged commit e88bee7 into main Apr 15, 2024
2 checks passed
@ocofaigh ocofaigh deleted the fix-depends branch April 15, 2024 13:34
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 1.4.1 🎉

The release is available on GitHub release

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.

3 participants