A BeyondCorp AppConnection resource represents a BeyondCorp protected AppConnection to a remote application. It creates all the necessary GCP components needed for creating a BeyondCorp protected AppConnection. Multiple connectors can be authorised for a single AppConnection.
To get more information about AppConnection, see:
resource "google_service_account" "service_account" {
account_id = "my-account"
display_name = "Test Service Account"
}
resource "google_beyondcorp_app_connector" "app_connector" {
name = "my-app-connector"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
}
resource "google_beyondcorp_app_connection" "app_connection" {
name = "my-app-connection"
type = "TCP_PROXY"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
}
resource "google_service_account" "service_account" {
account_id = "my-account"
display_name = "Test Service Account"
}
resource "google_beyondcorp_app_gateway" "app_gateway" {
name = "my-app-gateway"
type = "TCP_PROXY"
host_type = "GCP_REGIONAL_MIG"
}
resource "google_beyondcorp_app_connector" "app_connector" {
name = "my-app-connector"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
}
resource "google_beyondcorp_app_connection" "app_connection" {
name = "my-app-connection"
type = "TCP_PROXY"
display_name = "some display name"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
gateway {
app_gateway = google_beyondcorp_app_gateway.app_gateway.id
}
labels = {
foo = "bar"
bar = "baz"
}
}
The following arguments are supported:
name
-
(Required)
ID of the AppConnection.
application_endpoint
-
(Required)
Address of the remote application endpoint for the BeyondCorp AppConnection.
Structure is documented below.
The application_endpoint
block supports:
host
-
(Required)
Hostname or IP address of the remote application endpoint.
port
-
(Required)
Port of the remote application endpoint.
region
-
(Optional)
The region of the AppConnection.
display_name
-
(Optional)
An arbitrary user-provided name for the AppConnection.
labels
-
(Optional)
Resource labels to represent user provided metadata.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
type
-
(Optional)
The type of network connectivity used by the AppConnection. Refer to
https://cloud.google.com/beyondcorp/docs/reference/rest/v1/projects.locations.appConnections#type
for a list of possible values.
connectors
-
(Optional)
List of AppConnectors that are authorised to be associated with this AppConnection
gateway
-
(Optional)
Gateway used by the AppConnection.
Structure is documented below.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
app_gateway
-
(Required)
AppGateway name in following format: projects/{project_id}/locations/{locationId}/appgateways/{gateway_id}.
type
-
(Optional)
The type of hosting used by the gateway. Refer to
https://cloud.google.com/beyondcorp/docs/reference/rest/v1/projects.locations.appConnections#Type_1
for a list of possible values.
uri
-
(Output)
Server-defined URI for this resource.
ingress_port
-
(Output)
Ingress port reserved on the gateways for this AppConnection, if not specified or zero, the default port is 19443.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{region}}/appConnections/{{name}}
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 30 minutes.update
- Default is 30 minutes.delete
- Default is 30 minutes.AppConnection can be imported using any of these accepted formats:
projects/{{project}}/locations/{{region}}/appConnections/{{name}}
{{project}}/{{region}}/{{name}}
{{region}}/{{name}}
{{name}}
In Terraform v1.5.0 and later, use an import
block to import AppConnection using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{region}}/appConnections/{{name}}"
to = google_beyondcorp_app_connection.default
}
When using the terraform import
command, AppConnection can be imported using one of the formats above. For example:
$ terraform import google_beyondcorp_app_connection.default projects/{{project}}/locations/{{region}}/appConnections/{{name}}
$ terraform import google_beyondcorp_app_connection.default {{project}}/{{region}}/{{name}}
$ terraform import google_beyondcorp_app_connection.default {{region}}/{{name}}
$ terraform import google_beyondcorp_app_connection.default {{name}}
This resource supports User Project Overrides.