# EC2MultiRegionTranslator

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="index.html">policies/addressResolution</a>~</span>EC2MultiRegionTranslator<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>AddressTranslator implementation for multi-region EC2 deployments <strong>where clients are also deployed in EC2</strong>.</p>
<p>Its distinctive feature is that it translates addresses according to the location of the Cassandra host:</p>
<ul>
<li>addresses in different EC2 regions (than the client) are unchanged</li>
<li>addresses in the same EC2 region are <strong>translated to private IPs</strong></li>
</ul>
<p>This optimizes network costs, because Amazon charges more for communication over public IPs.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="EC2MultiRegionTranslator"><span class="type-signature"></span>new EC2MultiRegionTranslator<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/address-resolution.ts#L63" target="_blank" rel="noopener">policies/address-resolution.ts, line 63</a></p></div>




















    
    

    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="logError"><span class="type-signature"></span>logError<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Log method called to log errors that occurred while performing dns resolution.
You can assign your own method to the class instance to do proper logging.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/address-resolution.ts#L119" target="_blank" rel="noopener">policies/address-resolution.ts, line 119</a></p></div>




















        
            

    

    
    <h4 class="name" id="translate"><span class="type-signature"></span>translate<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Addresses in the same EC2 region are translated to private IPs and addresses in
different EC2 regions (than the client) are unchanged</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/address-resolution.ts#L71" target="_blank" rel="noopener">policies/address-resolution.ts, line 71</a></p></div></div>
