aws provider: normalize json of cloudwatch event_pattern
Normalise the event_pattern of the aws_cloudwatch_event_rule resource before uploading it to AWS. AWS seems to accept a event_pattern with a JSON with new lines, but then the rule does not seem to work. Creating the rule in the AWS console works, but will setup the pattern as a json without newlines or spaces, and display a formatted JSON.
This commit is contained in:
parent
05d44fa8e0
commit
eb4fef1ca1
|
@ -213,7 +213,7 @@ func buildPutRuleInputStruct(d *schema.ResourceData) *events.PutRuleInput {
|
|||
input.Description = aws.String(v.(string))
|
||||
}
|
||||
if v, ok := d.GetOk("event_pattern"); ok {
|
||||
input.EventPattern = aws.String(v.(string))
|
||||
input.EventPattern = aws.String(normalizeJson(v.(string)))
|
||||
}
|
||||
if v, ok := d.GetOk("role_arn"); ok {
|
||||
input.RoleArn = aws.String(v.(string))
|
||||
|
|
Loading…
Reference in New Issue