src/nacl.js
function buildDBNetworkAcl(appSubnets = []) {
  if (!Array.isArray(appSubnets) || appSubnets.length < 1) {
    return {};
  }

  const resources = buildNetworkAcl(DB_SUBNET);

  appSubnets.forEach((subnet, index) => {
    Object.assign(
      resources,
      buildNetworkAclEntry(`${DB_SUBNET}NetworkAcl`, subnet, {
        RuleNumber: 100 + index,
      }),
      buildNetworkAclEntry(`${DB_SUBNET}NetworkAcl`, subnet, {
        RuleNumber: 100 + index,
        Egress: true,
      }),
      buildNetworkAclAssociation(DB_SUBNET, index + 1),
    );
  });

  return resources;
}
function buildDBNetworkAcl(appSubnets = []) {
  if (!Array.isArray(appSubnets) || appSubnets.length < 1) {
    return {};
  }

  const resources = buildNetworkAcl(DB_SUBNET);

  appSubnets.forEach((subnet, index) => {
    Object.assign(
      resources,
      buildNetworkAclEntry(`${DB_SUBNET}NetworkAcl`, subnet, {
        RuleNumber: 100 + index,
      }),
      buildNetworkAclEntry(`${DB_SUBNET}NetworkAcl`, subnet, {
        RuleNumber: 100 + index,
        Egress: true,
      }),
      buildNetworkAclAssociation(DB_SUBNET, index + 1),
    );
  });

  return resources;
}
function buildDBNetworkAcl ( appSubnets = [ ] ) { if ( ! Array . isArray ( appSubnets ) || appSubnets . length < 1 ) { return { } ; } const resources = buildNetworkAcl ( DB_SUBNET ) ; appSubnets . forEach ( ( subnet , index ) => { Object . assign ( resources , buildNetworkAclEntry ( ` ${ DB_SUBNET } ` , subnet , { RuleNumber : 100 + index , } ) , buildNetworkAclEntry ( ` ${ DB_SUBNET } ` , subnet , { RuleNumber : 100 + index , Egress : true , } ) , buildNetworkAclAssociation ( DB_SUBNET , index + 1 ) , ) ; } ) ; return resources ; }
Build the Database Network ACL

@param {Array} appSubnets Array of application subnets
Build the Database Network ACL