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

Resource Orchestration Service:ALIYUN::ECS::SecurityGroupClone

最終更新日:Jun 11, 2026

セキュリティグループをクローンします。

構文

{
  "Type": "ALIYUN::ECS::SecurityGroupClone",
  "Properties": {
    "DestinationRegionId": String,
    "VpcId": String,
    "Description": String,
    "SecurityGroupName": String,
    "SourceSecurityGroupId": String,
    "ResourceGroupId": String,
    "NetworkType": String,
    "SecurityGroupType": String
  }
}

プロパティ

プロパティ名 タイプ 必須 更新可否 説明 制約
ResourceGroupId String いいえ はい リソースグループ ID。 なし。
SourceSecurityGroupId String はい いいえ クローン元のセキュリティグループの ID。 新しいセキュリティグループのネットワークタイプと互換性のあるルールのみをクローンします。
NetworkType String いいえ いいえ クローン後のセキュリティグループのネットワークタイプ。 有効な値: Classic。
VpcId String いいえ いいえ 新しいセキュリティグループが属する VPC の ID。 VpcId と NetworkType の両方を指定した場合、NetworkType の設定は無視されます。
Description String いいえ いいえ セキュリティグループの説明。 長さは 2~256 文字です。http:// または https:// で始まることはできません。
SecurityGroupName String いいえ いいえ セキュリティグループの名前。 デフォルト値は空です。長さは 2~128 文字で、先頭は英字である必要があります。英字、数字、ピリオド (.)、アンダースコア (_)、ハイフン (-) を使用できます。http:// または https:// で始まることはできません。
DestinationRegionId String いいえ いいえ クローン後のセキュリティグループの宛先リージョン。 デフォルト値: CURRENT。
SecurityGroupType String いいえ いいえ セキュリティグループのタイプ。 有効な値:
  • normal: 基本セキュリティグループ。
  • enterprise: 高度セキュリティグループ。

戻り値

Fn::GetAtt

SecurityGroupId: セキュリティグループの ID。

  • YAML 形式

    ROSTemplateFormatVersion: '2015-09-01'
    Description: ECS SecurityGroupClone のテスト
    Parameters:
      SourceSecurityGroupId:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        Label: セキュリティグループ ID
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
      VpcId:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Type: String
        Label: 既存の VPC インスタンス ID
      SecurityGroupName:
        Type: String
    Resources:
      SecurityGroupClone:
        Type: ALIYUN::ECS::SecurityGroupClone
        Properties:
          VpcId:
            Ref: VpcId
          SecurityGroupName:
            Ref: SecurityGroupName
          SourceSecurityGroupId:
            Ref: SourceSecurityGroupId
    Outputs:
      SecurityGroupId:
        Value:
          Fn::GetAtt:
            - SecurityGroupClone
            - SecurityGroupId
                        
  • JSON 形式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "ECS SecurityGroupClone のテスト",
      "Parameters": {
        "SourceSecurityGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Label": "セキュリティグループ ID",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          }
        },
        "VpcId": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Label": "既存の VPC インスタンス ID"
        },
        "SecurityGroupName": {
          "Type": "String"
        }
      },
      "Resources": {
        "SecurityGroupClone": {
          "Type": "ALIYUN::ECS::SecurityGroupClone",
          "Properties": {
            "VpcId": {
              "Ref": "VpcId"
            },
            "SecurityGroupName": {
              "Ref": "SecurityGroupName"
            },
            "SourceSecurityGroupId": {
              "Ref": "SourceSecurityGroupId"
            }
          }
        }
      },
      "Outputs": {
        "SecurityGroupId": {
          "Value": {
            "Fn::GetAtt": [
              "SecurityGroupClone",
              "SecurityGroupId"
            ]
          }
        }
      }
    }