简体   繁体   English

在 CloudFormation 中获取 AWS::MSK::Configuration 的最新版本

[英]Get latest revision of AWS::MSK::Configuration in CloudFormation

I'm trying to create a cloudFormation stack with MSK Configuration and associating MSK Configuration with MSK Cluster.我正在尝试使用 MSK 配置创建 cloudFormation 堆栈并将 MSK 配置与 MSK 集群相关联。 Creation of AWS::MSK::Configuration returns only ARN while I need ARN and Revision number to associate MSK Configuration to MSK Cluster.创建 AWS::MSK::Configuration 仅返回 ARN,而我需要 ARN 和修订号来将 MSK 配置关联到 MSK 集群。 Is there any way to achieve this?有什么办法可以做到这一点? Currently I'm hard-coding it to 1 which means it will work only for creating stack.目前我将其硬编码为 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 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-configuration.html

You can only get the latest version if you define a custom resource .如果您定义自定义资源,您只能获得最新版本。 Since you program the full logic of the resource, you can do what you want, including automatically setting up latest version for MKS.由于您对资源的完整逻辑进行了编程,因此您可以为所欲为,包括自动为 MKS 设置最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM