Merge pull request #6416 from willmao/willmao/fix-alicloud-eip-bandwidth-issue
fix alicloud builder eip allocating issue
This commit is contained in:
commit
453c76571c
|
@ -140,6 +140,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
||||||
AssociatePublicIpAddress: b.config.AssociatePublicIpAddress,
|
AssociatePublicIpAddress: b.config.AssociatePublicIpAddress,
|
||||||
RegionId: b.config.AlicloudRegion,
|
RegionId: b.config.AlicloudRegion,
|
||||||
InternetChargeType: b.config.InternetChargeType,
|
InternetChargeType: b.config.InternetChargeType,
|
||||||
|
InternetMaxBandwidthOut: b.config.InternetMaxBandwidthOut,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
steps = append(steps, &stepConfigAlicloudPublicIP{
|
steps = append(steps, &stepConfigAlicloudPublicIP{
|
||||||
|
|
|
@ -14,6 +14,7 @@ type stepConfigAlicloudEIP struct {
|
||||||
AssociatePublicIpAddress bool
|
AssociatePublicIpAddress bool
|
||||||
RegionId string
|
RegionId string
|
||||||
InternetChargeType string
|
InternetChargeType string
|
||||||
|
InternetMaxBandwidthOut int
|
||||||
allocatedId string
|
allocatedId string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ func (s *stepConfigAlicloudEIP) Run(_ context.Context, state multistep.StateBag)
|
||||||
ui.Say("Allocating eip")
|
ui.Say("Allocating eip")
|
||||||
ipaddress, allocateId, err := client.AllocateEipAddress(&ecs.AllocateEipAddressArgs{
|
ipaddress, allocateId, err := client.AllocateEipAddress(&ecs.AllocateEipAddressArgs{
|
||||||
RegionId: common.Region(s.RegionId), InternetChargeType: common.InternetChargeType(s.InternetChargeType),
|
RegionId: common.Region(s.RegionId), InternetChargeType: common.InternetChargeType(s.InternetChargeType),
|
||||||
|
Bandwidth: s.InternetMaxBandwidthOut,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
state.Put("error", err)
|
state.Put("error", err)
|
||||||
|
|
Loading…
Reference in New Issue