亚马逊MSK未能将1秘密与集群相关联。提供的秘密有无效的模式

发布于 2025-01-18 09:10:57 字数 667 浏览 5 评论 0 原文

我们要设置

  • 我们在MSK中创建了一个群集,
  • 也创建了一个秘密 Amazonmsk_testmsk2 ,并用键为 password and值为 {“ username”:“ alice”:“ alice”,“密码”,“密码” “:“ alice-secret”}

仍然是我们将秘密与MSK关联时,我们会得到错误 Amazon MSK无法将1与群集相关联。提供的秘密具有无效的模式

故障排除也没有太多帮助

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

云巢 2025-01-25 09:10:57

当未遵循创建密钥的一个或多个先决条件时,可能会发生此错误。创建秘密时有一些先决条件。 AWS 文档供参考。下面列出它们以便快速访问。

  • 选择其他类型的机密(例如 API 密钥)作为机密类型。
  • 您的密钥名称必须具有前缀 AmazonMSK_
  • 您的用户和密码数据必须采用以下格式才能使用 Plaintext 选项输入键值对。
    {
      "username": "alice",
      "password": "alice-secret"
    }

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"
    }
獨角戲 2025-01-25 09:10:57

事实证明您需要使用纯文本形式。
输入图片此处描述

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

懵少女 2025-01-25 09:10:57

除了@Sourabh 的回答之外,
使用默认 AWS KMS 密钥创建的密钥无法与 Amazon MSK 集群一起使用,

因此您需要执行以下操作:

  1. 打开 Secrets Manager 控制台。

  2. 在秘密名称中,选择您的秘密。

  3. 选择操作,然后选择下拉列表,选择 AWS KMS 密钥,选中使用新加密密钥创建新版本的密钥复选框,​​然后选择保存。

这应该可以解决这个错误

Amazon MSK 无法关联集群 sasl-cluster 的 1 个密钥。等待
几分钟后重试。如果问题仍然存在,请参阅 AWS
支持中心。 API 响应:提供的密钥已加密
默认键。您不能将此密钥与 Amazon MSK 一起使用。

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.

番薯 2025-01-25 09:10:57

发生这种情况是因为在创建密钥时您选择了默认的 aws kms 选项。
首先您必须创建新的 KMS
那么你必须在秘密管理器创建时更新它。

完成所有操作后,您将不会收到此错误。

输入图片此处描述

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

想挽留 2025-01-25 09:10:57

您不能在密码中使用后斜线:

”“

将给出此错误:

“

您可以保存它,但是您不能将其与群集关联。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文