amazon-web-services - 如何在 CloudFormation 模板中获取 Glue 开发端点 URL?

标签 amazon-web-services aws-cloudformation aws-glue

我正在尝试编写一个 CloudFormation 模板来创建:

  • Glue 开发端点(类型 AWS::Glue::DevEndpoint);和
  • Zeppelin 笔记本连接到创建的端点的 EC2 实例。

第二个资源需要端点 URL。 AWS::Glue::DevEndpoint 在输出中提供端点名称,但不清楚如何获取 URL。

到目前为止,我找到的唯一解决方案是引入 awsglue get-dev-endpoint 命令并在实例初始化过程的某个时刻解析其输出。

最佳答案

自 2019 年 5 月起,Cloudformation 不支持从 AWS::Glue::DevEndpoint 资源中检索公共(public)地址。

正如您在问题中所建议的,您可以从 CF 获取开发终端节点名称,并将其传递给 EC2 实例的用户数据中的 AWS CLI 命令,这可能是检索该名称的最佳方法。

我认为,如果您确保使用latest version of the AWS CLI,您使用glue CLI遇到的模型错误可能会得到解决。在运行该命令之前。此错误听起来像是 CLI 中的粘合服务存在某种配置问题。

Resources:
   MyDevEndpoint:
      Type: AWS::Glue::DevEndpoint
      Properties: 
         ...

   MyInstance:
      Type: AWS::EC2::Instance
      Properties:
         ...
         UserData:
            Fn::Base64: !Sub |
               aws --version
               yes | pip3 install awscli --upgrade --user
               aws --version
               ENDPOINT_NAME=${MyDevEndpoint}
               aws glue get-dev-endpoint --endpoint-name $ENDPOINT_NAME
               ...

关于amazon-web-services - 如何在 CloudFormation 模板中获取 Glue 开发端点 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56297986/

相关文章:

amazon-web-services - 使用 CloudFormation 删除 AWS Lambda 版本

terraform - 在 Terraform 中定义 sagemaker 管道资源

amazon-web-services - 通过 VPC 端点的 AWS 私有(private) API 网关

amazon-web-services - 用于检索有关实例的信息的 Ansible EC2 模块

amazon-web-services - 使用 CloudFormation 获取 LB 的 DNS

postgresql - 使用 AWS Glue 时如何在 Postgres 中将字符串保存为 JSONB 类型

amazon-web-services - AWS Glue : crawler misinterprets timestamps as strings. GLUE ETL 旨在将字符串转换为时间戳,使它们为 NULL

mysql - AWS RDS 实例的可用时间点恢复点

java - 无法执行 war - 文件 : "no main manifest attribute"

scala - AWS Glue Spark 作业 - 使用 CatalogSource 时如何对 S3 输入文件进行分组?