Skip to content

Commit

Permalink
resource/elastic_beanstalk_configuration_template: Handle missing pla…
Browse files Browse the repository at this point in the history
…tform

When a platform was removed by AWS, Terraform failed in the following
manner:

```
Error refreshing state: 1 error(s) occurred:
* aws_elastic_beanstalk_configuration_template.my_app: aws_elastic_beanstalk_configuration_template.my_app: InvalidParameterValue: No Platform named 'arn:aws:elasticbeanstalk:us-east-1::platform/Multi-container Docker running on 64bit Amazon Linux/2.7.1' found.
    status code: 400
```

Terraform should handle the missing platform error in the same way it handles the missing config template error - it will plan to remove it from state and then readd it
  • Loading branch information
stack72 committed Jul 24, 2017
1 parent 32d8662 commit 2606c88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aws/resource_aws_elastic_beanstalk_configuration_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func resourceAwsElasticBeanstalkConfigurationTemplateRead(d *schema.ResourceData
log.Printf("[WARN] No Configuration Template named (%s) found", d.Id())
d.SetId("")
return nil
} else if awsErr.Code() == "InvalidParameterValue" && strings.Contains(awsErr.Message(), "No Platform named") {
log.Printf("[WARN] No Platform named (%s) found", d.Get("solution_stack_name").(string))
d.SetId("")
return nil
}
}
return err
Expand Down

0 comments on commit 2606c88

Please sign in to comment.