webh
webh

Reputation: 379

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

Upvotes: 1

Views: 553

Answers (1)

Marcin
Marcin

Reputation: 238617

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.

Upvotes: 1

Related Questions