Skip to content

Commit eb4fef1

Browse files
keymonstack72
authored andcommitted
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.
1 parent 05d44fa commit eb4fef1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

builtin/providers/aws/resource_aws_cloudwatch_event_rule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func buildPutRuleInputStruct(d *schema.ResourceData) *events.PutRuleInput {
213213
input.Description = aws.String(v.(string))
214214
}
215215
if v, ok := d.GetOk("event_pattern"); ok {
216-
input.EventPattern = aws.String(v.(string))
216+
input.EventPattern = aws.String(normalizeJson(v.(string)))
217217
}
218218
if v, ok := d.GetOk("role_arn"); ok {
219219
input.RoleArn = aws.String(v.(string))

0 commit comments

Comments
 (0)