title: Automate AWS Quicksight Athena datasource creation with AWS SDK
body: <p>I am trying to create a datasource of type ATHENA in Quicksight using python aws sdk, but I get this error:</p>
  <blockquote>
  <p>botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the CreateDataSource operation: ATHENA source doesn't support CredentialPair authentication.</p>
  </blockquote>
  <p>Here is my code:</p>
  <pre><code>ds = qs.create_data_source(
      AwsAccountId=aws_account_id,
      DataSourceId=datasource_id,
      Name=datasource_name,
      Type=&quot;ATHENA&quot;,
      DataSourceParameters={
          &quot;AthenaParameters&quot;: {
              &quot;WorkGroup&quot;: workgroup
          }
      },
      Credentials={
          &quot;CredentialPair&quot;: {
              &quot;Username&quot;: username,
              &quot;Password&quot;: password,
              &quot;AlternateDataSourceParameters&quot;: [
                  {
                      &quot;AthenaParameters&quot;: {
                          &quot;WorkGroup&quot;: workgroup
                      }
                  }
              ]
          },
  
      }
  )
  </code></pre>
  <p>As per the <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/quicksight.html#QuickSight.Client.create_data_source" rel="nofollow noreferrer">create_data_source documentation</a>, &quot;<em>Currently, only credentials based on user name and password are supported.</em>&quot;, and ATHENA is supposed to be supported.</p>
  <p>Any idea what I may be missing?</p>