| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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: "Apigee" |
| description: |- |
| Authorize the Synchronizer to download environment data from the control plane. |
| --- |
| |
| # google\_apigee\_sync\_authorization |
| |
| Authorize the Synchronizer to download environment data from the control plane. |
| |
| |
| To get more information about SyncAuthorization, see: |
| |
| * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations#getsyncauthorization) |
| * How-to Guides |
| * [Enable Synchronizer access](https://cloud.google.com/apigee/docs/hybrid/v1.8/synchronizer-access#enable-synchronizer-access) |
| |
| ## Example Usage - Apigee Sync Authorization Basic Test |
| |
| |
| ```hcl |
| resource "google_project" "project" { |
| project_id = "my-project" |
| name = "my-project" |
| org_id = "123456789" |
| billing_account = "000000-0000000-0000000-000000" |
| } |
| |
| resource "google_project_service" "apigee" { |
| project = google_project.project.project_id |
| service = "apigee.googleapis.com" |
| } |
| |
| resource "google_apigee_organization" "apigee_org" { |
| analytics_region = "us-central1" |
| project_id = google_project.project.project_id |
| |
| runtime_type = "HYBRID" |
| depends_on = [google_project_service.apigee] |
| } |
| |
| resource "google_service_account" "service_account" { |
| account_id = "my-account" |
| display_name = "Service Account" |
| } |
| |
| resource "google_project_iam_binding" "synchronizer-iam" { |
| project = google_project.project.project_id |
| role = "roles/apigee.synchronizerManager" |
| members = [ |
| "serviceAccount:${google_service_account.service_account.email}", |
| ] |
| } |
| |
| resource "google_apigee_sync_authorization" "apigee_sync_authorization" { |
| name = google_apigee_organization.apigee_org.name |
| identities = [ |
| "serviceAccount:${google_service_account.service_account.email}", |
| ] |
| depends_on = [google_project_iam_binding.synchronizer-iam] |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `identities` - |
| (Required) |
| Array of service accounts to grant access to control plane resources, each specified using the following format: `serviceAccount:service-account-name`. |
| The `service-account-name` is formatted like an email address. For example: my-synchronizer-manager-serviceAccount@my_project_id.iam.gserviceaccount.com |
| You might specify multiple service accounts, for example, if you have multiple environments and wish to assign a unique service account to each one. |
| The service accounts must have **Apigee Synchronizer Manager** role. See also [Create service accounts](https://cloud.google.com/apigee/docs/hybrid/v1.8/sa-about#create-the-service-accounts). |
| |
| * `name` - |
| (Required) |
| Name of the Apigee organization. |
| |
| |
| - - - |
| |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `organizations/{{name}}/syncAuthorization` |
| |
| * `etag` - |
| Entity tag (ETag) used for optimistic concurrency control as a way to help prevent simultaneous updates from overwriting each other. |
| Used internally during updates. |
| |
| |
| ## 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 |
| |
| |
| SyncAuthorization can be imported using any of these accepted formats: |
| |
| * `organizations/{{name}}/syncAuthorization` |
| * `{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import SyncAuthorization using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "organizations/{{name}}/syncAuthorization" |
| to = google_apigee_sync_authorization.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), SyncAuthorization can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_apigee_sync_authorization.default organizations/{{name}}/syncAuthorization |
| $ terraform import google_apigee_sync_authorization.default {{name}} |
| ``` |