lib/plugins/aws/customResources/resources/eventBridge/lib/eventBridge.js/updateTargetConfiguration
function updateTargetConfiguration(config) {
  const { lambdaArn, ruleName, eventBus, input, inputPath, inputTransformer, region } = config;
  const eventBridge = new EventBridge({ region });

  const EventBusName = getEventBusName(eventBus);

  let target = {
    Arn: lambdaArn,
    Id: `${ruleName}-target`,
  };

  if (input) {
    target = Object.assign(target, { Input: JSON.stringify(input) });
  } else if (inputPath) {
    target = Object.assign(target, { InputPath: inputPath });
  } else if (inputTransformer) {
    target = Object.assign(target, { InputTransformer: inputTransformer });
  }

  return removeTargetConfiguration(config).then(() =>
    eventBridge
      .putTargets({
        Rule: ruleName,
        EventBusName,
        Targets: [target],
      })
      .promise()
  );
}