Skip to content

Conversation

@ronnieplooker
Copy link
Contributor

Description

Fixes b/429215192

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

@ronnieplooker ronnieplooker requested review from a team as code owners July 2, 2025 19:38
@snippet-bot
Copy link

snippet-bot bot commented Jul 2, 2025

Here is the summary of changes.

You are about to add 1 region tag.

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

@ronnieplooker ronnieplooker changed the title feat: Prepared looker-core-psc for inclusion in C.G.C. documentation Add TF samples for creating a Looker (Google Cloud core) Enterprise instance that uses PSC Jul 2, 2025
@ronnieplooker
Copy link
Contributor Author

Intending to use this snippet on the following page:
https://cloud.google.com/looker/docs/looker-core-create-psc

Copy link
Contributor

@glasnt glasnt left a comment

Choose a reason for hiding this comment

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

Generally this sample looks okay, but other samples in the looker folder have configurations to skip tests. It will probably be needed for this one.

Example: https://github.com/terraform-google-modules/terraform-docs-samples/blob/main/looker/looker_instance_basic/test.yaml, where metadata.name is the folder name and will need to be changed.

client_secret = "my-client-secret"
}
psc_config {
allowed_vpcs = ["projects/test-project/global/networks/test"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This value won't work, as test-project is not a valid project ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the comments in the sample. The test-project and test parts of the VPC URL are unique to the user's project, so the value here is just an example.

Comment on lines 31 to 32
# update only
# service_attachments = [{local_fqdn: "www.local-fqdn.com" target_service_attachment_uri: "projects/my-project/regions/us-east1/serviceAttachments/sa"}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these comments needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the comments to hopefully be more useful!

@glasnt glasnt changed the title Add TF samples for creating a Looker (Google Cloud core) Enterprise instance that uses PSC feat: Add TF samples for creating a Looker (Google Cloud core) Enterprise instance that uses PSC Jul 3, 2025
@glasnt
Copy link
Contributor

glasnt commented Jul 3, 2025

/gcbrun

@glasnt glasnt added the waiting-response Waiting for issue author to respond. label Jul 3, 2025
@ronnieplooker
Copy link
Contributor Author

@glasnt thanks for taking a look! I have hopefully addressed your comments. If it helps, I took the sample directly from what the SME engineer uploaded to https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/looker_instance#example-usage---looker-instance-psc.

@ronnieplooker ronnieplooker requested a review from glasnt July 15, 2025 18:25
@glasnt
Copy link
Contributor

glasnt commented Jul 16, 2025

/gcbrun

psc_config {
allowed_vpcs = ["projects/test-project/global/networks/test"]
# (Optional) List of VPCs that are allowed ingress into the Looker instance.
service_attachments = [{local_fqdn: "www.local-fqdn.com" target_service_attachment_uri: "projects/my-project/regions/us-east1/serviceAttachments/sa"}]
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm reading the docs correctly, you don't set these values, they are updated for you. Trying to validate this part of the Terraform is failing with An argument named "service_attachments" is not expected here.. Are you able to confirm this is intended as an argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I get it! So the service attachment argument is relevant only when updating an instance config, not when creating it. I think that to match the other blocks in https://cloud.google.com/looker/docs/looker-core-create-psc#create_instance we should remove that argument entirely.

As for the allowed_vpcs, you would only specify that if you are creating an instance that uses only private IP (that is:

private_ip_enabled = true
public_ip_enabled  = false
psc_enabled  = true

This example doesn't follow that pattern, so I have commented out the allowed_vpcs and added some context.

@ronnieplooker ronnieplooker requested a review from glasnt July 16, 2025 11:18
@glasnt
Copy link
Contributor

glasnt commented Jul 20, 2025

/gcbrun

@glasnt
Copy link
Contributor

glasnt commented Jul 20, 2025

/gcbrun

@glasnt
Copy link
Contributor

glasnt commented Jul 20, 2025

/gcbrun

@glasnt glasnt merged commit a523e38 into terraform-google-modules:main Jul 20, 2025
5 checks passed
@glasnt glasnt removed the waiting-response Waiting for issue author to respond. label Jul 24, 2025
niharika-98 pushed a commit to niharika-98/terraform-docs-samples that referenced this pull request Sep 7, 2025
…rise instance that uses PSC (terraform-google-modules#871)

* feat: Prepared looker-core-psc for inclusion in C.G.C. documentation

* Update correct copyright year

Co-authored-by: Katie McLaughlin <[email protected]>

* Use "default" rather than "main"

Co-authored-by: Katie McLaughlin <[email protected]>

* reviewer updates

* add test.yaml file to skip tests

* update metadata

* clarify allowed vpc and service attachment arguments

* lint

* lint

---------

Co-authored-by: Katie McLaughlin <[email protected]>
Co-authored-by: Katie McLaughlin <[email protected]>
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.

2 participants