Terraform API添加GPG密钥

huangapple go评论50阅读模式
英文:

Terraform API add GPG key

问题

"我已在组织级别创建了一个API令牌,并正在尝试添加一个GPG密钥。

{
  "data": {
    "type": "gpg-keys",
    "attributes": {
      "namespace": "abc",
      "ascii-armor": "-----BEGIN PGP PUBLIC KEY BLOCK----- abc -----END PGP PUBLIC KEY BLOCK-----"
    }
  }
}

我将命名空间提供为我从组织中获得令牌的确切组织名称(区分大小写)。

我收到了以下响应:

{
  "errors": [
    {
      "status": "403",
      "title": "forbidden",
      "detail": "body namespace not authorized"
    }
  ]
}

我正在遵循这些文档:
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/gpg-keys#add-a-gpg-key"

英文:

I've created an api token at the organization level and am trying to add a GPG key

{
  "data": {
    "type": "gpg-keys",
    "attributes": {
      "namespace": "abc",
      "ascii-armor": "-----BEGIN PGP PUBLIC KEY BLOCK----- abc -----END PGP PUBLIC KEY BLOCK-----"
    }  }
}

I am providing namespace as the exact organization name (case sensitive) of the org I got the token from.

I am getting this response:

{
    "errors": [
        {
            "status": "403",
            "title": "forbidden",
            "detail": "body namespace not authorized"
        }
    ]
}

I am following this docs:
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/gpg-keys#add-a-gpg-key

答案1

得分: 2

你必须使用用户API令牌执行此操作。

您可以在您的用户设置页面上创建一个。

英文:

You must use a user API token to perform this operation.

You can create one on your user settings page.

答案2

得分: 0

这实际上只是用户错误(或用户不了解?)- 在Terraform云的免费版中,我们不能使用私有提供者。

更好的错误消息会使问题更容易解决。

英文:

This was actually just user error (or user unawareness?) - we cannot have private providers on the free tier of Terraform cloud.

A better error message would have made it easier.

huangapple
  • 本文由 发表于 2023年4月7日 02:13:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75952553.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定