从terraform向cloudformation堆栈动态传递aws keyspace partitionkeycolumns

lyr7nygr  于 2021-06-09  发布在  Cassandra
关注(0)|答案(0)|浏览(301)

由于still terraform不支持aws键空间(cassandra),我正在编写一个云形成堆栈,它将创建一个键空间和动态表。
但是我很难从terraform动态传递表clusteringkeycolumns、partitionkeycolumns和regularcolumns值。因为云的形成并没有像我们在地形中那样有正确的数据类型,比如map(string)。
https://docs.aws.amazon.com/awscloudformation/latest/userguide/aws-resource-cassandra-table.html#cfn-cassandra表聚类keycolumnshttps://docs.aws.amazon.com/awscloudformation/latest/userguide/aws-resource-cassandra-table.html#cfn-cassandra表分区keycolumnshttps://docs.aws.amazon.com/awscloudformation/latest/userguide/aws-resource-cassandra table.html#cfn cassandra table正则列
我试着跟你说,
在地形变量中,

variable "PartitionKeyColumns" {
  type        = list(string)
  description = "PartitionKeyColumns"
  default     = {"ColumnName": "column1Name" ,"ColumnType": "String"}
}

在tf aws\u cloudformation\u堆栈中,

parameters = {
    PartitionKeyColumns = var.PartitionKeyColumns
  }

  "Parameters" : {
    "PartitionKeyColumns" : {
      "Type" : "List(Column)",
      "Description" : "One or more columns that uniquely identify every row in the table. Every table must have a partition key"
      }
    }

  "Resources": {
    "MyNewTable": {
      "Type": "AWS::Cassandra::Table",
      "Properties": {
        "KeyspaceName": { "Ref" : "KeyspaceName" },
        "TableName":{ "Ref" : "MyCustomTable" },
        "PartitionKeyColumns": [{ "Ref" : "PartitionKeyColumns" }],

如果你们有什么建议,请告诉我。。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题