How to fix "new element 0 has appeared" error

This is the full error:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to pgedge_cluster.tech, provider
│ "provider[\""]" produced an unexpected new value:
│ .node_groups.aws[0].availability_zones: new element 0 has appeared.

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to pgedge_cluster.tech, provider
│ "provider[\""]" produced an unexpected new value:
│ .node_groups.aws[0].nodes: new element 0 has appeared.

This is the Schema function part of my resource:

"nodes": schema.ListNestedAttribute{
				Computed: true,
				Optional: true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"display_name": schema.StringAttribute{
							Optional:    true,
							Computed: true,
							Description: "Display name of the node",
						},
						"ip_address": schema.StringAttribute{
							Optional:    true,
							Computed: true,
							Description: "IP address of the node",
						},
						"is_active": schema.BoolAttribute{
							Optional:    true,
							Computed: true,
							Description: "Is the node active",
						},
					},
				},
			},

"availability_zones": schema.ListAttribute{
				ElementType: types.StringType,
				Computed:    true,
				Optional:    true,
			},

And this is how im using them in my .tf file:

 nodes = [],
 availability_zones = []

The Create method is adding values to these fields after apply

Hi @KnockOutEZ,

You haven’t shown how and where you are assigning values to these attributes within your code so it’s hard to say exactly what you might change.

When a value is assigned via configuration, the provider cannot change that value later during plan, and must apply what has been planned. This means that when the configuration assigns nodes = [], and that value is accepted by the plan, then you cannot later add values to that during apply.

The intent of the configuration shown is that the provider should take the empty [] assigned to nodes and update the remote value of nodes to match. If that is not possible, then the empty [] value should be rejected. If the user’s intent was actually to accept whatever the remote system has, then nodes should be left as null to indicate that it is unset.