将 kinesis 流添加到 DynamoDB 全局表中

问题描述 投票:0回答:1

我可以手动将 kinesis 流添加到每个区域的 DynamoDB 全局表中。我将流保留为特定于区域的流。使用 Cloudformation 模板添加时出现错误 “资源处理程序返回消息:”提供的请求无效:要启用 Kinesis Data Stream在 DynamoDBTable 中,流和表必须位于同一区域。"

我用于创作的 CFT 是,

AWSTemplateFormatVersion: "2010-09-09"
Description: 'AWS CloudFormation Template for DynamoDB tables For Flight Information Service'
Parameters:
  flightInformation:
    Type: String
    Description: Select dynamodb table name 
    Default: FlightInformationtest
  BillingMode:
    Description: Provisioned scaling mode
    Type: String
    Default: 'PAY_PER_REQUEST'
    AllowedValues:
      - 'PROVISIONED'
      - 'PAY_PER_REQUEST'
  FlightInfoStream:
    Description: "Flight info service kinesis stream arn"
    Type: "AWS::SSM::Parameter::Value<String>"
    Default: /flightinfo/kinesis/arn       
  AWSCurrentRegion: 
    Type: String
    Default: us-east-1  
  AWSReplicatedRegion: 
    Type: String
    Default: us-west-2 
  CFNStreamName:
    Description: This will be used to name the Kinesis DataStream
    Type: String
    Default: 'BDT-Flightinfo-Stream'
  CFNRetensionHours:
    Description: This will be used to set the retension hours
    Type: Number
    Default: 48    
Resources:
  FlightInformation: 
    Type: AWS::DynamoDB::GlobalTable
    Properties:
      TableName: !Ref flightInformation
      BillingMode: !Ref BillingMode
      AttributeDefinitions:
        - 
          AttributeName: "partitionKey"
          AttributeType: "S"
        - 
          AttributeName: "sortKey"
          AttributeType: "S"
      KeySchema: 
        - 
          AttributeName: "partitionKey"
          KeyType: "HASH"
        - 
          AttributeName: "sortKey"
          KeyType: "RANGE"          
      StreamSpecification:
        StreamViewType: NEW_AND_OLD_IMAGES
      SSESpecification:
        SSEEnabled: true
        SSEType: "KMS"    
      Replicas:
      - Region: !Ref AWSCurrentRegion
        KinesisStreamSpecification:
          StreamArn: !Ref FlightInfoStream    
        PointInTimeRecoverySpecification: 
          PointInTimeRecoveryEnabled: true        
      - Region: !Ref AWSReplicatedRegion
        KinesisStreamSpecification:
          StreamArn: !Ref FlightInfoStream      
        PointInTimeRecoverySpecification: 
          PointInTimeRecoveryEnabled: true

如果我们可以为这两个区域附加特定于全局 DynamoDB 区域的运动流,那就太好了!

amazon-web-services amazon-dynamodb aws-cloudformation amazon-kinesis
1个回答
0
投票

您尝试将相同的流 ARN 传递到两个区域,但这是行不通的。确保您将正确的流 ARN 传递到该给定区域的每个副本中:

      Replicas:
      - Region: !Ref AWSCurrentRegion
        KinesisStreamSpecification:
          StreamArn: <stream arn from  us-east-1 >    
        PointInTimeRecoverySpecification: 
          PointInTimeRecoveryEnabled: true        
      - Region: !Ref AWSReplicatedRegion
        KinesisStreamSpecification:
          StreamArn: <stream arn from  us-west-2 >     
        PointInTimeRecoverySpecification: 
          PointInTimeRecoveryEnabled: true
© www.soinside.com 2019 - 2024. All rights reserved.