gpt4 book ai didi

amazon-web-services - 依赖于另一个资源的存在的无服务器/Cloudform资源

转载 作者:行者123 更新时间:2023-12-03 07:29:51 25 4
gpt4 key购买 nike

我正在尝试使用无服务器框架部署输出到 ElasticSearch 域的 Kinesis Firehose

由于 Firehose 需要 ES 域已存在才能创建,因此我遇到了此错误:

An error occurred: MyFirehoseStream - Domain arn:aws:es:us-east-1:1234567890:domain/my-elastic-search is still being created.

有没有办法让Firehose创建等到ES域创建完成后再创建?


为了以防万一它有帮助,这里是我的 serverless.yml 文件的相关部分:

仅供引用,我正在使用 serverless-pseudo-parameters 插件来使用 #{AWS::Region}#{AWS::AccountId}

resources:
Resources:
MyFirehoseStream:
Type: "AWS::KinesisFirehose::DeliveryStream"
Properties:
DeliveryStreamName: "MyFirehoseStream"
DeliveryStreamType: "DirectPut"
ElasticsearchDestinationConfiguration:
BufferingHints:
IntervalInSeconds: 300
SizeInMBs: 5
DomainARN: "arn:aws:es:#{AWS::Region}:#{AWS::AccountId}:domain/my-elastic-search"
IndexName: "myindex"
IndexRotationPeriod: "NoRotation"
RetryOptions:
DurationInSeconds: 300
RoleARN: { "Fn::GetAtt": ["FirehoseBackupBucketRole", "Arn" ] }
S3BackupMode: "FailedDocumentsOnly"
S3Configuration:
BucketARN: { "Fn::GetAtt": ["FirehoseBackupBucket", "Arn" ] }
BufferingHints:
IntervalInSeconds: 300
SizeInMBs: 5
CompressionFormat: "GZIP"
RoleARN: { "Fn::GetAtt": ["FirehoseBackupBucketRole", "Arn" ] }
TypeName: "mytype"

MyElasticSearch:
Type: "AWS::Elasticsearch::Domain"
Properties:
AccessPolicies: ${file(./iam_policies/elastic-search.json)}
DomainName: "my-elastic-search"
ElasticsearchVersion: 6.2
ElasticsearchClusterConfig:
InstanceCount: "1"
InstanceType: "t2.small.elasticsearch"
EBSOptions:
EBSEnabled: true
Iops: 0
VolumeSize: 10
VolumeType: "gp2"

更新:

我现在已经解决了这个问题,所以如果具体细节对任何人都有帮助:

我将 DomainARN 属性更改为 { "Fn::GetAtt": ["MyElasticSearch", "DomainArn" ] }

我最初动态生成 ARN 的原因是因为对于 "Fn::GetAtt" ,我最初尝试仅使用 Arn 而不是 DomainArn ,但这不起作用。但巧合的是,DomainArn 在最新版本中已被弃用,因此如果您使用最新版本,Arn 实际上是正确的。

最佳答案

Cloudformation 资源支持 DependsOn 属性。


资源:
资源:
我的FirehoseStream:
类型:“AWS::KinesisFirehose::DeliveryStream”
取决于:MyElasticSearch

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html

关于amazon-web-services - 依赖于另一个资源的存在的无服务器/Cloudform资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49991349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com