create

説明

組織内に新しいシークレットを作成します。シークレット名、値、および任意で説明と有効期限を設定できます。

概要

$ abeja secret create [--help]
Usage: abeja secret create [OPTIONS]

  Create a new secret

Options:
  -n, --name TEXT                 Secret name  [required]
  -v, --value TEXT                Secret value  [required]
  -d, --description TEXT          Secret description
  -e, --expired-at TEXT           Expiration date in ISO 8601 format
                                  (e.g. 2025-12-31T23:59:59+09:00)
  --integration_service_type, --integration-service-type TEXT
                                  Service Type of the ABEJA Platform to integrate secret. Currently, only `abeja-platform-labs` is supported.
  --integration_service_ids, --integration-service-ids TEXT (comma separated)
                                  Resource IDs of the ABEJA Platform to integrate secret.
                                  If `integration_service_type` is "abeja-platform-labs", the integration service ids must be a list of labs app ids with comma separated (e.g. "1111111111111,2222222222222")
  --organization_id, --organization-id TEXT
                                  Organization ID. If not specified, the current
                                  organization ID is used.
  --help                          Show this message and exit.

オプション

-n, --name

シークレットの名前を指定します。シークレット名には ASCII 文字、数字、および _- の文字のみを含めることができます。シークレット名の最後にハイフンとそれに続く 6 文字を使用しないでください。シークレット名は同じ組織内で一意である必要があります。このオプションは必須です。

-v, --value

シークレットの値を指定します。これは安全に保存したい機密データです。このオプションは必須です。

-d, --description

シークレットの目的を識別するための説明を任意で指定します。

-e, --expired-at

シークレットの有効期限を ISO 8601 形式(例:2025-12-31T23:59:59+09:00)で任意に指定します。

--integration_service_type, --integration-service-type

シークレットを連携する ABEJA Platform のサービスタイプ(ABEJA Platform Labs など)を指定します。現在、abeja-platform-labs のみがサポートされています。

--integration_service_ids, --integration-service-ids

シークレットを連携する ABEJA Platform のリソース ID(LabsアプリIDなど)を指定します。integration_service_typeabeja-platform-labs の場合、連携サービス ID はカンマ区切りの Labsアプリ ID のリストである必要があります(例:”1111111111111,2222222222222”)

--organization_id, --organization-id

組織 ID を指定します。指定しない場合は、設定から現在の組織 ID が使用されます。

新しいシークレットを作成

コマンド:

$ abeja secret create --name api-key-dev --value my-api-key-123456 --description "開発環境用の外部サービスAPIキー"

出力:

{
  "id": "secret-mnopqr456789",
  "name": "api-key-dev",
  "description": "開発環境用の外部サービスAPIキー",
  "integration_service_type": null,
  "integration_service_ids": [],
  "created_at": "2023-05-12T15:30:00.000000Z",
  "updated_at": "2023-05-12T15:30:00.000000Z",
  "expired_at": null,
  "versions": [
    {
      "version": 1,
      "created_at": "2023-05-12T15:30:00.000000Z"
    }
  ]
}

有効期限付きでシークレットを作成

コマンド:

$ abeja secret create --name db-password-test --value test-db-pass --description "テスト環境のデータベースパスワード" --expired-at 2025-12-31T23:59:59+09:00

出力:

{
  "id": "secret-stuvwx789012",
  "name": "db-password-test",
  "description": "テスト環境のデータベースパスワード",
  "integration_service_type": null,
  "integration_service_ids": [],
  "created_at": "2023-05-12T15:35:00.000000Z",
  "updated_at": "2023-05-12T15:35:00.000000Z",
  "expired_at": "2025-12-31T23:59:59+09:00",
  "versions": [
    {
      "version": 1,
      "created_at": "2023-05-12T15:35:00.000000Z"
    }
  ]
}

ABEJA Platform Labs 連携でシークレットを作成

コマンド:

$ abeja secret create --name db-password-test --value test-db-pass --description "テスト環境のデータベースパスワード" --integration-service-type "abeja-platform-labs" --integration-service-ids "1111111111111,2222222222222"

出力:

{
  "id": "secret-stuvwx789012",
  "name": "db-password-test",
  "description": "テスト環境のデータベースパスワード",
  "integration_service_type": "abeja-platform-labs",
  "integration_service_ids": ["1111111111111", "2222222222222"],
  "created_at": "2023-05-12T15:35:00.000000Z",
  "updated_at": "2023-05-12T15:35:00.000000Z",
  "expired_at": "2025-12-31T23:59:59+09:00",
  "versions": [
    {
      "version": 1,
      "created_at": "2023-05-12T15:35:00.000000Z"
    }
  ]
}