Hello,
I’m bulding a new Terraform Provider.
I have the following schema:
"multicast_quota": {
Type: schema.TypeSet,
Optional: true,
MaxItems: 1,
ConfigMode: schema.SchemaConfigModeAttr,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"acl_num": {
Type: schema.TypeInt,
Description: "Quota of ACLs.",
Optional: true,
ValidateDiagFunc: validation.ToDiagFunc(
validation.IntBetween(0, 1000),
),
},
"acl_rule_num": {
Type: schema.TypeInt,
Description: "Quota of ACL rules.",
Optional: true,
ValidateDiagFunc: validation.ToDiagFunc(
validation.IntBetween(0, 3000),
),
},
},
},
},
Everytime i change one of attributes from typeset (acl_num or acl_rule_num) the terraform plans show that will remove the set item and create new one. Is Possible doing this with the terraform plan show only the attribute changed (so it’s edit one attribute from type set item and not delete the item and create a new one) ? There is a better way to do it?
# agilec_tenant.demotenant has been changed
~ resource "agilec_tenant" "demotenant" {
~ multicast_quota = [
+ {
+ acl_num = 10
+ acl_rule_num = 12
},
- {
- acl_num = 10
- acl_rule_num = 10
},
]
# (5 unchanged attributes hidden)
}
Thanks.