Hello,
I have a problem in my terraform, I have defined following schema:
"requiered_atributes": schema.SingleNestedAttribute{
Optional: true,
Attributes: map[string]schema.Attribute{
"some_tags": schema.ListAttribute{
ElementType: types.StringType,
Optional: true,
},
"some_metadata": schema.MapAttribute{
ElementType: types.StringType,
Optional: true,
},
"labels": schema.MapAttribute{
ElementType: types.StringType,
Optional: true,
},
},
},
Now the problem is as follows.
1.OK - In tf spec once I remove some of the attributes since they have tag optional= true all is ok.
2. NOT-OK - If I remove entire requiered_atributes I get error for some reason.
for example
requiered_atributes= {
labels = {
labelsone = "labels1",
labelstwo = "labels2"
}
some_metadata = {
metadataone = "metadata1",
testmetadatatwo = "metadata2",
}
some_tags = ["sometags10", "sometags20"]
}
OK - If I where to remove some_tags completely all would be ok.
FAILED - if I where to remove requiered_atributes there is and error.
The error is as follows: Failed with status: invalid character ‘N’ after top-level value.