### Apply Example Module Configuration Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Apply the configuration for a specific example module using Kitchen. This step provisions the necessary resources. Replace with the actual module name. ```bash kitchen_do converge ``` -------------------------------- ### Initialize Example Module Working Directory Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Initialize the working directory for a specific example module within the interactive testing container. Replace with the actual module name. ```bash kitchen_do create ``` -------------------------------- ### Destroy Example Module Resources Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Clean up and destroy the resources created for a specific example module. Replace with the actual module name. ```bash kitchen_do destroy ``` -------------------------------- ### Verify Example Module Functionality Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Run verification tests for a specific example module using Kitchen. This step checks if the applied configuration behaves as expected. Replace with the actual module name. ```bash kitchen_do verify ``` -------------------------------- ### Start Interactive Testing Docker Container Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Launch the testing Docker container in interactive mode. This allows for manual control over the Kitchen testing workflow. ```bash make docker_run ``` -------------------------------- ### Prepare Test Project with Docker Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Use this command to prepare a test project within a Docker container, based on the defined test setup. This command requires the service account credentials and environment variables to be set. ```bash make docker_test_prepare ``` -------------------------------- ### Run Integration Tests Noninteractively Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Execute all example modules' integration tests noninteractively using the prepared test project. This command ensures all modules function correctly. ```bash make docker_test_integration ``` -------------------------------- ### Create IAM Connectors Connector Gemini Enterprise Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md This example shows how to set up a Gemini Enterprise connector for advanced AI integrations. No specific parameters are required for the `ge_connector_params` block. ```hcl resource "google_iam_connectors_connector" "default" { location = "europe-west4" connector_id = "connector" connector_type_params { ge_connector_params {} } } ``` -------------------------------- ### Generate Module Documentation Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Run this command to generate or refresh the Inputs and Outputs tables for module READMEs. Ensure module interfaces are up-to-date before execution. ```bash make generate_docs ``` -------------------------------- ### Run Linting and Formatting Checks Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Execute linting and formatting checks across the repository files. This command ensures code quality and consistency. ```bash make docker_test_lint ``` -------------------------------- ### Create IAM Connectors Connector Basic (API Key) Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md Use this snippet to create a basic IAM connector authenticated via API Key. Ensure the API key is correctly provided. ```hcl resource "google_iam_connectors_connector" "default" { location = "europe-west4" connector_id = "connector" connector_type_params { api_key { api_key = "foobar" } } } ``` -------------------------------- ### Import IAM Connectors Connector using terraform import command Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md These commands demonstrate how to import an existing IAM connector into your Terraform state using the `terraform import` command. Choose the format that matches your resource's identifier. ```bash terraform import google_iam_connectors_connector.default projects/{{project}}/locations/{{location}}/services/{{connector_id}} terraform import google_iam_connectors_connector.default {{project}}/{{location}}/{{connector_id}} terraform import google_iam_connectors_connector.default {{location}}/{{connector_id}} ``` -------------------------------- ### Create IAM Connectors Connector Two-legged OAuth Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md Set up a Two-legged OAuth connector for service-to-service communication. This requires client ID, client secret, and token endpoint. `allowed_scopes` and `blocked_scopes` can be used to manage permissions. ```hcl resource "google_iam_connectors_connector" "default" { location = "europe-west4" connector_id = "connector" allowed_scopes = ["https://www.googleapis.com/auth/cloud-platform"] blocked_scopes = ["https://www.googleapis.com/auth/userinfo.email"] connector_type_params { two_legged_oauth { client_id = "foo" client_secret = "bar" token_endpoint = "qux" } } } ``` -------------------------------- ### Export Service Account Credentials Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Export your service account JSON credentials to the SERVICE_ACCOUNT_JSON environment variable. This is required for setting up the test environment. ```bash export SERVICE_ACCOUNT_JSON=$(< credentials.json) ``` -------------------------------- ### Create IAM Connectors Connector Three-legged OAuth Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md Configure a connector for Three-legged OAuth, which requires client ID, client secret, authorization URL, and token URL. The `allowed_scopes` argument specifies the permissions granted. ```hcl resource "google_iam_connectors_connector" "default" { location = "europe-west4" connector_id = "connector" allowed_scopes = ["https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/userinfo.email"] connector_type_params { three_legged_oauth { client_id = "foo" client_secret = "bar" authorization_url = "baz" token_url = "qux" } } } ``` -------------------------------- ### Set Test Environment Variables Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/CONTRIBUTING.md Set the necessary Terraform variables for organization ID, folder ID, and billing account ID. These are crucial for preparing the test project. ```bash export TF_VAR_org_id="your_org_id" export TF_VAR_folder_id="your_folder_id" export TF_VAR_billing_account="your_billing_account_id" ``` -------------------------------- ### Import IAM Connectors Connector using import block Source: https://github.com/googlecloudplatform/terraform-google-iam-connectors-service/blob/main/README.md Use this `import` block syntax in Terraform v1.5.0+ to import an existing IAM connector into your Terraform state. Ensure the `id` format matches one of the accepted patterns. ```hcl import { id = "projects/{{project}}/locations/{{location}}/services/{{connector_id}}" to = google_iam_connectors_connector.default } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.