我已经可以使用IAM Credentials
方法连接到Athena,但是现在我需要使用IAM Profile
身份验证方法,因为数据位于另一个Role
中。每次运行以下代码,我的R会话都会中断:
odbc::odbc(),
Driver = "Athena Driver",
S3OutputLocation = "S3OutputLocation",
AwsRegion = "eu-central-1",
AuthenticationType = "IAM Profile",
Schema = "historical_data",
AwsProfile = "AwsProfile",
Workgroup = "Workgroup"
)
我正在使用Simba
驱动程序,.ini
文件如下所示:
Trace=yes
[ODBC Data Sources]
Simba Athena=Simba Athena ODBC Driver
[Simba Athena]
# Description: DSN Description.
# This key is not necessary and is only to give a description of the data source.
Description=Simba Athena ODBC Driver DSN
# Driver: The location where the ODBC driver is installed to.
Driver=/Library/simba/athenaodbc/lib/libathenaodbc_sbu.dylib
# The DriverUnicodeEncoding setting is only used for SimbaDM
# When set to 1, SimbaDM runs in UTF-16 mode.
# When set to 2, SimbaDM runs in UTF-8 mode.
#DriverUnicodeEncoding=2
# Connection configurations should be set here.
AwsRegion=[REGION]
Schema=default
S3OutputLocation=[OUTPUT_S3_BUCKET]
### S3 Output Encryption Configurations.
## S3OutputEncOption default is empty indicating no encryption. Other valid values are SSE_S3, SSE_KMS and CSE_KMS.
## S3OutputEncKMSKey default is empty. This property is used if S3OutputEncOption is SSE_KMS or CSE_KMS.
# S3OutputEncOption=
# S3OutputEncKMSKey=
### Authentication related Configurations.
## The valid values for AuthenticationType are: Default, IAM Credentials, IAM Profile and Instance Profile.
## For Default and Instance Profile authentication nothing else need to be provided.
## When IAM Credentials is selected as authentication type, UID and PWD must be provided which correspond to
## IAM access key and secret key. SessionToken is optional, can be used when temporary security credentials are used.
## When IAM Profile is selected as authentication, user may provide a value for the optional AwsProfile property, if
## nothing is provided the default profile will be used to get the credentials.
## The default value for AuthenticationType is IAM Credentials.
AuthenticationType=[AUTHENTICATION_TYPE]
UID=[USERNAME]
PWD=[PASSWORD]
SessionToken=[SESSION_TOKEN]
AwsProfile=[AWS_PROFILE]
### Advanced Configurations
# StringColumnLength=255
# BinaryColumnLength=32767
# MaxCatalogNameLength = 0
# MaxSchemaNameLength = 256
# MaxTableNameLength = 0
# MaxColumnNameLength = 0
# UseSQLUnicodeTypes=0
# UseResultsetStreaming=1
## The default for RowsToFetchPerBlock is 10000 when UseResultsetStreaming is set
## to 1 whereas 1000 when UseResultsetStreaming is set to 0.
## While setting this option with a large value when using the result set streaming
## API can give you better fetch performance, it can also result in higher memory
## usage. This can be mitigated if the ODBC application can retrieve the result set
## from the driver quickly.
# RowsToFetchPerBlock=10000
### Proxy Configurations.
# Default value for proxy scheme is HTTP, valid values are HTTP and HTTPS.
# UseProxy=0
# ProxyScheme=HTTP
# ProxyHost=
# ProxyPort=8080
# ProxyUID=
# ProxyPWD=