src/subnet_groups.js
function buildDAXSubnetGroup(numZones = 0, { name = 'DAXSubnetGroup' } = {}) {
  if (numZones < 1) {
    return {};
  }

  const subnetIds = [];
  for (let i = 1; i <= numZones; i += 1) {
    subnetIds.push({ Ref: `${DB_SUBNET}Subnet${i}` });
  }

  return {
    [name]: {
      Type: 'AWS::DAX::SubnetGroup',
      Properties: {
        SubnetGroupName: {
          Ref: 'AWS::StackName',
        },
        Description: {
          Ref: 'AWS::StackName',
        },
        SubnetIds: subnetIds,
      },
    },
  };
}
function buildDAXSubnetGroup(numZones = 0, { name = 'DAXSubnetGroup' } = {}) {
  if (numZones < 1) {
    return {};
  }

  const subnetIds = [];
  for (let i = 1; i <= numZones; i += 1) {
    subnetIds.push({ Ref: `${DB_SUBNET}Subnet${i}` });
  }

  return {
    [name]: {
      Type: 'AWS::DAX::SubnetGroup',
      Properties: {
        SubnetGroupName: {
          Ref: 'AWS::StackName',
        },
        Description: {
          Ref: 'AWS::StackName',
        },
        SubnetIds: subnetIds,
      },
    },
  };
}
function buildDAXSubnetGroup ( numZones = 0 , { name = 'DAXSubnetGroup' } = { } ) { if ( numZones < 1 ) { return { } ; } const subnetIds = [ ] ; for ( let i = 1 ; i <= numZones ; i += 1 ) { subnetIds . push ( { Ref : ` ${ DB_SUBNET } ${ i } ` } ) ; } return { [ name ] : { Type : 'AWS::DAX::SubnetGroup' , Properties : { SubnetGroupName : { Ref : 'AWS::StackName' , } , Description : { Ref : 'AWS::StackName' , } , SubnetIds : subnetIds , } , } , } ; }
Build an DAXSubnetGroup for a given number of zones

@param {Number} numZones Number of availability zones
@param {Object} params
@return {Object}
Build an DAXSubnetGroup for a given number of zones