Skip to content

googleDatastreamPrivateConnection

The PrivateConnection resource is used to establish private connectivity between Datastream and a customer's network.

To get more information about PrivateConnection, see:

Example Usage - Datastream Private Connection Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkDefault = new google.computeNetwork.ComputeNetwork(
  this,
  "default",
  {
    name: "my-network",
  }
);
const googleDatastreamPrivateConnectionDefault =
  new google.datastreamPrivateConnection.DatastreamPrivateConnection(
    this,
    "default_1",
    {
      display_name: "Connection profile",
      labels: [
        {
          key: "value",
        },
      ],
      location: "us-central1",
      private_connection_id: "my-connection",
      vpc_peering_config: [
        {
          subnet: "10.0.0.0/29",
          vpc: googleComputeNetworkDefault.id,
        },
      ],
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleDatastreamPrivateConnectionDefault.overrideLogicalId("default");

Argument Reference

The following arguments are supported:

  • displayName - (Required) Display name.

  • vpcPeeringConfig - (Required) The VPC Peering configuration is used to create VPC peering between Datastream and the consumer's VPC. Structure is documented below.

  • privateConnectionId - (Required) The private connectivity identifier.

  • location - (Required) The name of the location this private connection is located in.

The vpcPeeringConfig block supports:

  • vpc - (Required) Fully qualified name of the VPC that Datastream will peer to. Format: projects/{project}/global/{networks}/{name}

  • subnet - (Required) A free subnet for peering. (CIDR of /29)


  • labels - (Optional) Labels.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

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}}/locations/{{location}}/privateConnections/{{privateConnectionId}}

  • name - The resource's name.

  • state - State of the PrivateConnection.

  • error - The PrivateConnection error in case of failure. Structure is documented below.

The error block contains:

  • message - (Optional) A message containing more information about the error that occurred.

  • details - (Optional) A list of messages that carry the error details.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

PrivateConnection can be imported using any of these accepted formats:

$ terraform import google_datastream_private_connection.default projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}
$ terraform import google_datastream_private_connection.default {{project}}/{{location}}/{{private_connection_id}}
$ terraform import google_datastream_private_connection.default {{location}}/{{private_connection_id}}

User Project Overrides

This resource supports User Project Overrides.