【问题标题】:How can I update a FireHose delivery stream's DataFormatConversionConfiguration using the AWS SDK?如何使用 AWS 开发工具包更新 FireHose 传输流的 DataFormatConversionConfiguration?
【发布时间】:2018-10-26 19:01:43
【问题描述】:

有没有人有使用firehose.update_destination 设置S3 目标的DataFormatConversionConfiguration 的工作示例?我正在遵循Is it possible to specify data format conversion in AWS Cloudformation? 中的指导,使用 boto3(AWS Python 开发工具包),但我没有成功。当我在 ExtendedS3DestinationConfiguration 参数中包含 DFCC 时,它会失败并出现以下错误:

Exception during processing: An error occurred (InvalidArgumentException) when calling the UpdateDestination operation: RoleArn must not be null or empty

如果我通过原始目标配置(由describe_delivery_stream 返回)不变,则更新成功。我还可以更改其他配置选项,例如BufferingHints。唯一失败的情况是DataFormatConversionConfiguration 不为空。

例如,传递这个作品:

{
  "RoleARN": "arn:aws:iam::1234567:role/MyExecutionRole",
  "BucketARN": "arn:aws:s3:::my-bucket",
  "Prefix": "databases/tables/requests/",
  "BufferingHints": {
    "SizeInMBs": 64,
    "IntervalInSeconds": 120
  },
  "CompressionFormat": "UNCOMPRESSED",
  "EncryptionConfiguration": {
    "NoEncryptionConfig": "NoEncryption"
  },
  "CloudWatchLoggingOptions": {
    "Enabled": false
  },
  "S3BackupMode": "Disabled"
}

但通过失败:

{
  "RoleARN": "arn:aws:iam::1234567:role/MyExecutionRole",
  "BucketARN": "arn:aws:s3:::my-bucket",
  "Prefix": "databases/tables/requests/",
  "BufferingHints": {
    "SizeInMBs": 64,
    "IntervalInSeconds": 120
  },
  "CompressionFormat": "UNCOMPRESSED",
  "EncryptionConfiguration": {
    "NoEncryptionConfig": "NoEncryption"
  },
  "CloudWatchLoggingOptions": {
    "Enabled": false
  },
  "S3BackupMode": "Disabled",
  "DataFormatConversionConfiguration": {
    "InputFormatConfiguration": {
      "Deserializer": {
        "OpenXJsonSerDe": {
        }
      }
    },
    "SchemaConfiguration": {
      "TableName": "requests",
      "DatabaseName": "mydb"
    },
    "OutputFormatConfiguration": {
      "Serializer": {
        "OrcSerDe": {
        }
      }
    }
  }
}

唯一的区别是DataFormatConversionConfiguration 元素。

我是否忽略了一些明显的东西?也许DFCC 元素格式不正确?我找不到任何可行的示例,所以我纯粹从文档中获取。

我也很惊讶在输入元素中使用RoleARNBucketARN,而不是RoleArnBucketArn 的通常约定,但不确定它是否密切相关。

【问题讨论】:

    标签: amazon-web-services aws-sdk amazon-kinesis-firehose


    【解决方案1】:

    正如您所怀疑的,您的 DataFormatConversionConfiguration 格式不正确。

    也许令人困惑的是,我认为它抱怨丢失的 RoleArnDataFormatConversionConfiguration.SchemaConfiguration.RoleARN

    我不会在这里全部复制,但我发现查看服务文档是了解有关 SDK 使用的类型的更深入信息的最佳方式:https://docs.aws.amazon.com/firehose/latest/APIReference/API_DataFormatConversionConfiguration.html

    【讨论】:

    • 谢谢!而且,是的,通过比较 SDK 文档、基本 API 参考和 CLI 文档并进行三角测量,我经常发现一些模糊的 CFm 错误;在这种情况下没有这样做。当然,查看 API 文档只能让您了解这么多,因为 - 莫名其妙,令人抓狂 - CFn 并不总是支持为 API 定义的所有属性。
    • 是的,CFn 经常落后(AWS 的参差不齐的文档没有帮助这一事实!)。我猜是因为它是由不同的团队维护的——这对我来说似乎是一个奇怪的选择——但我有什么资格与 AWS 的成功争论!祝你好运!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-04
    • 2018-03-12
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多