Skip to content

Commit 1c33495

Browse files
committed
fix: handle omni loc name tag deprecation
1 parent 84bd3f5 commit 1c33495

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

castai/resource_edge_location.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ func (r *edgeLocationResource) toAWS(ctx context.Context, plan, config *awsModel
694694
SubnetIds: subnetMap,
695695
},
696696
}
697+
if !plan.NameTag.IsNull() {
698+
out.Networking.NameTag = lo.ToPtr(plan.NameTag.ValueString())
699+
}
697700

698701
return out, diags
699702
}
@@ -709,13 +712,17 @@ func (r *edgeLocationResource) toAWSModel(ctx context.Context, config *omni.AWSP
709712
VpcID: types.StringNull(),
710713
SecurityGroupID: types.StringNull(),
711714
SubnetIDs: types.MapNull(types.StringType),
715+
NameTag: types.StringNull(),
712716
AccessKeyIDWO: types.StringNull(),
713717
SecretAccessKeyWO: types.StringNull(),
714718
}
715719

716720
if config.Networking != nil {
717721
aws.VpcID = types.StringValue(config.Networking.VpcId)
718722
aws.SecurityGroupID = types.StringValue(config.Networking.SecurityGroupId)
723+
if config.Networking.NameTag != nil {
724+
aws.NameTag = types.StringValue(*config.Networking.NameTag)
725+
}
719726

720727
if config.Networking.SubnetIds != nil {
721728
subnetMap, d := types.MapValueFrom(ctx, types.StringType, config.Networking.SubnetIds)

0 commit comments

Comments
 (0)