云形成循环依赖firehose

时间:2017-11-03 11:33:54

标签: amazon-web-services amazon-cloudformation amazon-kinesis-firehose

我有以下CloudFormation模板。之前的更改集已成功创建了kinesis流和所有列出的角色。现在我想添加一个firehuse传输流。但我的更改集失败了FAILED - Circular dependency between resources: [EventDeliveryStream]消息。任何人都可以帮助我的模板出错吗?

已经应用的资源模板:

   AWSTemplateFormatVersion: "2010-09-09"
    Transform: 'AWS::Serverless-2016-10-31'
    Description: XXX

    Resources:
      EventStream:
        Type: "AWS::Kinesis::Stream"
        Properties:
          Name: "event-stream"
          RetentionPeriodHours: 24
          ShardCount: 1

     KinesisReadOnlyAccessRole:
        Type: "AWS::IAM::Role"
        Properties:
          RoleName: "kinesis-read-only-access-role"
          Path: "/"
          AssumeRolePolicyDocument:
            Version: "2012-10-17"
            Statement:
            -
              Effect: "Allow"
              Principal:
                Service: "firehose.amazonaws.com"
              Action: "sts:AssumeRole"
          ManagedPolicyArns:
          - "arn:aws:iam::aws:policy/AmazonKinesisReadOnlyAccess"
      ElasticSearchRole:
        Type: "AWS::IAM::Role"
        Properties:
          RoleName: "elastic-search-role"
          Path: "/"
          AssumeRolePolicyDocument:
            Version: "2012-10-17"
            Statement:
            -
              Effect: "Allow"
              Principal:
                Service: "firehose.amazonaws.com"
              Action: "sts:AssumeRole"
          ManagedPolicyArns:
          - "arn:aws:iam::aws:policy/AmazonESFullAccess"
      FailedDataS3BucketRole:
        Type: "AWS::IAM::Role"
        Properties:
          RoleName: "failed-data-s3-bucket-role"
          Path: "/"
          AssumeRolePolicyDocument:
            Version: "2012-10-17"
            Statement:
            -
              Effect: "Allow"
              Principal:
                Service: "firehose.amazonaws.com"
              Action: "sts:AssumeRole"
          ManagedPolicyArns:
          - "arn:aws:iam::aws:policy/AmazonS3FullAccess"

我想添加的新资源模板:

     EventDeliveryStream:
        Type: "AWS::KinesisFirehose::DeliveryStream"
        Properties:
          DeliveryStreamName: "kinesis-to-elastic"
          DeliveryStreamType: KinesisStreamAsSource
          KinesisStreamSourceConfiguration:
            KinesisStreamARN: !Ref EventStream
            RoleARN: !Ref KinesisReadOnlyAccessRole
          ElasticsearchDestinationConfiguration:
            DomainARN: "arn:aws:es:us-east-1:xxx:domain/xxx-data"
            RoleARN: !Ref ElasticSearchRole
            IndexName: "kinesis-events"
            TypeName: "object"
            IndexRotationPeriod: "NoRotation"
            RetryOptions:
              DurationInSeconds: "60"
            S3BackupMode: "FailedDocumentsOnly"
            BufferingHints:
              IntervalInSeconds: "60"
              SizeInMBs: "5"
            CloudWatchLoggingOptions:
              Enabled: true
              LogGroupName: "/aws/kinesisfirehose/event-stream-firehose"
              LogStreamName: "kinesis-to-elastic"
            S3Configuration:
              BucketARN:
                Ref: "arn:aws:s3:::etl-failed-data"
              RoleARN: !Ref FailedDataS3BucketRole
              Prefix: "firehose/"
              BufferingHints:
                IntervalInSeconds: "60"
                SizeInMBs: "5"
              CompressionFormat: "UNCOMPRESSED"

1 个答案:

答案 0 :(得分:0)

问题在于无效模板

{
  "code": 403,
  "errors": [
    {
      "domain": "usageLimits",
      "message": "Access Not Configured. YouTube Data API has not been used in project {projectId} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId} then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
      "reason": "accessNotConfigured",
      "extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId}"
    }
  ],
  "message": "Access Not Configured. YouTube Data API has not been used in project {projectId} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId} then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}

并且错误消息完全是误导性的