async function getConfiguration()

in blogs/awsconfig-docdb/lib/functions/cluster-parameter-group-rule/index.js [23:33]


async function getConfiguration(resourceType, resourceId, configurationCaptureTime) {
  try {
    const laterTime = new Date(configurationCaptureTime);
    const data = await config.getResourceConfigHistory({ resourceType, resourceId, laterTime, limit: 1 }).promise();
    const configurationItem = data.configurationItems[0];
    return configurationItem;
  } catch (e) {
    console.log('There has been an error whil getting Resource Config History', e);
    throw e;
  }
}