diff --git a/aws/resource_aws_globalaccelerator_endpoint_group.go b/aws/resource_aws_globalaccelerator_endpoint_group.go index 5aa50b2af01b..d93ccbe01b2a 100644 --- a/aws/resource_aws_globalaccelerator_endpoint_group.go +++ b/aws/resource_aws_globalaccelerator_endpoint_group.go @@ -128,8 +128,8 @@ func resourceAwsGlobalAcceleratorEndpointGroupCreate(d *schema.ResourceData, met opts.ThresholdCount = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("traffic_dial_percentage"); ok { - opts.TrafficDialPercentage = aws.Float64(v.(float64)) + if v, ok := d.Get("traffic_dial_percentage").(float64); ok { + opts.TrafficDialPercentage = aws.Float64(v) } if v, ok := d.GetOk("endpoint_configuration"); ok { @@ -279,8 +279,8 @@ func resourceAwsGlobalAcceleratorEndpointGroupUpdate(d *schema.ResourceData, met opts.ThresholdCount = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("traffic_dial_percentage"); ok { - opts.TrafficDialPercentage = aws.Float64(v.(float64)) + if v, ok := d.Get("traffic_dial_percentage").(float64); ok { + opts.TrafficDialPercentage = aws.Float64(v) } if v, ok := d.GetOk("endpoint_configuration"); ok {