すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::REDIS::Account

最終更新日:Jan 16, 2025

ALIYUN::REDIS::Account は、Tair(Redis OSS 互換)インスタンスに対する特定の権限を持つアカウントを作成するために使用されます。

構文

{
  "Type": "ALIYUN::REDIS::Account",
  "Properties": {
    "AccountDescription": String,
    "InstanceId": String,
    "AccountName": String,
    "AccountPrivilege": String,
    "AccountType": String,
    "AccountPassword": String
  }
}

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

AccountDescription

String

いいえ

はい

アカウントの説明。

説明は 2 ~ 256 文字の長さでなければなりません。文字で始まり、http:// または https:// で始めることはできません。文字、数字、およびハイフン(-)を含めることができます。

InstanceId

String

はい

いいえ

インスタンス ID。

なし。

AccountName

String

はい

いいえ

アカウント名。

名前は最大 16 文字の長さにすることができます。文字で始める必要があります。小文字、数字、およびアンダースコア(_)を含めることができます。

AccountPrivilege

String

いいえ

はい

アカウントに付与する権限。

有効な値:

  • RoleReadOnly:読み取り専用権限。

  • RoleReadWrite(デフォルト):読み取りおよび書き込み権限。

  • RoleRepl:レプリケーション権限。レプリケーション権限には、読み取りおよび書き込み権限が含まれ、アカウントは SYNC and PSYNC コマンドを実行できます。 Redis 4.0 の標準インスタンスに対してのみ、レプリケーション権限を持つアカウントを作成できます。

AccountType

String

いいえ

いいえ

アカウントタイプ。

標準アカウントを指定する Normal に値を設定します。

AccountPassword

String

はい

はい

アカウントのパスワード。

パスワードは 8 ~ 32 文字の長さでなければなりません。パスワードには、次の文字タイプのうち少なくとも 3 つが含まれている必要があります:大文字、小文字、数字、および特殊文字。次の特殊文字がサポートされています:! @ # $ % ^ * ( ) _ + - =

戻り値

Fn::GetAtt

  • InstanceId:インスタンス ID。

  • AccountName:アカウント名。

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    Description: The ID of the instance for which you want to create the account.  # アカウントを作成するインスタンスのID。
Resources:
  Account:
    Type: ALIYUN::REDIS::Account
    Properties:
      AccountDescription: Test Create Redis Account
      InstanceId:
        Ref: InstanceId
      AccountType: Normal
      AccountName: demo_redis
      AccountPrivilege: RoleReadWrite
      AccountPassword: Admin@123!
Outputs:
  InstanceId:
    Description: The name of the instance. # インスタンスの名前。
    Value:
      Fn::GetAtt:
        - Account
        - InstanceId
  AccountName:
    Description: The name of the account. # アカウントの名前。
    Value:
      Fn::GetAtt:
        - Account
        - AccountName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the instance for which you want to create the account." // アカウントを作成するインスタンスのID。
    }
  },
  "Resources": {
    "Account": {
      "Type": "ALIYUN::REDIS::Account",
      "Properties": {
        "AccountDescription": "Test Create Redis Account",
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "AccountType": "Normal",
        "AccountName": "demo_redis",
        "AccountPrivilege": "RoleReadWrite",
        "AccountPassword": "Admin@123!"
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "The name of the instance.", // インスタンスの名前。
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "InstanceId"
        ]
      }
    },
    "AccountName": {
      "Description": "The name of the account.", // アカウントの名前。
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountName"
        ]
      }
    }
  }
}

その他の例については、redis をご覧ください。例では、ALIYUN::REDIS::Instance、ALIYUN::REDIS::Whitelist、および ALIYUN::REDIS::Account というリソースタイプが使用されています。