Skip to content

Commit 7c5b644

Browse files
committed
fix: Optimize subnet creation
1 parent 893785b commit 7c5b644

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builder/tencentcloud/cvm/step_config_subnet.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ func (s *stepConfigSubnet) Run(ctx context.Context, state multistep.StateBag) mu
5858
req.SubnetName = &s.SubnetName
5959
req.CidrBlock = &s.SubnetCidrBlock
6060
req.Zone = &s.Zone
61-
req.CdcId = &s.CdcId
61+
if s.CdcId != "" {
62+
req.CdcId = &s.CdcId
63+
}
6264
var resp *vpc.CreateSubnetResponse
6365
err := Retry(ctx, func(ctx context.Context) error {
6466
var e error

0 commit comments

Comments
 (0)