diff --git a/builder/alicloud/ecs/builder.go b/builder/alicloud/ecs/builder.go index 892910c3d..99d759dc2 100644 --- a/builder/alicloud/ecs/builder.go +++ b/builder/alicloud/ecs/builder.go @@ -140,6 +140,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe AssociatePublicIpAddress: b.config.AssociatePublicIpAddress, RegionId: b.config.AlicloudRegion, InternetChargeType: b.config.InternetChargeType, + InternetMaxBandwidthOut: b.config.InternetMaxBandwidthOut, }) } else { steps = append(steps, &stepConfigAlicloudPublicIP{ diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index 397d8fd0a..f747068f2 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -14,6 +14,7 @@ type stepConfigAlicloudEIP struct { AssociatePublicIpAddress bool RegionId string InternetChargeType string + InternetMaxBandwidthOut int allocatedId string } @@ -24,6 +25,7 @@ func (s *stepConfigAlicloudEIP) Run(_ context.Context, state multistep.StateBag) ui.Say("Allocating eip") ipaddress, allocateId, err := client.AllocateEipAddress(&ecs.AllocateEipAddressArgs{ RegionId: common.Region(s.RegionId), InternetChargeType: common.InternetChargeType(s.InternetChargeType), + Bandwidth: s.InternetMaxBandwidthOut, }) if err != nil { state.Put("error", err)