简体   繁体   中英

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. Creation of AWS::MSK::Configuration returns only ARN while I need ARN and Revision number to associate MSK Configuration to MSK Cluster. Is there any way to achieve this? Currently I'm hard-coding it to 1 which means it will work only for creating stack.

...
  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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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