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

Elastic Transcoder doesn't allow empty notifications. #8163

Closed
tecnobrat opened this issue Aug 12, 2016 · 3 comments · Fixed by #8207
Closed

Elastic Transcoder doesn't allow empty notifications. #8163

tecnobrat opened this issue Aug 12, 2016 · 3 comments · Fixed by #8207

Comments

@tecnobrat
Copy link

This exists on terraform 0.7.0

Elastic Transcoder allows setting notifications to empty strings, however it appears that terraform flattens the list of notifications, removing any empty strings. This is not the correct behaviour. Infact, you should do the opposite, allow the user to not set the notification and set it as a blank string by default:

func flattenETNotifications(n *elastictranscoder.Notifications) []map[string]interface{} {
if n == nil {
return nil
}
allEmpty := func(s ...*string) bool {
for _, s := range s {
if s != nil && *s != "" {
return false
}
}
return true
}
// the API always returns a Notifications value, even when all fields are nil
if allEmpty(n.Completed, n.Error, n.Progressing, n.Warning) {
return nil
}
m := setMap(make(map[string]interface{}))
m.SetString("completed", n.Completed)
m.SetString("error", n.Error)
m.SetString("progressing", n.Progressing)
m.SetString("warning", n.Warning)
return m.MapList()
}

Currently, with this config:

    notifications = {
        completed   = "${aws_sns_topic.rise_transcode_sns.arn}"
        error       = "${aws_sns_topic.rise_transcode_sns.arn}"
        progressing = ""
        warning     = ""
    }

This error occurs:

* aws_elastictranscoder_pipeline.rise_transcoder_pipeline: Error creating Elastic Transcoder Pipeline: ValidationException: [The "Progressing" field is not allowed to be null., The "Warning" field is not allowed to be null.]
    status code: 400, request id: ee0d3d7c-60b9-11e6-836a-1da35ca08e88`

Some extra context:

boto/boto#1315
aws/aws-sdk-net#322

@tecnobrat
Copy link
Author

tecnobrat commented Aug 12, 2016

Also appears after it failed to do the modification (the resource was previously created with the same arn for each notification type), it also saved the modified state file, even though it failed. So now the state file is inconsistent from the actual AWS settings

@catsby
Copy link
Member

catsby commented Aug 15, 2016

Thanks for writing in! This should be patched in #8207

@ghost
Copy link

ghost commented Apr 23, 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 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants