资源编排服务 RFS-创建资源栈集:请求示例

时间:2024-09-27 18:16:56

请求示例

  • 通过OBS Signed URL传递模板和管理委托名称创建资源栈集

    POST https://{endpoint}/v1/stack-sets
    
    {
      "stack_set_name" : "my_first_stack_set",
      "template_uri" : "https://my_hello_world_bucket.{region}.myhuaweicloud.com/vpc.tf",
      "managed_agency_name" : "my_managed_agency_name",
      "administration_agency_name" : "my_administration_agency_name"
    }
  • 通过模板内容和管理委托URN创建资源栈集

    POST https://{endpoint}/v1/stack-sets
    
    {
      "stack_set_name" : "my_second_stack_set",
      "managed_agency_name" : "my_managed_agency_name",
      "administration_agency_urn" : "iam::my-domain-id:agency:my-agency-name",
      "template_body" : "terraform {\n    required_providers {\n      huaweicloud = {\n        source = \"huawei.com/provider/huaweicloud\"\n        version = \"1.41.0\"\n        }\n    }\n}\nprovider \"huaweicloud\"{\n    insecure = true\n    cloud = \"{cloud_name}\"\n    region = \"{region}\"\n    endpoints = {\n        iam = \"{iam_endpoint}\",\n    }\n}\n\nresource \"huaweicloud_vpc\" \"vpc\" {\n  cidr = \"172.16.0.0/16\"\n  name = \"my_vpc\"\n}"
    }
support.huaweicloud.com/api-aos/CreateStackSet.html