amazon-web-services - AWS cloudformation 粘合表可重用模板

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

我的 aws 模板中有很多资源类型 AWS::Glue::Table。而且我不习惯将代码片段从模板复制粘贴到模板。所以想法是创建一个接受参数的可重用嵌套堆栈。我做到了,但仍然存在一个问题。我不知道如何通过参数将列传递到此堆栈 [{Type: string, Name: type}, {Type: string, Name: timeLogged}] - 它是一个对象数组。但 params 只接受字符串类型。

我尝试做这样的事情: !Split [ ",", "{Type: string, Name: type}, {Type: string, Name: timeLogged}"] - 但它没有帮助

AWSTemplateFormatVersion: 2010-09-09
Description: The AWS CloudFormation template for creating a Glue table
Parameters:
  DestinationBucketName:
    Type: String
    Description: Destination Regional Bucket Name
  DestinationBucketPrefix:
    Type: String
    Description: Destination Regional Bucket Prefix
  DatabaseName:
    Type: String
    Description: Database for Kinesis Analytics
  TableName:
    Type: String
    Description: Table for Kinesis Analytics
  InputFormat:
    Type: String
    Description: Input format for data
  OutputFormat:
    Type: String
    Description: Output format for data
  SerializationLibrary:
    Type: String
    Description: Serialization library for converting data

Resources:
  LogsCollectionTable:
    Type: AWS::Glue::Table
    Properties:
      DatabaseName: !Ref DatabaseName
      CatalogId: !Ref AWS::AccountId
      TableInput:
        Name: !Ref TableName
        Description: Table for storing data
        TableType: EXTERNAL_TABLE
        StorageDescriptor:
          Columns: [{Type: string, Name: type}, {Type: string, Name: timeLogged}]
          Location: !Sub s3://${DestinationBucketName}/${DestinationBucketPrefix}
          InputFormat: !Ref InputFormat
          OutputFormat: !Ref OutputFormat
          SerdeInfo:
            SerializationLibrary: !Ref SerializationLibrary

最佳答案

简短回答:目前还不能。您需要手动传递每个参数。

enter image description here

Source

关于amazon-web-services - AWS cloudformation 粘合表可重用模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63844534/

相关文章:

amazon-web-services - 部署 CloudFormation 堆栈以创建 ElasticBeanstalk 应用程序时出现 InsufficientPrivilegesException

amazon-web-services - AWS Glue 中的 Python 请求库

django - AWS CLI eb 创建错误 LargeZipFile

node.js - 分离网络服务器和处理服务器

AWS 上 Redis 身份验证 token 的正则表达式

amazon-web-services - AWS CloudFormation 堆栈 : add load balancer listener based on condition

python - 尝试使用 Boto3 调用 Lamba 时出现 InvalidSignatureException

python - AWS Glue 中 s3fs 库的导入失败

database - 如何减少 AWS RDS 中的 Oracle 撤消表空间?

node.js - 访问 JSON 返回未定义