AWS CDK如何创建胶水工作室连接器

发布于 2025-02-02 18:44:21 字数 67 浏览 2 评论 0原文

我需要为胶合作业创建一个自定义的火花连接器,但是我只能找到有关创建数据库连接而不是通过CDK连接器的信息。这甚至可能吗?

I need to create a custom Spark connector for a Glue Job however I can only find information on creating Database Connections and not the connectors via CDK. Is this even possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑疤怪 2025-02-09 18:44:21

这就是我所做的。我手动创建了市场连接以使用命令来提取属性。

aws glue get-connection --catalog-id <aws_account_id> --name ElasticsearchGlueConnector

然后,我获得了以下Elasticsearch的输出

{
"Connection": {
    "Name": "ElasticsearchGlueConnector",
    "Description": "",
    "ConnectionType": "MARKETPLACE",
    "MatchCriteria": [
        "Connection",
        "Elasticsearch Connector 7.13.4 for AWS Glue 3.0"
    ],
    "ConnectionProperties": {
        "CONNECTOR_CLASS_NAME": "org.elasticsearch.spark.sql",
        "CONNECTOR_TYPE": "Spark",
        "CONNECTOR_URL": "https://709825985650.dkr.ecr.us-east-1.amazonaws.com/amazon-web-services/glue/elasticsearch:7.13.4-glue3.0-2"
    },
    "PhysicalConnectionRequirements": {
        "SubnetId": "xxxxx",
        "SecurityGroupIdList": [
            "xxxxxx"
        ],
        "AvailabilityZone": "xxxx"
    },
    "CreationTime": 1664056085.788,
    "LastUpdatedTime": 1664056085.788
}

}

然后,我使用此信息通过CDK创建连接,并且成功。

      new Connection(this, 'elasticSearchConnection', {
        type: new ConnectionType('MARKETPLACE'),
        connectionName: 'ElasticsearchGlueConnector',
        matchCriteria: [
            "Connection",
            "Elasticsearch Connector 7.13.4 for AWS Glue 3.0"
        ],
        description: 'ElasticSearch Connector for AWS Glue Jobs',
        securityGroups: [glueSecurityGroup],
        subnet: subnet,
        properties: {
            'CONNECTOR_CLASS_NAME': 'org.elasticsearch.spark.sql',
            'CONNECTOR_TYPE': 'Spark',
            'CONNECTOR_URL': 'https://709825985650.dkr.ecr.us-east-1.amazonaws.com/amazon-web-services/glue/elasticsearch:7.13.4-glue3.0-2'
        },
    });

This is what I did. I created the marketplace connection manually to pull the properties using the command.

aws glue get-connection --catalog-id <aws_account_id> --name ElasticsearchGlueConnector

I got the following output for Elasticsearch

{
"Connection": {
    "Name": "ElasticsearchGlueConnector",
    "Description": "",
    "ConnectionType": "MARKETPLACE",
    "MatchCriteria": [
        "Connection",
        "Elasticsearch Connector 7.13.4 for AWS Glue 3.0"
    ],
    "ConnectionProperties": {
        "CONNECTOR_CLASS_NAME": "org.elasticsearch.spark.sql",
        "CONNECTOR_TYPE": "Spark",
        "CONNECTOR_URL": "https://709825985650.dkr.ecr.us-east-1.amazonaws.com/amazon-web-services/glue/elasticsearch:7.13.4-glue3.0-2"
    },
    "PhysicalConnectionRequirements": {
        "SubnetId": "xxxxx",
        "SecurityGroupIdList": [
            "xxxxxx"
        ],
        "AvailabilityZone": "xxxx"
    },
    "CreationTime": 1664056085.788,
    "LastUpdatedTime": 1664056085.788
}

}

I then used this information to create connection through CDK and it was successful.

      new Connection(this, 'elasticSearchConnection', {
        type: new ConnectionType('MARKETPLACE'),
        connectionName: 'ElasticsearchGlueConnector',
        matchCriteria: [
            "Connection",
            "Elasticsearch Connector 7.13.4 for AWS Glue 3.0"
        ],
        description: 'ElasticSearch Connector for AWS Glue Jobs',
        securityGroups: [glueSecurityGroup],
        subnet: subnet,
        properties: {
            'CONNECTOR_CLASS_NAME': 'org.elasticsearch.spark.sql',
            'CONNECTOR_TYPE': 'Spark',
            'CONNECTOR_URL': 'https://709825985650.dkr.ecr.us-east-1.amazonaws.com/amazon-web-services/glue/elasticsearch:7.13.4-glue3.0-2'
        },
    });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文