Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Fix crasher in Elastic Beanstalk Configuration with Options #5756

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Mar 21, 2016

ElasticBeanstalk Configurations will crash if you attempt to use option_settings with the following panic:

2016/03/20 22:17:08 [DEBUG] terraform-provider-aws: panic: interface conversion: interface {} is map[string]interface {}, not *schema.ResourceData
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws: 
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws: goroutine 85 [running]:
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws: panic(0xe704e0, 0xc820129900)
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws:     /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.optionSettingHash(0xae9880, 0xc8202c9a40, 0xc800000001)
2016/03/20 22:17:08 [DEBUG] terraform-provider-aws:     /private/tmp/terraform20160316-80855-hnqetc/terraform-0.6.13/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_elastic_beanstalk_configuration_template.go:229 +0x352

The issue is the optionSettingHash method trying to coerce the interface it receives into a * schema.ResourceData instead of the map[string]interface{} that it actually is.

Another issue that exists is that this resource has it's own implementation of option settings that differs from (but is meant to be identical to) Beanstalk Environments. (ref http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_CreateEnvironment.html and http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_CreateConfigurationTemplate.html).

This PR consolidates the implementations into the one used by Environment, and we also change the config option name from option_settings to match Beanstalk Environments setting, for consistency. These changes are backwards safe because any use of options_settings in the Configuration resource is currently crashing anyway.

This PR updates the code to be consistent and updates the documentation to match

Fixes #5741

@phinze
Copy link
Contributor

phinze commented Mar 21, 2016

LGTM

catsby added a commit that referenced this pull request Mar 21, 2016
provider/aws: Fix crasher in Elastic Beanstalk Configuration with Options
@catsby catsby merged commit f715c91 into master Mar 21, 2016
@catsby catsby deleted the b-beanstalk-configuration-update branch March 21, 2016 17:59
@ghost
Copy link

ghost commented Apr 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option_settings crashes elastic beanstalk template
2 participants