title: Quicksight Dashboard Embed url showing us-east-1 not eu-west-1
body: <h3>Problem:</h3>
  
  <p>I want to programmatically fetch a quicksight dashboard URL through the SDK, (dashboard in region: eu-west-1) however whenever I use the following regions I get the following errors when I use the following regions:</p>
  
  <ul>
  <li><strong>eu-west-1</strong>: Error: <code>Operation is being called from endpoint eu-west-1, but your identity region is us-east-1. Please use the us-east-1 endpoint.</code></li>
  <li><strong>us-east-1</strong>: No error, but the embed url is us-east-1 and results in a <code>us-east-1.quicksight.aws.amazon.com refused to connect</code> error in the browser, eg: <a href="https://us-east-1.quicksight.aws.amazon.com/embed/XXXXXX&amp;identityprovider=quicksight&amp;isauthcode=true" rel="noreferrer">https://us-east-1.quicksight.aws.amazon.com/embed/XXXXXX&amp;identityprovider=quicksight&amp;isauthcode=true</a>',</li>
  </ul>
  
  <h3>Example Code:</h3>
  
  <p><em>Note: Credentials added for brevity, but are loaded from profile. Have also tried in Java SDK.</em></p>
  
  <pre><code>const AWS = require('aws-sdk')
  const dotenv = require('dotenv').config()
  
  const init = async () =&gt; {
    AWS.config.credentials = {accessKeyId: process.env.ACCESS_KEY_ID, secretAccessKey: process.env.SECRET_ACCESS_KEY}
    AWS.config.region = 'us-east-1'
    // AWS.config.region = 'eu-west-1'
  
    const quicksight = new AWS.QuickSight()
  
    const embedUrlParams = {
      AwsAccountId: '111122223333',
      DashboardId: '11111111-2222-3333-4444-555555555555',
      IdentityType: 'QUICKSIGHT',
      UserArn: 'arn:aws:quicksight:us-east-1:111122223333:user/default/quicksight-user-1111'
    }
    const embedUrlRes = await quicksight.getDashboardEmbedUrl(embedUrlParams).promise()
    console.log('embedUrlRes', embedUrlRes)
  }
  
  init()
  </code></pre>
  
  <h3>CLI:</h3>
  
  <p>When I envoke exactly the same through CLI, eg:</p>
  
  <p><code>aws quicksight get-dashboard-embed-url --aws-account-id 111122223333 --dashboard-id 11111111-2222-3333-4444-555555555555 --identity-type QUICKSIGHT --user-arn "arn:aws:quicksight:us-east-1:111122223333:user/default/quicksight-user-1111" --profile my-quicksight-profile</code></p>
  
  <p>I get the a perfectly valid embed url in eu-west-1 that embeds perfect through the browser:</p>
  
  <p><code>https://eu-west-1.quicksight.aws.amazon.com/embed/XXXXXXXX&amp;identityprovider=quicksight&amp;isauthcode=true</code></p>
  
  <h3>So:</h3>
  
  <p>I imaging that the SDK is not behaving as the CLI is in the respect of assuming roles, but I've tried this with little success, as well as pointing to quicksight regional endpoints.</p>
  
  <p>Before I go down the rabbit hole, it would be good to see if anyone has experienced the same and how they resolved it.</p>
  
  <p>Thanks!</p>