@@ -61,7 +61,8 @@ type awsModel struct {
6161 VpcID types.String `tfsdk:"vpc_id"`
6262 SecurityGroupID types.String `tfsdk:"security_group_id"`
6363 SubnetIDs types.Map `tfsdk:"subnet_ids"`
64- NameTag types.String `tfsdk:"name_tag"`
64+ // Deprecated. Should be removed with name_tag attribute removal.
65+ NameTag types.String `tfsdk:"name_tag"`
6566}
6667
6768type gcpModel struct {
@@ -94,8 +95,7 @@ func (m awsModel) Equal(other *awsModel) bool {
9495 return m .AccountID .Equal (other .AccountID ) &&
9596 m .VpcID .Equal (other .VpcID ) &&
9697 m .SecurityGroupID .Equal (other .SecurityGroupID ) &&
97- m .SubnetIDs .Equal (other .SubnetIDs ) &&
98- m .NameTag .Equal (other .NameTag )
98+ m .SubnetIDs .Equal (other .SubnetIDs )
9999}
100100
101101func (m gcpModel ) credentials () types.String {
@@ -249,8 +249,9 @@ func (r *edgeLocationResource) Schema(_ context.Context, _ resource.SchemaReques
249249 Description : "Map of zone names to subnet IDs to be used in the selected region" ,
250250 },
251251 "name_tag" : schema.StringAttribute {
252- Required : true ,
253- Description : "The value of a 'Name' tag applied to VPC resources" ,
252+ Optional : true ,
253+ Description : "The value of a 'Name' tag applied to VPC resources" ,
254+ DeprecationMessage : "Deprecated. Can be omitted" ,
254255 },
255256 },
256257 },
@@ -691,9 +692,11 @@ func (r *edgeLocationResource) toAWS(ctx context.Context, plan, config *awsModel
691692 VpcId : plan .VpcID .ValueString (),
692693 SecurityGroupId : plan .SecurityGroupID .ValueString (),
693694 SubnetIds : subnetMap ,
694- NameTag : plan .NameTag .ValueString (),
695695 },
696696 }
697+ if ! plan .NameTag .IsNull () {
698+ out .Networking .NameTag = lo .ToPtr (plan .NameTag .ValueString ())
699+ }
697700
698701 return out , diags
699702}
@@ -717,7 +720,9 @@ func (r *edgeLocationResource) toAWSModel(ctx context.Context, config *omni.AWSP
717720 if config .Networking != nil {
718721 aws .VpcID = types .StringValue (config .Networking .VpcId )
719722 aws .SecurityGroupID = types .StringValue (config .Networking .SecurityGroupId )
720- aws .NameTag = types .StringValue (config .Networking .NameTag )
723+ if config .Networking .NameTag != nil && * config .Networking .NameTag != "" {
724+ aws .NameTag = types .StringValue (* config .Networking .NameTag )
725+ }
721726
722727 if config .Networking .SubnetIds != nil {
723728 subnetMap , d := types .MapValueFrom (ctx , types .StringType , config .Networking .SubnetIds )
0 commit comments