Glue:Resource:aws_glue_connection


类型

Resource

标签

aws_glue_connection

AWS服务

Glue

说明

主要用于创建Glue连接。

样例

Non-VPC连接

resource "aws_glue_connection" "example" {
  connection_properties = {
    JDBC_CONNECTION_URL = "jdbc:mysql://example.com/exampledatabase"
    PASSWORD            = "examplepassword"
    USERNAME            = "exampleusername"
  }

  name = "example"
}

VPC连接

resource "aws_glue_connection" "example" {
  connection_properties = {
    JDBC_CONNECTION_URL = "jdbc:mysql://${aws_rds_cluster.example.endpoint}/exampledatabase"
    PASSWORD            = "examplepassword"
    USERNAME            = "exampleusername"
  }

  name = "example"

  physical_connection_requirements {
    availability_zone      = aws_subnet.example.availability_zone
    security_group_id_list = [aws_security_group.example.id]
    subnet_id              = aws_subnet.example.id
  }
}

参数(待翻译)

  • catalog_id – (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.
  • connection_properties – (Optional) A map of key-value pairs used as parameters for this connection.
  • connection_type – (Optional) The type of the connection. Supported are: JDBC, MONGODB, KAFKA, and NETWORK. Defaults to JBDC.
  • description – (Optional) Description of the connection.
  • match_criteria – (Optional) A list of criteria that can be used in selecting this connection.
  • name – (Required) The name of the connection.
  • physical_connection_requirements - (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 provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

physical_connection_requirements

  • availability_zone - (Optional) The availability zone of the connection. This field is redundant and implied by subnet_id, but is currently an api requirement.
  • security_group_id_list - (Optional) The security group ID list used by the connection.
  • subnet_id - (Optional) The subnet ID used by the connection.

属性引用

除上述所有参数外,还将访问该资源的以下属性:

id - Catalog ID and name of the connection
arn - The ARN of the Glue Connection.
tags_all - A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

资源导入

替换如下命令中的${catalog_id}和${name}并运行,可以导入Glue连接:

$ terraform import aws_glue_connection.${name} ${catalog_id}:${name}