Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☁️ Google Cloud Apigee Sync Authorization Terraform Module

Manages the org-level singleton granting service accounts access to control-plane resources for Apigee hybrid Synchronizer. Targets hashicorp/google ~> 7.0.

Terraform Provider Module Version Module Type Resource Count Posture


🧩 Overview

  • Provisions a single google_apigee_sync_authorization — an org-level singleton listing which service accounts are authorized for Apigee hybrid Synchronizer control-plane access.
  • No deletion_policy on this resource — confirmed absent from its own live schema.

💡 Why it matters: the name argument on this resource IS the organization reference — like google_apigee_addons_config.org, it consumes the org's .name output directly, with no separate org_id argument at all.


❤️ Support this project

If these Terraform modules have been helpful to you or your organization, I'd appreciate your support in any of the following ways:

Whether it's a star, a professional connection, or a coffee, every gesture helps keep these modules actively maintained and continually improving. Thank you for being part of the community!


🗺️ Where this fits

flowchart LR
 ORG["terraform-google-apigee-organization<br/>(same batch, required)"]:::keystone
 THIS["terraform-google-apigee-sync-authorization<br/>(this module — standalone)"]:::thismodule

 ORG -.->|"name -> name"| THIS

 classDef thismodule fill:#4285F4,color:#FFFFFF,stroke:#174EA6,stroke-width:1px;
 classDef keystone fill:#174EA6,color:#FFFFFF,stroke:#174EA6,stroke-width:1px;
Loading

🧬 What this builds

flowchart TB
 subgraph Inputs
 NAME["var.name"]
 IDENT["var.identities"]
 end

 KEYSTONE["google_apigee_sync_authorization.this"]:::keystone

 subgraph Outputs
 ID["id"]
 ETAG["etag"]
 end

 NAME --> KEYSTONE
 IDENT --> KEYSTONE

 KEYSTONE --> ID
 KEYSTONE --> ETAG

 classDef keystone fill:#174EA6,color:#FFFFFF,stroke:#174EA6,stroke-width:1px;
Loading

Resource inventory: one resource, google_apigee_sync_authorization.this.


✅ Provider / Versions

Item Value
Terraform >= 1.12.0
google provider ~> 7.0
Provider block None — the caller configures google

Schema notes that bite:

  • name IS the organization reference — no separate org_id argument exists, and name consumes the org's .name output, mirroring google_apigee_addons_config.org's precedent.
  • No deletion_policy — confirmed absent from this resource's schema.
  • No labels, no self_link, no project argument — confirmed absent.

🔑 Required IAM Roles

  • roles/apigee.admin — organization-wide Apigee administration.
  • roles/apigee.synchronizerManager — required on each service account listed in identities.

☁️ GCP Prerequisites

  • apigee.googleapis.com enabled (via terraform-google-project-services).
  • An Apigee organization must already exist (terraform-google-apigee-organization).
  • Each service account listed in identities must already hold the Apigee Synchronizer Manager role.

📁 Module Structure

terraform-google-apigee-sync-authorization/
├── providers.tf # required_providers + required_version
├── variables.tf # name, identities, timeouts
├── main.tf # google_apigee_sync_authorization.this
├── outputs.tf # id, etag
├── README.md
├── SCOPE.md
└── examples/
 └── basic/

⚙️ Quick Start

module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name = module.apigee_org.name

  identities = [
    "serviceAccount:[email protected]",
  ]
}

ℹ️ The caller configures the google provider block with valid ADC, Workload Identity Federation, or a service-account key per our authentication model.


🔌 Cross-Module Contract

Consumes

Input Type Source module
name string terraform-google-apigee-organization (required — consumes its .name output)

Emits

Output Description Consumed by
id Terraform-internal id None in this batch
etag Computed entity tag for optimistic concurrency control None

No self_link.


📚 Example Library

1 · Minimal single-identity authorization
module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name       = module.apigee_org.name
  identities = ["serviceAccount:[email protected]"]
}
2 · Multiple synchronizer service accounts (one per environment)
module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name = module.apigee_org.name

  identities = [
    "serviceAccount:[email protected]",
    "serviceAccount:[email protected]",
  ]
}
3 · Custom timeouts
module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name       = module.apigee_org.name
  identities = ["serviceAccount:[email protected]"]

  timeouts = {
    create = "15m"
    update = "15m"
    delete = "15m"
  }
}
4 · Reading the etag downstream
module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name       = module.apigee_org.name
  identities = ["serviceAccount:[email protected]"]
}

output "sync_authorization_etag" {
  value = module.apigee_sync_authorization.etag
}
5 · Hybrid runtime organization with dedicated synchronizer identity
module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name       = module.apigee_org_hybrid.name
  identities = ["serviceAccount:[email protected]"]
}
6 · 🏗️ End-to-end composition
module "apigee_org" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-organization.git?ref=v1.0.0"

  project_id          = "casey-prod-apigee"
  analytics_region    = "us-central1"
  disable_vpc_peering = true
}

module "apigee_sync_authorization" {
  source = "git::https://github.com/microsoftexpert/terraform-google-apigee-sync-authorization.git?ref=v1.0.0"

  name = module.apigee_org.name

  identities = [
    "serviceAccount:[email protected]",
  ]
}

💡 The organization must exist before its synchronizer authorization can be granted.


📥 Inputs

Group Variables
Identity name
Access identities
Lifecycle timeouts
Full object schemas
variable "name" {
  type = string
}

variable "identities" {
  type = list(string)
}

variable "timeouts" {
  type = object({
    create = optional(string)
    update = optional(string)
    delete = optional(string)
  })
  default = null
}

🧾 Outputs

Output Description
id Terraform-internal id
etag Computed entity tag for optimistic concurrency control

No self_link output — confirmed absent from this resource.


🧠 Architecture Notes

  • name IS the organization reference (no separate org_id argument), consuming the org's .name output — mirrors google_apigee_addons_config.org's precedent exactly.
  • No deletion_policy — this resource has no such field to override.
  • This is a singleton per organization; there is no natural key beyond the organization itself.

🧱 Design Principles

Concern Secure default Opt-out (explicit)
Control-plane access No default identities — caller must explicitly list every authorized service account N/A — identities is required

🚀 Runbook

terraform init -backend=false
terraform validate
terraform fmt -check

Pin ?ref=v1.0.0 — never a branch. This library is plan-only; a human applies from CI with valid credentials.


🧪 Testing

validate/fmt -check confirm structural and syntactic correctness only. They cannot catch GCP-side rejections — e.g. a service account listed in identities that lacks the Apigee Synchronizer Manager role surfaces only at apply time against a real project.


💬 Example Output

id = "organizations/casey-prod-apigee/syncAuthorization"
etag = "BwYzX1abcde="

🔍 Troubleshooting

Symptom Cause Fix
Synchronizer fails to authenticate against the control plane Service account missing from identities, or missing the Synchronizer Manager role Add the service account to identities and confirm it holds roles/apigee.synchronizerManager

🔗 Related Docs

About

Terraform module: terraform-google-apigee-sync-authorization

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages