我正在尝试使用 MSK 配置创建 cloudFormation 堆栈,并将 MSK 配置与 MSK 集群关联。创建 AWS::MSK::Configuration 仅返回 ARN,而我需要 ARN 和修订号才能将 MSK 配置关联到 MSK 集群。有什么办法可以实现这一点吗?目前我将其硬编码为 1,这意味着它仅适用于创建堆栈。
...
MSKConfiguration:
Type: AWS::MSK::Configuration
Properties:
Name: aws-msk-configuration
ServerProperties: |
auto.create.topics.enable = true
zookeeper.connection.timeout.ms = 1000
log.roll.ms = 604800000
MSKCluster:
Type: AWS::MSK::Cluster
Properties:
ClusterName: !Ref ClusterName
ClientAuthentication: !If
- UsingIamAuthentication
- Sasl:
Iam:
Enabled: true
- Sasl:
Scram:
Enabled: true
ConfigurationInfo:
Arn: !GetAtt MSKConfiguration.Arn
Revision: 1
...
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-configuration.html
最佳答案
只有定义 custom resource 才能获取最新版本。由于您对资源的完整逻辑进行了编程,因此您可以执行您想要的操作,包括自动设置 MKS 的最新版本。
关于amazon-web-services - 在 CloudFormation 中获取 AWS::MSK::Configuration 的最新版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73909810/