Description:"account, which will own this resource group",
},
"gid":schema.Int64Attribute{
Required:true,
Description:"grid id",
},
"name":schema.StringAttribute{
Required:true,
Description:"name of this RG. Must be unique within the account.",
},
// optional attributes
"def_net_type":schema.StringAttribute{
// attribute is only Optional (not Computed) on purpose. If Computed is added, errors occur during Create and
// Update of the resource in case "def_net"."net_type" is different from "def_net_type". Terraform framework
// produces "Error: Provider produced inconsistent results after apply" if plan values and resulting values
// are different, and this is exactly what happens if Computed and Optional field can be updated indirectly
// (via "def_net","net_type" in our case).
Optional:true,
Description:"type of the default network for this RG. VMs created in this RG will be by default connected to this network. Allowed values are PRIVATE, PUBLIC, NONE.",
Validators:[]validator.String{
stringvalidator.OneOf("PRIVATE","PUBLIC","NONE"),// case is not ignored
},
// default value is "PRIVATE".
},
"ipcidr":schema.StringAttribute{
Optional:true,
Description:"private network IP CIDR if default network PRIVATE",
},
"ext_net_id":schema.Int64Attribute{
Optional:true,
Description:"external network id",
// default value is 0.
},
"ext_ip":schema.StringAttribute{
Optional:true,
Description:"IP address on the external network to request when def_net_type=PRIVATE and ext_net_id is not 0.",
},
"owner":schema.StringAttribute{
Optional:true,
Description:"username - owner of this RG. Leave blank to set current user as owner",
},
"quota":schema.SingleNestedAttribute{
Optional:true,
Computed:true,
Description:"Quota settings for this resource group.",
Attributes:map[string]schema.Attribute{
"cpu":schema.Int64Attribute{
Optional:true,
Computed:true,
Description:"Limit on the total number of CPUs in this resource group.",
},
"ram":schema.Int64Attribute{
Optional:true,
Computed:true,
Description:"Limit on the total amount of RAM in this resource group, specified in MB.",
},
"disk":schema.Int64Attribute{
Optional:true,
Computed:true,
Description:"Limit on the total volume of storage resources in this resource group, specified in GB.",
},
"ext_traffic":schema.Int64Attribute{
Optional:true,
Computed:true,
Description:"Limit on the total ingress network traffic for this resource group, specified in GB.",
},
"ext_ips":schema.Int64Attribute{
Optional:true,
Computed:true,
Description:"Limit on the total number of external IP addresses this resource group can use.",
},
"gpu_units":schema.Int64Attribute{
Computed:true,
Description:"Limit on the total number of virtual GPUs this resource group can use.",
},
"cu_d":schema.Int64Attribute{
Computed:true,
Description:"Limit on the total volume of storage resources in this resource group, specified in GB.",
},
},
},
"access":schema.ListNestedAttribute{
Optional:true,
Description:"Grant/revoke user or group access to the Resource group as specified",
NestedObject:schema.NestedAttributeObject{
Attributes:map[string]schema.Attribute{
"user":schema.StringAttribute{
Required:true,
Description:"User or group name to grant access",
},
"right":schema.StringAttribute{
Required:true,
Description:"Access rights to set, one of 'R', 'RCX' or 'ARCXDU'",
},
},
},
},
"def_net":schema.SingleNestedAttribute{
Optional:true,
Description:"Set default network for attach associated VMs",
Attributes:map[string]schema.Attribute{
"net_type":schema.StringAttribute{
Required:true,
Validators:[]validator.String{
stringvalidator.OneOf("PRIVATE","PUBLIC"),// case is not ignored
},
Description:"Network type to set. Must be on of 'PRIVATE' or 'PUBLIC'.",
},
"net_id":schema.Int64Attribute{
Optional:true,
Description:"Network segment ID. If netType is PUBLIC and netId is 0 then default external network segment will be selected. If netType is PRIVATE and netId=0, the first ViNS defined for this RG will be selected. Otherwise, netId identifies either existing external network segment or ViNS.",
// default value is 0
},
},
},
"description":schema.StringAttribute{
Optional:true,
Description:"User-defined text description of this resource group.",
},
"force":schema.BoolAttribute{
Optional:true,
Description:"Set to True if you want force delete non-empty RG",
// default value is true
},
"permanently":schema.BoolAttribute{
Optional:true,
Description:"Set to True if you want force delete non-empty RG",
// default value is true
},
"register_computes":schema.BoolAttribute{
Optional:true,
Description:"Register computes in registration system",