繁体   English   中英

AWS 云形成胶表可重用模板

[英]AWS cloud formation glue table reusable template

我的 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

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

在此处输入图片说明

来源

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM