mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 07:03:16 -06:00
address feedback from @stack72 on PR #7458
as of Mon Aug 8 03:08:21 UTC 2016
This commit is contained in:
parent
57d3c722e2
commit
4f07b92447
@ -60,10 +60,7 @@ func resourceAwsLoadBalancerBackendServerPoliciesCreate(d *schema.ResourceData,
|
||||
}
|
||||
|
||||
d.SetId(fmt.Sprintf("%s:%s", *setOpts.LoadBalancerName, strconv.FormatInt(*setOpts.InstancePort, 10)))
|
||||
d.Set("load_balancer_name", setOpts.LoadBalancerName)
|
||||
d.Set("instance_port", setOpts.InstancePort)
|
||||
d.Set("policy_names", flattenStringList(setOpts.PolicyNames))
|
||||
return nil
|
||||
return resourceAwsLoadBalancerBackendServerPoliciesRead(d, meta)
|
||||
}
|
||||
|
||||
func resourceAwsLoadBalancerBackendServerPoliciesRead(d *schema.ResourceData, meta interface{}) error {
|
||||
@ -81,6 +78,7 @@ func resourceAwsLoadBalancerBackendServerPoliciesRead(d *schema.ResourceData, me
|
||||
if ec2err, ok := err.(awserr.Error); ok {
|
||||
if ec2err.Code() == "LoadBalancerNotFound" {
|
||||
return fmt.Errorf("LoadBalancerNotFound: %s", err)
|
||||
d.SetId("")
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Error retrieving ELB description: %s", err)
|
||||
@ -130,6 +128,7 @@ func resourceAwsLoadBalancerBackendServerPoliciesDelete(d *schema.ResourceData,
|
||||
return fmt.Errorf("Error setting LoadBalancerPoliciesForBackendServer: %s", err)
|
||||
}
|
||||
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -60,10 +60,7 @@ func resourceAwsLoadBalancerListenerPoliciesCreate(d *schema.ResourceData, meta
|
||||
}
|
||||
|
||||
d.SetId(fmt.Sprintf("%s:%s", *setOpts.LoadBalancerName, strconv.FormatInt(*setOpts.LoadBalancerPort, 10)))
|
||||
d.Set("load_balancer_name", setOpts.LoadBalancerName)
|
||||
d.Set("load_balancer_port", setOpts.LoadBalancerPort)
|
||||
d.Set("policy_names", flattenStringList(setOpts.PolicyNames))
|
||||
return nil
|
||||
return resourceAwsLoadBalancerListenerPoliciesRead(d, meta)
|
||||
}
|
||||
|
||||
func resourceAwsLoadBalancerListenerPoliciesRead(d *schema.ResourceData, meta interface{}) error {
|
||||
@ -81,6 +78,7 @@ func resourceAwsLoadBalancerListenerPoliciesRead(d *schema.ResourceData, meta in
|
||||
if ec2err, ok := err.(awserr.Error); ok {
|
||||
if ec2err.Code() == "LoadBalancerNotFound" {
|
||||
return fmt.Errorf("LoadBalancerNotFound: %s", err)
|
||||
d.SetId("")
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Error retrieving ELB description: %s", err)
|
||||
@ -130,6 +128,7 @@ func resourceAwsLoadBalancerListenerPoliciesDelete(d *schema.ResourceData, meta
|
||||
return fmt.Errorf("Error setting LoadBalancerPoliciesOfListener: %s", err)
|
||||
}
|
||||
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ func resourceAwsLoadBalancerPolicyCreate(d *schema.ResourceData, meta interface{
|
||||
d.SetId(fmt.Sprintf("%s:%s",
|
||||
*lbspOpts.LoadBalancerName,
|
||||
*lbspOpts.PolicyName))
|
||||
return nil
|
||||
return resourceAwsLoadBalancerPolicyRead(d, meta)
|
||||
}
|
||||
|
||||
func resourceAwsLoadBalancerPolicyRead(d *schema.ResourceData, meta interface{}) error {
|
||||
@ -176,7 +176,7 @@ func resourceAwsLoadBalancerPolicyUpdate(d *schema.ResourceData, meta interface{
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return resourceAwsLoadBalancerPolicyRead(d, meta)
|
||||
}
|
||||
|
||||
func resourceAwsLoadBalancerPolicyDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
@ -204,6 +204,8 @@ func resourceAwsLoadBalancerPolicyDelete(d *schema.ResourceData, meta interface{
|
||||
if _, err := elbconn.DeleteLoadBalancerPolicy(request); err != nil {
|
||||
return fmt.Errorf("Error deleting Load Balancer Policy %s: %s", d.Id(), err)
|
||||
}
|
||||
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user