2

We want to set up Username and password authentication with AWS Secrets Manager as per the documentation.

  • We created a cluster in MSK
  • Created a secret as well with name AmazonMSK_testmsk2 and with key as Password and Value as { "username": "alice", "password": "alice-secret" }

Still when we associate the secret with MSK we get the error Amazon MSK failed to associate 1 secret for cluster. The provided secret has an invalid schema

The troubleshooting documentation is not of much help either

codeaprendiz
  • 2,703
  • 1
  • 25
  • 49

5 Answers5

3

This error can occur when one or more pre-requisites for creating the secret has not been followed. There are a few pre-requisites when creating the secret. AWS document for reference. Listing them below for quick access.

  • Choose Other type of secrets (e.g. API key) for the secret type.
  • Your secret name must have the prefix AmazonMSK_
  • Your user and password data must be in the following format to enter key-value pairs using the Plaintext option.
    {
      "username": "alice",
      "password": "alice-secret"
    }
2

Turns out you need to use Plaintext form. enter image description here

codeaprendiz
  • 2,703
  • 1
  • 25
  • 49
1

In addition to @Sourabh 's answer, a secret created with the default AWS KMS key cannot be used with an Amazon MSK cluster,

so what you need to do is:

  1. Open the Secrets Manager console.

  2. In Secret name, choose your secret.

  3. Choose Actions, and then choose dropdown list, select the AWS KMS key, select the check box for Create new version of secret with new encryption key, and then choose Save.

that should solve this error

Amazon MSK failed to associate 1 secret for cluster sasl-cluster. Wait for a few minutes and try again. If the problem persists, see AWS Support Center . API Response : The provided secret is encrypted with the default key. You can't use this secret with Amazon MSK.

Benda
  • 151
  • 1
  • 6
1

This is happening because at the time of secret creation you had selected the default aws kms option. Frist you have to create the new KMS then you have to update it in secret manager creation time.

After following all you will not get this error.

enter image description here

0

You can't use a backslash in the password:

plaintext

will give this error:

keyvalue

You can save it, but you cannot associate it with a cluster.

Ri4a
  • 640
  • 7
  • 13