全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-RDS-ReleaseInstancePublicConnection

更新時間:Sep 06, 2024

模板名稱

ACS-RDS-ReleaseInstancePublicConnection 釋放RDS執行個體的外網地址

立即執行

模板描述

釋放RDS執行個體的外網地址

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

instanceId

RDS執行個體ID

String

regionId

地區ID

String

{{ ACS::RegionId }}

OOSAssumeRole

OOS扮演的RAM角色

String

""

輸出參數

執行此模板需要的權限原則

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "rds:DescribeDBInstanceNetInfo",
                "rds:ReleaseInstancePublicConnection"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-RDS-ReleaseInstancePublicConnection詳情

模板內容

FormatVersion: OOS-2019-06-01
Description:
  en: Release the public address of RDS instance
  zh-cn: 釋放RDS執行個體的外網地址
  name-en: ACS-RDS-ReleaseInstancePublicConnection
  name-zh-cn: 釋放RDS執行個體的外網地址
  categories:
    - security
Parameters:
  regionId:
    Label:
      en: RegionId
      zh-cn: 地區ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  instanceId:
    Label:
      en: InstanceId
      zh-cn: RDS執行個體ID
    AssociationProperty: ALIYUN::RDS::Instance::InstanceId
    AssociationPropertyMetadata:
      RegionId: regionId
    Type: String
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeDBInstanceNetInfo
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Query the ip type and address of a RDS instance
      zh-cn: 查詢RDS的串連地址和地址類型
    Properties:
      Service: RDS
      API: DescribeDBInstanceNetInfo
      Parameters:
        RegionId: '{{ regionId }}'
        DBInstanceId: '{{ instanceId }}'
    Outputs:
      connectionString:
        Type: String
        ValueSelector: '.DBInstanceNetInfos.DBInstanceNetInfo[] | select(.IPType=="Public") | .ConnectionString'
  - Name: checkPublicAddress
    Action: 'ACS::Choice'
    Description:
      En: Whether to release instance public connection
      Zh-cn: 是否釋放RDS執行個體的外網地址
    Properties:
      DefaultTask: releaseInstancePublicConnection
      Choices:
        - When:
            'Fn::Equals':
              - Null
              - '{{ describeDBInstanceNetInfo.connectionString }}'
          NextTask: 'ACS::END'
  - Name: releaseInstancePublicConnection
    Action: 'ACS::ExecuteAPI'
    Description:
      En: Release the public address of RDS instances
      Zh-cn: 釋放RDS執行個體的外網地址
    Properties:
      Service: RDS
      API: ReleaseInstancePublicConnection
      Parameters:
        RegionId: '{{ regionId }}'
        DBInstanceId: '{{ instanceId }}'
        CurrentConnectionString: '{{ describeDBInstanceNetInfo.connectionString }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - instanceId
        Label:
          default:
            zh-cn: 選擇執行個體
            en: Select Instances
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 進階選項
            en: Control Options