Resource Orchestration Service (ROS) integration example

更新时间:
复制 MD 格式

This topic describes how a RAM user can use Resource Orchestration Service (ROS) to create a privileged database account for a specific AnalyticDB for PostgreSQL instance.

Prerequisites

The RAM user needs the AliyunGPDBFullAccess permission to manage AnalyticDB for PostgreSQL and the AliyunROSFullAccess permission to manage Resource Orchestration Service.

Procedure

  1. Log on to the ROS console. In the top navigation bar, click the Region drop-down list and select the required region.

  2. In the navigation pane on the left, click Stack. Click Create Stack > Use ROS.

    • Specify Template: Select Select Existing Template.

    • Template Entry Method: Select Input Template.

  3. For Template Content, select ROS, enter the template code, and then click Next.

    Use the following ROS template to create a privileged database account for an AnalyticDB for PostgreSQL instance. For more information, see ALIYUN::GPDB::Account.

    Example

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DBInstanceId": {
          "Type": "String",
          "Description": "The ID of the instance.\nNote You can call the DescribeDBInstances operation to query details of all AnalyticDB for PostgreSQL instances in a specific\nregion, including instance IDs."
        },
        "AccountPassword": {
          "Type": "String",
          "Description": "The password of the privileged account.\nThe password must contain at least three of the following character types: uppercase\nletters, lowercase letters, digits, and special characters.\nSpecial characters include ! @ # & $ % ^  * ( ) _ + - =\nThe password must be 8 to 32 characters in length."
        },
        "AccountName": {
          "Type": "String",
          "Description": "The name of the privileged account.\nThe name can contain lowercase letters, digits, and underscores (_).\nThe name must start with a lowercase letter and end with a lowercase letter or a digit.\nThe name cannot start with gp.\nThe name must be 2 to 16 characters in length."
        }
      },
      "Resources": {
        "Account": {
          "Type": "ALIYUN::GPDB::Account",
          "Properties": {
            "DBInstanceId": {
              "Ref": "DBInstanceId"
            },
            "AccountPassword": {
              "Ref": "AccountPassword"
            },
            "AccountName": {
              "Ref": "AccountName"
            }
          }
        }
      },
      "Outputs": {
        "DBInstanceId": {
          "Description": "The ID of the instance.",
          "Value": {
            "Fn::GetAtt": [
              "Account",
              "DBInstanceId"
            ]
          }
        },
        "AccountName": {
          "Description": "The name of the account.",
          "Value": {
            "Fn::GetAtt": [
              "Account",
              "AccountName"
            ]
          }
        }
      }
    }
    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DBInstanceId:
        Type: String
        Description: |-
          The ID of the instance.
          Note You can call the DescribeDBInstances operation to query details of all AnalyticDB for PostgreSQL instances in a specific
          region, including instance IDs.
      AccountPassword:
        Type: String
        Description: |-
          The password of the privileged account.
          The password must contain at least three of the following character types: uppercase
          letters, lowercase letters, digits, and special characters.
          Special characters include ! @ # & $ % ^  * ( ) _ + - =
          The password must be 8 to 32 characters in length.
      AccountName:
        Type: String
        Description: |-
          The name of the privileged account.
          The name can contain lowercase letters, digits, and underscores (_).
          The name must start with a lowercase letter and end with a lowercase letter or a digit.
          The name cannot start with gp.
          The name must be 2 to 16 characters in length.
    Resources:
      Account:
        Type: ALIYUN::GPDB::Account
        Properties:
          DBInstanceId:
            Ref: DBInstanceId
          AccountPassword:
            Ref: AccountPassword
          AccountName:
            Ref: AccountName
    Outputs:
      DBInstanceId:
        Description: The ID of the instance.
        Value:
          Fn::GetAtt:
            - Account
            - DBInstanceId
      AccountName:
        Description: The name of the account.
        Value:
          Fn::GetAtt:
            - Account
            - AccountName
  4. Click Next.

  5. Click Create.

  6. After the stack is created, log on to the AnalyticDB for PostgreSQL console to view the database account.