GoogleServiceNetworkingConnection class final

Factory wrapper for google_service_networking_connection.

Creates a private services peering connection between the user's VPC network and one of Google's service producer VPCs. This is the "private connectivity" hop required for managed services (Cloud SQL private IP, Memorystore private IP, AlloyDB, etc) to be reachable only from inside the consumer VPC.

The pipeline is a three-resource chain:

  1. GoogleComputeNetwork — the consumer VPC.
  2. GoogleComputeGlobalAddress with purpose: vpcPeering — pre-reserves an internal CIDR on that VPC for Google's services to peer into.
  3. GoogleServiceNetworkingConnection (this resource) — peers Google's servicenetworking.googleapis.com producer VPC into the consumer VPC against the reserved range(s).

Once apply succeeds, downstream resources like GoogleSqlDatabaseInstance can set settings.ip_configuration.private_network to the same network and receive a private-only IP allocated from the reserved range.

Required identity:

  • localName: Terraform local name (the address segment after google_service_networking_connection.).
  • network: full self_link of a GoogleComputeNetwork (TfArg.ref(vpc.selfLink)). The provider rejects short network names here.
  • service: the producer service ID. The only documented value at the time of writing is 'servicenetworking.googleapis.com'; passed as a plain string so callers can target other producer services should Google introduce them.
  • reservedPeeringRanges: one or more name values from GoogleComputeGlobalAddress resources with purpose: vpcPeering. The provider rejects full self_links here — pass TfArg.ref(psaRange.nameRef).

Example (full Cloud SQL private-IP chain — see also the cloud_sql_quickstart example):

final psaPeering = GoogleServiceNetworkingConnection(
  localName: 'psa',
  network: TfArg.ref(vpc.selfLink),
  service: TfArg.literal('servicenetworking.googleapis.com'),
  reservedPeeringRanges: TfArg.literal([
    '\${google_compute_global_address.psa_range.name}',
  ]),
);

Constructors

GoogleServiceNetworkingConnection({required String localName, required TfArg<String> network, required TfArg<String> service, required TfArg<List<String>> reservedPeeringRanges, TfArg<String>? deletionPolicy, TfArg<bool>? updateOnCreationFail, LifecycleOptions? lifecycle, List<DependencyTarget>? dependsOn})

Properties

argMap Map<String, TfArg?>
Argument-name → TfArg map. Keys are snake_case (Terraform JSON name). Synth emits these keys directly; the factory is responsible for the camelCase → snake_case translation at construction time.
finalinherited
dependsOn List<DependencyTarget>?
Optional depends_on = [...]. Each entry is a DependencyTarget — either a wholesale resource (rendered as bare address) or an explicit TfRef (rendered via bareAddress).
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id → TfRef<String>
Reference to id attribute.
no setter
kind → ResourceKind
Always ResourceKind.resource. Overridden by Data.
no setterinherited
lifecycle → LifecycleOptions?
Optional lifecycle { ... } block.
finalinherited
localName String
User-supplied local name within a Stack.
finalinherited
peering → TfRef<String>
Reference to peering attribute.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sensitiveFields Set<String>
Field names that are @Sensitive per the IR-derived per-resource constant. Curated factories override with a baked-in static const Set<String> (file-private in v0.5+).
no setter
supportsDeletionProtection bool
Capability flag: true when this resource's underlying Terraform schema has a deletion_protection boolean attribute that the synth-time devMode flow can flip to false. Defaults to false; the codegen emitter overrides this to true for wrappers whose schema includes the attribute.
no setterinherited
terraformType String
Terraform resource type, e.g. google_pubsub_topic.
finalinherited
tfAddress String
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

tfType → const String