Resource: awsGlueConnection
Provides a Glue Connection resource.
Example Usage
Non-VPC Connection
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueConnection.GlueConnection(this, "example", {
connectionProperties: {
JDBC_CONNECTION_URL: "jdbc:mysql://example.com/exampledatabase",
PASSWORD: "examplepassword",
USERNAME: "exampleusername",
},
name: "example",
});
Non-VPC Connection with secret manager reference
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsSecretmanagerSecretExample =
new aws.dataAwsSecretmanagerSecret.DataAwsSecretmanagerSecret(
this,
"example",
{
name: "example-secret",
}
);
const awsGlueConnectionExample = new aws.glueConnection.GlueConnection(
this,
"example_1",
{
connectionProperties: {
JDBC_CONNECTION_URL: "jdbc:mysql://example.com/exampledatabase",
SECRET_ID: dataAwsSecretmanagerSecretExample.name,
},
name: "example",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsGlueConnectionExample.overrideLogicalId("example");
VPC Connection
For more information, see the AWS Documentation.
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueConnection.GlueConnection(this, "example", {
connectionProperties: {
JDBC_CONNECTION_URL:
"jdbc:mysql://${aws_rds_cluster.example.endpoint}/exampledatabase",
PASSWORD: "examplepassword",
USERNAME: "exampleusername",
},
name: "example",
physicalConnectionRequirements: {
availabilityZone: "${aws_subnet.example.availability_zone}",
securityGroupIdList: ["${aws_security_group.example.id}"],
subnetId: "${aws_subnet.example.id}",
},
});
Argument Reference
The following arguments are supported:
catalogId
– (Optional) The ID of the Data Catalog in which to create the connection. If none is supplied, the AWS account ID is used by default.connectionProperties
– (Optional) A map of key-value pairs used as parameters for this connection.connectionType
– (Optional) The type of the connection. Supported are:custom
,jdbc
,kafka
,marketplace
,mongodb
, andnetwork
. Defaults tojbdc
.description
– (Optional) Description of the connection.matchCriteria
– (Optional) A list of criteria that can be used in selecting this connection.name
– (Required) The name of the connection.physicalConnectionRequirements
- (Optional) A map of physical connection requirements, such as VPC and SecurityGroup. Defined below.tags
- (Optional) Key-value map of resource tags. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
physicalConnectionRequirements
availabilityZone
- (Optional) The availability zone of the connection. This field is redundant and implied bysubnetId
, but is currently an api requirement.securityGroupIdList
- (Optional) The security group ID list used by the connection.subnetId
- (Optional) The subnet ID used by the connection.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- Catalog ID and name of the connectionarn
- The ARN of the Glue Connection.tagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block.
Import
Glue Connections can be imported using the catalogId
(AWS account ID if not custom) and name
, e.g.,