func buildPutRuleInputStruct(d *schema.ResourceData) (*events.PutRuleInput, error) { input := events.PutRuleInput{ Name: aws.String(d.Get("name").(string)), } if v, ok := d.GetOk("description"); ok { input.Description = aws.String(v.(string)) } if v, ok := d.GetOk("event_pattern"); ok { pattern, err := normalizeJsonString(v) if err != nil { return nil, errwrap.Wrapf("event pattern contains an invalid JSON: {{err}}", err) } input.EventPattern = aws.String(pattern) } if v, ok := d.GetOk("role_arn"); ok { input.RoleArn = aws.String(v.(string)) } if v, ok := d.GetOk("schedule_expression"); ok { input.ScheduleExpression = aws.String(v.(string)) } input.State = aws.String(getStringStateFromBoolean(d.Get("is_enabled").(bool))) return &input, nil }
func buildPutRuleInputStruct(d *schema.ResourceData) *events.PutRuleInput { input := events.PutRuleInput{ Name: aws.String(d.Get("name").(string)), } if v, ok := d.GetOk("description"); ok { input.Description = aws.String(v.(string)) } if v, ok := d.GetOk("event_pattern"); ok { input.EventPattern = aws.String(normalizeJson(v.(string))) } if v, ok := d.GetOk("role_arn"); ok { input.RoleArn = aws.String(v.(string)) } if v, ok := d.GetOk("schedule_expression"); ok { input.ScheduleExpression = aws.String(v.(string)) } input.State = aws.String(getStringStateFromBoolean(d.Get("is_enabled").(bool))) return &input }