ACS-Redis-ReleaseInstancePublicConnection

模板名称

ACS-Redis-ReleaseInstancePublicConnection 释放Redis实例的外网地址

立即执行

模板描述

释放Redis实例的外网地址

模板类型

自动化

所有者

Alibaba Cloud

输入参数

参数名称

描述

类型

是否必填

默认值

约束

instanceId

Redis实例ID

String

regionId

地域ID

String

{{ ACS::RegionId }}

OOSAssumeRole

OOS扮演的RAM角色

String

""

输出参数

执行此模板需要的权限策略

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

详情

ACS-Redis-ReleaseInstancePublicConnection详情

模板内容

FormatVersion: OOS-2019-06-01
Description:
  en: Release the public address of Redis instance
  zh-cn: 释放Redis实例的外网地址
  name-en: ACS-Redis-ReleaseInstancePublicConnection
  name-zh-cn: 释放Redis实例的外网地址
  categories:
    - security
Parameters:
  regionId:
    Label:
      en: RegionId
      zh-cn: 地域ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  instanceId:
    Label:
      en: The id of Redis instances
      zh-cn: Redis实例ID
    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 Redis instance
      zh-cn: 查询Redis的连接地址和地址类型
    Properties:
      Service: R-KVSTORE
      API: DescribeDBInstanceNetInfo
      Parameters:
        RegionId: '{{ regionId }}'
        InstanceId: '{{ instanceId }}'
    Outputs:
      connectionString:
        Type: String
        ValueSelector: '.NetInfoItems.InstanceNetInfo[] | select(.IPType=="Public") | .ConnectionString'
  - Name: checkPublicAddress
    Action: 'ACS::Choice'
    Description:
      En: Whether to release instance public connection
      Zh-cn: 是否释放Redis实例的外网地址
    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 Redis instances
      Zh-cn: 释放Redis实例的外网地址
    Properties:
      Service: R-KVSTORE
      API: ReleaseInstancePublicConnection
      Parameters:
        RegionId: '{{ regionId }}'
        InstanceId: '{{ 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