| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Cloud Bigtable" |
| description: |- |
| App profile is a configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. |
| --- |
| |
| # google\_bigtable\_app\_profile |
| |
| App profile is a configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. |
| |
| |
| To get more information about AppProfile, see: |
| |
| * [API documentation](https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances.appProfiles) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=bigtable_app_profile_anycluster&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Bigtable App Profile Anycluster |
| |
| |
| ```hcl |
| resource "google_bigtable_instance" "instance" { |
| name = "bt-instance" |
| cluster { |
| cluster_id = "cluster-1" |
| zone = "us-central1-a" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| cluster { |
| cluster_id = "cluster-2" |
| zone = "us-central1-b" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| cluster { |
| cluster_id = "cluster-3" |
| zone = "us-central1-c" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| |
| deletion_protection = "true" |
| } |
| |
| resource "google_bigtable_app_profile" "ap" { |
| instance = google_bigtable_instance.instance.name |
| app_profile_id = "bt-profile" |
| |
| // Requests will be routed to any of the 3 clusters. |
| multi_cluster_routing_use_any = true |
| |
| ignore_warnings = true |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=bigtable_app_profile_singlecluster&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Bigtable App Profile Singlecluster |
| |
| |
| ```hcl |
| resource "google_bigtable_instance" "instance" { |
| name = "bt-instance" |
| cluster { |
| cluster_id = "cluster-1" |
| zone = "us-central1-b" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| |
| deletion_protection = "true" |
| } |
| |
| resource "google_bigtable_app_profile" "ap" { |
| instance = google_bigtable_instance.instance.name |
| app_profile_id = "bt-profile" |
| |
| // Requests will be routed to the following cluster. |
| single_cluster_routing { |
| cluster_id = "cluster-1" |
| allow_transactional_writes = true |
| } |
| |
| ignore_warnings = true |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=bigtable_app_profile_multicluster&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Bigtable App Profile Multicluster |
| |
| |
| ```hcl |
| resource "google_bigtable_instance" "instance" { |
| name = "bt-instance" |
| cluster { |
| cluster_id = "cluster-1" |
| zone = "us-central1-a" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| cluster { |
| cluster_id = "cluster-2" |
| zone = "us-central1-b" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| cluster { |
| cluster_id = "cluster-3" |
| zone = "us-central1-c" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| |
| deletion_protection = "true" |
| } |
| |
| resource "google_bigtable_app_profile" "ap" { |
| instance = google_bigtable_instance.instance.name |
| app_profile_id = "bt-profile" |
| |
| // Requests will be routed to the following 2 clusters. |
| multi_cluster_routing_use_any = true |
| multi_cluster_routing_cluster_ids = ["cluster-1", "cluster-2"] |
| |
| ignore_warnings = true |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=bigtable_app_profile_priority&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Bigtable App Profile Priority |
| |
| |
| ```hcl |
| resource "google_bigtable_instance" "instance" { |
| name = "bt-instance" |
| cluster { |
| cluster_id = "cluster-1" |
| zone = "us-central1-b" |
| num_nodes = 3 |
| storage_type = "HDD" |
| } |
| |
| deletion_protection = "true" |
| } |
| |
| resource "google_bigtable_app_profile" "ap" { |
| instance = google_bigtable_instance.instance.name |
| app_profile_id = "bt-profile" |
| |
| // Requests will be routed to the following cluster. |
| single_cluster_routing { |
| cluster_id = "cluster-1" |
| allow_transactional_writes = true |
| } |
| |
| standard_isolation { |
| priority = "PRIORITY_LOW" |
| } |
| |
| ignore_warnings = true |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `app_profile_id` - |
| (Required) |
| The unique name of the app profile in the form `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. |
| |
| |
| - - - |
| |
| |
| * `description` - |
| (Optional) |
| Long form description of the use case for this app profile. |
| |
| * `multi_cluster_routing_use_any` - |
| (Optional) |
| If true, read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available |
| in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes |
| consistency to improve availability. |
| |
| * `single_cluster_routing` - |
| (Optional) |
| Use a single-cluster routing policy. |
| Structure is [documented below](#nested_single_cluster_routing). |
| |
| * `standard_isolation` - |
| (Optional) |
| The standard options used for isolating this app profile's traffic from other use cases. |
| Structure is [documented below](#nested_standard_isolation). |
| |
| * `instance` - |
| (Optional) |
| The name of the instance to create the app profile within. |
| |
| * `ignore_warnings` - |
| (Optional) |
| If true, ignore safety checks when deleting/updating the app profile. |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| <a name="nested_single_cluster_routing"></a>The `single_cluster_routing` block supports: |
| |
| * `cluster_id` - |
| (Required) |
| The cluster to which read/write requests should be routed. |
| |
| * `allow_transactional_writes` - |
| (Optional) |
| If true, CheckAndMutateRow and ReadModifyWriteRow requests are allowed by this app profile. |
| It is unsafe to send these requests to the same table/row/column in multiple clusters. |
| |
| <a name="nested_standard_isolation"></a>The `standard_isolation` block supports: |
| |
| * `priority` - |
| (Required) |
| The priority of requests sent using this app profile. |
| Possible values are: `PRIORITY_LOW`, `PRIORITY_MEDIUM`, `PRIORITY_HIGH`. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}` |
| |
| * `name` - |
| The unique name of the requested app profile. Values are of the form `projects/<project>/instances/<instance>/appProfiles/<appProfileId>`. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| AppProfile can be imported using any of these accepted formats: |
| |
| * `projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}` |
| * `{{project}}/{{instance}}/{{app_profile_id}}` |
| * `{{instance}}/{{app_profile_id}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AppProfile using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}" |
| to = google_bigtable_app_profile.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), AppProfile can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_bigtable_app_profile.default projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}} |
| $ terraform import google_bigtable_app_profile.default {{project}}/{{instance}}/{{app_profile_id}} |
| $ terraform import google_bigtable_app_profile.default {{instance}}/{{app_profile_id}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |