Search code examples
amazon-web-servicesaws-cloudformationaws-msk

AWS MSK Configuration creation fails in CloudFormation


I am trying to configure an AWS MSK Cluster in CloudFormation with this yml template:

MSKClusterConfiguration:
Type: AWS::MSK::Configuration
Properties:
  Name: MJPMSKConfiguration
  KafkaVersionsList:
    - 3.5.1
  ServerProperties: |
    retention.ms=-1
    retention.bytes=900000000

The response for this resource creation in CloudFormation Events tab is:

Resource handler returned message: "[ClientRequestToken: 2c72ab96-e95d-f86e-d0d5-9bf3d71432e0] [ { "name" : "retention.ms", "value" : "-1", "errorMessages" : [ "Key 'retention.ms' is not supported by at least one Apache Kafka version. Key checked against versions: [2.8.1.2, 2.6.2, 2.7.1, 2.8.0, 2.6.3, 2.7.2, 2.8.1, 2.5.1, 2.6.0, 2.6.1, 2.7.0, 2.3.1, 2.2.1, 2.4.1.1, 3.3.2, 3.5.1, 3.6.0, 3.1.1, 3.2.0, 3.3.1, 3.4.0]" ] }, { "name" : "retention.bytes", "value" : "900000000", "errorMessages" : [ "Key 'retention.bytes' is not supported by at least one Apache Kafka version. Key checked against versions: [2.8.1.2, 2.6.2, 2.7.1, 2.8.0, 2.6.3, 2.7.2, 2.8.1, 2.5.1, 2.6.0, 2.6.1, 2.7.0, 2.3.1, 2.2.1, 2.4.1.1, 3.3.2, 3.5.1, 3.6.0, 3.1.1, 3.2.0, 3.3.1, 3.4.0]" ] } ] (Service: Kafka, Status Code: 400, Request ID: 7fcbb458-68fc-4ced-866a-22e591b9155f)" (RequestToken: 2c72ab96-e95d-f86e-d0d5-9bf3d71432e0, HandlerErrorCode: InvalidRequest)

What could be the problem here? I cannot find any solution for this in the AWS documentation.


Solution

  • Try with:

    MSKClusterConfiguration:
    Type: AWS::MSK::Configuration
    Properties:
      Name: MJPMSKConfiguration
      KafkaVersionsList:
        - 3.5.1
      ServerProperties: |
        log.retention.ms=-1
        log.retention.bytes=900000000
    

    Check here for the full list of MSK custom configurations.