Skip to content

Conversation

@niharika-98
Copy link
Contributor

@niharika-98 niharika-98 commented Nov 11, 2024

Description

Fixes # b/378428041
Documention for backupdr resources:
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/backup_dr_backup_plan
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/backup_dr_backup_plan_association
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/backup_dr_backup_vault

Note: If you are not associated with Google, open an issue for discussion before submitting a pull request.

Checklist

Readiness

  • Yes, merge this PR after it is approved
  • No, don't merge this PR after it is approved

Style

Testing

Intended location

  • Yes, this sample will be (or already is) included on cloud.google.com
    Location(s):

  • No, this sample won't be included on cloud.google.com
    Reason:

API enablement

  • If the sample needs an API enabled to pass testing, I have added the service to the Test setup file

Review

  • If this sample adds a new directory, I have added codeowners to the CODEOWNERS file

@niharika-98 niharika-98 requested review from a team as code owners November 11, 2024 11:18
@snippet-bot
Copy link

snippet-bot bot commented Nov 11, 2024

Here is the summary of changes.

You are about to add 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@niharika-98 niharika-98 requested review from a team as code owners November 11, 2024 11:21
@niharika-98 niharika-98 changed the title Adding BV,BP,BPA resources to terraform samples feat(terraform): add BV, BP, BPA resources to sample configurations Nov 11, 2024
@niharika-98
Copy link
Contributor Author

@bharathkkb @averbuks @tpdownes Can any of you please review this PR.

@tpdownes
Copy link

I do not have any involvement in this particular repository.

@bharathkkb
Copy link
Member

/gcbrun

@apeabody
Copy link
Contributor

/gcbrun

@apeabody
Copy link
Contributor

apeabody commented Nov 13, 2024

Thanks for the contribution @niharika-98!

I triggered the lint and CI tests. For the lint, in addition to the nits I already identified, you probably need to run terraform fmt on the relevant files. Please also add the intended sample location to the PR description.

@msampathkumar
Copy link
Contributor

/gcbrun

@niharika-98
Copy link
Contributor Author

/gcbrun

@glasnt glasnt enabled auto-merge (squash) November 21, 2024 00:27
@glasnt glasnt disabled auto-merge November 21, 2024 00:41
@glasnt
Copy link
Contributor

glasnt commented Nov 21, 2024

All tests specifically added to this PR work, but due to adding content to /tests/, all tests are being run. Checking earlier CI runs, the new samples do work, so I will merge this PR, since all other tests have failed due to unrelated samples.

@glasnt glasnt merged commit c57afd8 into terraform-google-modules:main Nov 21, 2024
4 of 5 checks passed
@apeabody
Copy link
Contributor

All tests specifically added to this PR work, but due to adding content to /tests/, all tests are being run. Checking earlier CI runs, the new samples do work, so I will merge this PR, since all other tests have failed due to unrelated samples.

@glasnt I think the error is from one of the new samples?

Error: "account_id" ("my-sa") must be between 6 and 30 characters long

  with google_service_account.default,
  on main.tf line 19, in resource "google_service_account" "default":
  19:   account_id   = "my-sa"
}
    validate.go:11: 
        	Error Trace:	/builder/home/go/pkg/mod/github.com/gruntwork-io/[email protected]/modules/terraform/validate.go:11
        	            				/builder/home/go/pkg/mod/github.com/!google!cloud!platform/cloud-foundation-toolkit/infra/[email protected]/pkg/tft/terraform.go:545
        	            				/builder/home/go/pkg/mod/github.com/!google!cloud!platform/cloud-foundation-toolkit/infra/[email protected]/pkg/tft/terraform.go:585
        	            				/builder/home/go/pkg/mod/github.com/!google!cloud!platform/cloud-foundation-toolkit/infra/[email protected]/pkg/tft/terraform.go:666
        	            				/builder/home/go/pkg/mod/github.com/!google!cloud!platform/cloud-foundation-toolkit/infra/[email protected]/pkg/utils/stages.go:31
        	            				/builder/home/go/pkg/mod/github.com/!google!cloud!platform/cloud-foundation-toolkit/infra/[email protected]/pkg/tft/terraform.go:666
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; 
        	            	Error: "account_id" ("my-sa") must be between 6 and 30 characters long
        	            	
        	            	  with google_service_account.default,
        	            	  on main.tf line 19, in resource "google_service_account" "default":
        	            	  19:   account_id   = "my-sa"
        	            	}
        	Test:       	TestSamples/3/backup_plan_association

@glasnt
Copy link
Contributor

glasnt commented Nov 21, 2024

Ah, that was a later change.

I'll create a fix in a new PR, which will allow us to also test these resources in isolation.

For future new API PRs, might be an idea to do that PR first before the sample, for isolation purposes.

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.

6 participants