View a markdown version of this page

IAM profile - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

IAM profile

You can configure a named profile to connect to Amazon Athena using the ODBC driver. You can use a named profile with one of the following credential sources:

  • Ec2InstanceMetadata – Retrieves credentials from the Amazon EC2 Instance Metadata Service (IMDS). Use this when running on an Amazon EC2 instance.

  • EcsContainer – Retrieves credentials from the Amazon ECS Task Role endpoint. Use this when running in an Amazon ECS container.

  • Environment – Retrieves credentials from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).

To use credential_source, also set role_arn in your Amazon profile configuration to the IAM role to assume. Set credential_source to the appropriate value for your environment. To use a custom credentials provider instead, set plugin_name in your profile configuration.

The profile provider reuses its current credentials while they remain valid. Open a new connection after changing the profile configuration.

Authentication type

Connection string name Parameter type Default value Connection string example
AuthenticationType Required IAM Credentials AuthenticationType=IAM Profile;

Amazon profile

The profile name to use for your ODBC connection. For more information about profiles, see Using named profiles in the Amazon Command Line Interface User Guide.

Connection string name Parameter type Default value Connection string example
AwsProfile Optional default AwsProfile=default;

Preferred role

The Amazon Resource Name (ARN) of the role to assume. The preferred role parameter is used when the custom credentials provider is specified by the plugin_name parameter in your profile configuration. For more information about ARN roles, see AssumeRole in the Amazon Security Token Service API Reference.

Connection string name Parameter type Default value Connection string example
preferred_role Optional none preferred_role=arn:aws:iam::123456789012:role/MyAthenaRole;

Session duration

The session duration in seconds for the custom provider selected by plugin_name. The driver does not assign a default to this profile parameter.

Connection string name Parameter type Default value Connection string example
duration Optional Not set duration=900;

Plugin name

Specifies a custom provider in a named profile. Supported values are AzureAD, BrowserAzureAD, Ping, ADFS, Okta, BrowserSAML, JWT, BrowserSSOOIDC, and External Credentials. Configure this parameter in the profile, rather than the connection string.

Connection string name Parameter type Default value Connection string example
plugin_name Optional none plugin_name=AzureAD;