gpt4 book ai didi

amazon-web-services - Cloudformation,无法创建类型为 `AWS::MSK::Configuration` 的资源

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

我正在尝试创建 AWS::MSK::Configuration 资源,如下所述:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-configuration.html .

这是我的 CF 模板:

Resources:
MSKConfig:
Type: AWS::MSK::Configuration
Properties:
Description: Basic configuration.
Name: test-msk-configuration
ServerProperties: |
auto.create.topics.enable=false
........

由于以下错误而失败:

An error occurred (ValidationError) when calling the CreateChangeSet operation: Template format error: #Unrecognized resource types: [AWS::MSK::Configuration]

我无法在线找到此资源类型的任何示例。有人用过吗?

最佳答案

2022 年 3 月 26 日更新:

我能够部署它。我使用无服务器框架进行部署。

MSK-Cluster.yml:

Resources:
ServerlessMSK:
Type: AWS::MSK::Cluster
Properties:
ClusterName: ${self:service}-${self:provider.stage}-msk
KafkaVersion: 2.6.2
BrokerNodeGroupInfo:
InstanceType: kafka.t3.small
ClientSubnets:
- !Ref ServerlessPrivateSubnet1
- !Ref ServerlessPrivateSubnet2
- !Ref ServerlessPrivateSubnet3
SecurityGroups:
- !GetAtt ServerlessMSKSecurityGroup.GroupId
StorageInfo:
EBSStorageInfo:
VolumeSize: 10
NumberOfBrokerNodes: 3
EncryptionInfo:
EncryptionInTransit:
ClientBroker: TLS
InCluster: true
EnhancedMonitoring: PER_TOPIC_PER_BROKER
ConfigurationInfo:
Arn: !GetAtt ServerlessMSKConfiguration.Arn
Revision: 1

MSK-config.yml

Resources:
ServerlessMSKConfiguration:
Type: AWS::MSK::Configuration
Properties:
Description: cluster for msk cluster-${sls:stage}
Name: node-mongo-kafka-experiment-${sls:stage}-config
ServerProperties: ${file('./assets/server.properties')}

服务器属性

auto.create.topics.enable=true
default.replication.factor=2
min.insync.replicas=2
num.io.threads=8
num.network.threads=5
num.partitions=10
num.replica.fetchers=2
replica.lag.time.max.ms=30000
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
socket.send.buffer.bytes=102400
unclean.leader.election.enable=true
zookeeper.session.timeout.ms=18000

基本上没有使用base64。我只是在部署中引用了该文件并设法将其启动。希望这会有所帮助。

原始答案如下:

我也无法正确部署它。但也许我可以为您指出正确的方向。为此,我的无服务器部署总是返回 400 错误。我唯一想在这里补充的是 serverproperties 必须是 Base64 编码的字符串。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-configuration.html

我的模板(导致错误):

Resources:
ServerlessMSKConfiguration:
Type: AWS::MSK::Configuration
Properties:
ServerProperties: !Base64 |
auto.create.topics.enable=true

注意:回答是因为我没有资格发表评论。

关于amazon-web-services - Cloudformation,无法创建类型为 `AWS::MSK::Configuration` 的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71238399/

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