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:
- GoogleComputeNetwork — the consumer VPC.
- GoogleComputeGlobalAddress with
purpose: vpcPeering— pre-reserves an internal CIDR on that VPC for Google's services to peer into. - GoogleServiceNetworkingConnection (this resource) — peers
Google's
servicenetworking.googleapis.comproducer 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 aftergoogle_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 morenamevalues from GoogleComputeGlobalAddress resources withpurpose: vpcPeering. The provider rejects full self_links here — passTfArg.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< reservedPeeringRanges, TfArg<String> >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 aDependencyTarget— either a wholesale resource (rendered as bare address) or an explicitTfRef(rendered viabareAddress).finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
→ TfRef<
String> -
Reference to
idattribute.no setter - kind → ResourceKind
-
Always
ResourceKind.resource. Overridden byData.no setterinherited - lifecycle → LifecycleOptions?
-
Optional
lifecycle { ... }block.finalinherited - localName → String
-
User-supplied local name within a Stack.
finalinherited
-
peering
→ TfRef<
String> -
Reference to
peeringattribute.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sensitiveFields
→ Set<
String> -
Field names that are
@Sensitiveper the IR-derived per-resource constant. Curated factories override with a baked-instatic 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_protectionboolean attribute that the synth-time devMode flow can flip tofalse. Defaults to false; the codegen emitter overrides this totruefor 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