全部产品
Search
文档中心

Resource Orchestration Service:ALIYUN::ResourceManager::ControlPolicyAttachment

更新时间:Jun 26, 2025

ALIYUN::ResourceManager::ControlPolicyAttachment digunakan untuk melampirkan kebijakan kontrol kustom.

Sintaksis

{
  "Type": "ALIYUN::ResourceManager::ControlPolicyAttachment",
  "Properties": {
    "TargetId": String,
    "PolicyId": String
  }
}

Properti

PropertiTipeDiperlukanDapat DieditDeskripsiKendala
TargetIdStringYaTidakID objek yang ingin Anda lampirkan kebijakan kontrolnya. Nilai yang valid:
  • Folder root
  • Subfolder dari folder Root
  • Akun anggota
PolicyIdStringYaTidakID kebijakan kontrol. Tidak ada

Parameter respons

Fn::GetAtt

  • PolicyType: Jenis kebijakan kontrol.
  • Description: Deskripsi kebijakan kontrol.
  • AttachDate: Waktu ketika kebijakan kontrol dilampirkan.
  • PolicyName: Nama kebijakan kontrol.
  • TargetId: ID objek yang menjadi target pelampiran kebijakan kontrol.
  • PolicyId: ID kebijakan kontrol.

Contoh

JSON Format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TargetId": {
      "Type": "String",
      "Description": "TargetId"
    },
    "PolicyId": {
      "Type": "String",
      "Description": "PolicyId"
    }
  },
  "Resources": {
    "ResourceManagerControlPolicyAttachment": {
      "Type": "ALIYUN::ResourceManager::ControlPolicyAttachment",
      "Properties": {
        "TargetId": {
          "Ref": "TargetId"
        },
        "PolicyId": {
          "Ref": "PolicyId"
        }
      }
    }
  },
  "Outputs": {
    "PolicyType": {
      "Description": "PolicyType",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "PolicyType"
        ]
      }
    },
    "Description": {
      "Description": "Description",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "Description"
        ]
      }
    },
    "AttachDate": {
      "Description": "AttachDate",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "AttachDate"
        ]
      }
    },
    "PolicyName": {
      "Description": "PolicyName",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "PolicyName"
        ]
      }
    },
    "TargetId": {
      "Description": "TargetId",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "TargetId"
        ]
      }
    },
    "PolicyId": {
      "Description": "PolicyId",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerControlPolicyAttachment",
          "PolicyId"
        ]
      }
    }
  }
}

YAML Format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  PolicyId:
    Description: PolicyId
    Type: String
  TargetId:
    Description: TargetId
    Type: String
Resources:
  ResourceManagerControlPolicyAttachment:
    Properties:
      PolicyId:
        Ref: PolicyId
      TargetId:
        Ref: TargetId
    Type: ALIYUN::ResourceManager::ControlPolicyAttachment
Outputs:
  AttachDate:
    Description: AttachDate
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - AttachDate
  Description:
    Description: Description
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - Description
  PolicyId:
    Description: PolicyId
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - PolicyId
  PolicyName:
    Description: PolicyName
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - PolicyName
  PolicyType:
    Description: PolicyType
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - PolicyType
  TargetId:
    Description: TargetId
    Value:
      Fn::GetAtt:
      - ResourceManagerControlPolicyAttachment
      - TargetId