|
|
@ -3,6 +3,7 @@ Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
|
|
|
Authors:
|
|
|
|
Authors:
|
|
|
|
Petr Krutov, <petr.krutov@digitalenergy.online>
|
|
|
|
Petr Krutov, <petr.krutov@digitalenergy.online>
|
|
|
|
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
|
|
|
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
|
|
|
|
|
|
|
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
|
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
@ -33,9 +34,9 @@ package rg
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"net/url"
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/rudecs/terraform-provider-decort/internal/constants"
|
|
|
|
"github.com/rudecs/terraform-provider-decort/internal/constants"
|
|
|
|
"github.com/rudecs/terraform-provider-decort/internal/controller"
|
|
|
|
"github.com/rudecs/terraform-provider-decort/internal/controller"
|
|
|
@ -133,16 +134,11 @@ func resourceResgroupCreate(ctx context.Context, d *schema.ResourceData, m inter
|
|
|
|
d.SetId(api_resp) // rg/create API returns ID of the newly creted resource group on success
|
|
|
|
d.SetId(api_resp) // rg/create API returns ID of the newly creted resource group on success
|
|
|
|
// rg.ID, _ = strconv.Atoi(api_resp)
|
|
|
|
// rg.ID, _ = strconv.Atoi(api_resp)
|
|
|
|
if !set_quota {
|
|
|
|
if !set_quota {
|
|
|
|
resp, err := utilityResgroupCheckPresence(ctx, d, m)
|
|
|
|
rg, err := utilityResgroupCheckPresence(ctx, d, m)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return diag.FromErr(err)
|
|
|
|
return diag.FromErr(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rg := ResgroupGetResp{}
|
|
|
|
|
|
|
|
if err := json.Unmarshal([]byte(resp), &rg); err != nil {
|
|
|
|
|
|
|
|
return diag.FromErr(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d.Set("quota", parseQuota(rg.Quota))
|
|
|
|
d.Set("quota", parseQuota(rg.Quota))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -155,14 +151,14 @@ func resourceResgroupRead(ctx context.Context, d *schema.ResourceData, m interfa
|
|
|
|
d.Get("name").(string), d.Get("account_id").(int))
|
|
|
|
d.Get("name").(string), d.Get("account_id").(int))
|
|
|
|
|
|
|
|
|
|
|
|
rg_facts, err := utilityResgroupCheckPresence(ctx, d, m)
|
|
|
|
rg_facts, err := utilityResgroupCheckPresence(ctx, d, m)
|
|
|
|
if rg_facts == "" {
|
|
|
|
if err != nil {
|
|
|
|
// if empty string is returned from utilityResgroupCheckPresence then there is no
|
|
|
|
// if empty string is returned from utilityResgroupCheckPresence then there is no
|
|
|
|
// such resource group and err tells so - just return it to the calling party
|
|
|
|
// such resource group and err tells so - just return it to the calling party
|
|
|
|
d.SetId("") // ensure ID is empty
|
|
|
|
d.SetId("") // ensure ID is empty
|
|
|
|
return diag.FromErr(err)
|
|
|
|
return diag.FromErr(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return diag.FromErr(flattenResgroup(d, rg_facts))
|
|
|
|
return diag.FromErr(flattenResgroup(d, *rg_facts))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func resourceResgroupUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
|
|
|
func resourceResgroupUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
|
|
@ -272,24 +268,21 @@ func resourceResgroupDelete(ctx context.Context, d *schema.ResourceData, m inter
|
|
|
|
log.Debugf("resourceResgroupDelete: called for RG name %s, account ID %d",
|
|
|
|
log.Debugf("resourceResgroupDelete: called for RG name %s, account ID %d",
|
|
|
|
d.Get("name").(string), d.Get("account_id").(int))
|
|
|
|
d.Get("name").(string), d.Get("account_id").(int))
|
|
|
|
|
|
|
|
|
|
|
|
rg_facts, err := utilityResgroupCheckPresence(ctx, d, m)
|
|
|
|
c := m.(*controller.ControllerCfg)
|
|
|
|
if rg_facts == "" {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return diag.FromErr(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// the target RG does not exist - in this case according to Terraform best practice
|
|
|
|
|
|
|
|
// we exit from Destroy method without error
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url_values := &url.Values{}
|
|
|
|
url_values := &url.Values{}
|
|
|
|
|
|
|
|
|
|
|
|
url_values.Add("rgId", d.Id())
|
|
|
|
url_values.Add("rgId", d.Id())
|
|
|
|
url_values.Add("force", "1")
|
|
|
|
if force, ok := d.GetOk("force"); ok {
|
|
|
|
url_values.Add("permanently", "1")
|
|
|
|
url_values.Add("force", strconv.FormatBool(force.(bool)))
|
|
|
|
url_values.Add("reason", "Destroyed by DECORT Terraform provider")
|
|
|
|
}
|
|
|
|
|
|
|
|
if permanently, ok := d.GetOk("permanently"); ok {
|
|
|
|
|
|
|
|
url_values.Add("permanently", strconv.FormatBool(permanently.(bool)))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if reason, ok := d.GetOk("reason"); ok {
|
|
|
|
|
|
|
|
url_values.Add("reason", reason.(string))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
c := m.(*controller.ControllerCfg)
|
|
|
|
_, err := c.DecortAPICall(ctx, "POST", ResgroupDeleteAPI, url_values)
|
|
|
|
_, err = c.DecortAPICall(ctx, "POST", ResgroupDeleteAPI, url_values)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return diag.FromErr(err)
|
|
|
|
return diag.FromErr(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -297,41 +290,28 @@ func resourceResgroupDelete(ctx context.Context, d *schema.ResourceData, m inter
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ResourceResgroup() *schema.Resource {
|
|
|
|
func ResourceRgSchemaMake() map[string]*schema.Schema {
|
|
|
|
return &schema.Resource{
|
|
|
|
return map[string]*schema.Schema{
|
|
|
|
SchemaVersion: 1,
|
|
|
|
"account_id": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
CreateContext: resourceResgroupCreate,
|
|
|
|
Required: true,
|
|
|
|
ReadContext: resourceResgroupRead,
|
|
|
|
ValidateFunc: validation.IntAtLeast(1),
|
|
|
|
UpdateContext: resourceResgroupUpdate,
|
|
|
|
Description: "Unique ID of the account, which this resource group belongs to.",
|
|
|
|
DeleteContext: resourceResgroupDelete,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Importer: &schema.ResourceImporter{
|
|
|
|
|
|
|
|
StateContext: schema.ImportStatePassthroughContext,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
Timeouts: &schema.ResourceTimeout{
|
|
|
|
"gid": {
|
|
|
|
Create: &constants.Timeout600s,
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
Read: &constants.Timeout300s,
|
|
|
|
Required: true,
|
|
|
|
Update: &constants.Timeout300s,
|
|
|
|
ForceNew: true, // change of Grid ID will require new RG
|
|
|
|
Delete: &constants.Timeout300s,
|
|
|
|
Description: "Unique ID of the grid, where this resource group is deployed.",
|
|
|
|
Default: &constants.Timeout300s,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"name": {
|
|
|
|
"name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Required: true,
|
|
|
|
Required: true,
|
|
|
|
Description: "Name of this resource group. Names are case sensitive and unique within the context of a account.",
|
|
|
|
Description: "Name of this resource group. Names are case sensitive and unique within the context of a account.",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
"account_id": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Required: true,
|
|
|
|
|
|
|
|
ValidateFunc: validation.IntAtLeast(1),
|
|
|
|
|
|
|
|
Description: "Unique ID of the account, which this resource group belongs to.",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"def_net_type": {
|
|
|
|
"def_net_type": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Optional: true,
|
|
|
|
Optional: true,
|
|
|
@ -365,17 +345,6 @@ func ResourceResgroup() *schema.Resource {
|
|
|
|
Description: "IP address on the external netowrk to request when def_net_type=PRIVATE and ext_net_id is not 0",
|
|
|
|
Description: "IP address on the external netowrk to request when def_net_type=PRIVATE and ext_net_id is not 0",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/* commented out, as in this version of provider we use default Grid ID
|
|
|
|
|
|
|
|
"grid_id": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Optional: true,
|
|
|
|
|
|
|
|
Default: 0, // if 0 is passed, default Grid ID will be used
|
|
|
|
|
|
|
|
// DefaultFunc: utilityResgroupGetDefaultGridID,
|
|
|
|
|
|
|
|
ForceNew: true, // change of Grid ID will require new RG
|
|
|
|
|
|
|
|
Description: "Unique ID of the grid, where this resource group is deployed.",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quota": {
|
|
|
|
"quota": {
|
|
|
|
Type: schema.TypeList,
|
|
|
|
Type: schema.TypeList,
|
|
|
|
Optional: true,
|
|
|
|
Optional: true,
|
|
|
@ -392,6 +361,23 @@ func ResourceResgroup() *schema.Resource {
|
|
|
|
Optional: true,
|
|
|
|
Optional: true,
|
|
|
|
Description: "User-defined text description of this resource group.",
|
|
|
|
Description: "User-defined text description of this resource group.",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
"force": {
|
|
|
|
|
|
|
|
Type: schema.TypeBool,
|
|
|
|
|
|
|
|
Optional: true,
|
|
|
|
|
|
|
|
Default: false,
|
|
|
|
|
|
|
|
Description: "Set to True if you want force delete non-empty RG",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"permanently": {
|
|
|
|
|
|
|
|
Type: schema.TypeBool,
|
|
|
|
|
|
|
|
Optional: true,
|
|
|
|
|
|
|
|
Default: false,
|
|
|
|
|
|
|
|
Description: "Set to True if you want force delete non-empty RG",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"reason": {
|
|
|
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
|
|
|
Optional: true,
|
|
|
|
|
|
|
|
Description: "Set to True if you want force delete non-empty RG",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
"account_name": {
|
|
|
|
"account_name": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Type: schema.TypeString,
|
|
|
@ -399,7 +385,127 @@ func ResourceResgroup() *schema.Resource {
|
|
|
|
Description: "Name of the account, which this resource group belongs to.",
|
|
|
|
Description: "Name of the account, which this resource group belongs to.",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
"resources": {
|
|
|
|
|
|
|
|
Type: schema.TypeList,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"current": {
|
|
|
|
|
|
|
|
Type: schema.TypeList,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"cpu": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disksize": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"extips": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"exttraffic": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"gpu": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"ram": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"seps": {
|
|
|
|
|
|
|
|
Type: schema.TypeList,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"sep_id": {
|
|
|
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"data_name": {
|
|
|
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disk_size": {
|
|
|
|
|
|
|
|
Type: schema.TypeFloat,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disk_size_max": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"reserved": {
|
|
|
|
|
|
|
|
Type: schema.TypeList,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"cpu": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disksize": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"extips": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"exttraffic": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"gpu": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"ram": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"seps": {
|
|
|
|
|
|
|
|
Type: schema.TypeList,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
|
|
|
"sep_id": {
|
|
|
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"data_name": {
|
|
|
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disk_size": {
|
|
|
|
|
|
|
|
Type: schema.TypeFloat,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"disk_size_max": {
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
"status": {
|
|
|
|
"status": {
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Type: schema.TypeString,
|
|
|
|
Computed: true,
|
|
|
|
Computed: true,
|
|
|
@ -409,13 +515,21 @@ func ResourceResgroup() *schema.Resource {
|
|
|
|
"vins": {
|
|
|
|
"vins": {
|
|
|
|
Type: schema.TypeList, //this is a list of ints
|
|
|
|
Type: schema.TypeList, //this is a list of ints
|
|
|
|
Computed: true,
|
|
|
|
Computed: true,
|
|
|
|
MaxItems: LimitMaxVinsPerResgroup,
|
|
|
|
|
|
|
|
Elem: &schema.Schema{
|
|
|
|
Elem: &schema.Schema{
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Description: "List of VINs deployed in this resource group.",
|
|
|
|
Description: "List of VINs deployed in this resource group.",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"vms": {
|
|
|
|
|
|
|
|
Type: schema.TypeList, //t his is a list of ints
|
|
|
|
|
|
|
|
Computed: true,
|
|
|
|
|
|
|
|
Elem: &schema.Schema{
|
|
|
|
|
|
|
|
Type: schema.TypeInt,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Description: "List of computes deployed in this resource group.",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
"computes": {
|
|
|
|
"computes": {
|
|
|
|
Type: schema.TypeList, //this is a list of ints
|
|
|
|
Type: schema.TypeList, //this is a list of ints
|
|
|
|
Computed: true,
|
|
|
|
Computed: true,
|
|
|
@ -424,7 +538,30 @@ func ResourceResgroup() *schema.Resource {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Description: "List of computes deployed in this resource group.",
|
|
|
|
Description: "List of computes deployed in this resource group.",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func ResourceResgroup() *schema.Resource {
|
|
|
|
|
|
|
|
return &schema.Resource{
|
|
|
|
|
|
|
|
SchemaVersion: 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateContext: resourceResgroupCreate,
|
|
|
|
|
|
|
|
ReadContext: resourceResgroupRead,
|
|
|
|
|
|
|
|
UpdateContext: resourceResgroupUpdate,
|
|
|
|
|
|
|
|
DeleteContext: resourceResgroupDelete,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Importer: &schema.ResourceImporter{
|
|
|
|
|
|
|
|
StateContext: schema.ImportStatePassthroughContext,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timeouts: &schema.ResourceTimeout{
|
|
|
|
|
|
|
|
Create: &constants.Timeout600s,
|
|
|
|
|
|
|
|
Read: &constants.Timeout300s,
|
|
|
|
|
|
|
|
Update: &constants.Timeout300s,
|
|
|
|
|
|
|
|
Delete: &constants.Timeout300s,
|
|
|
|
|
|
|
|
Default: &constants.Timeout300s,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Schema: ResourceRgSchemaMake(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|