Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik Sense documentation and resources.
Objective:
For this document, we will review how to setup a connection to an AWS S3 bucket using Qlik SaaS (Qlik Cloud Services and Qlik Sense Business).
AWS S3 Setup:
AWS IAM Configuration
Since Qlik SaaS uses IAM user accounts to connect to S3, we will create an IAM user who will have full control over the S3 bucket. An optional configuration will be outlined later which will create an IAM user who has only read rights to the bucket. This shows the ability of Qlik SaaS to inherit granular IAM rights to buckets. For example, creation of read and read / write users who are scoped to departments is possible an encouraged in Qlik SaaS.
AWS S3 Configuration
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<myIAMuser>"
]
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<myS3Bucket>"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<myIAMuser>"
},
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::<myS3Bucket>/*"
}
]
}
Qlik SaaS Configuration
In Qlik SaaS, users can create data connections in two places: inside of a Qlik app or in the Hub. For this guide, we will use the Hub option.
Alternative Policy Configuration
As mentioned above, with AWS's Policy flexibility, we can create custom policies on the bucket which give a low level of granular control over which user(s) can do which actions on which files.
To provide two examples of this flexibility:
Option 1 - Read-Only vs. Read/Write Access
This policy provides for separation of read and read/write activities:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<myReadUser>",
"arn:aws:iam::<myReadWriteUser>"
]
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<myS3Bucket>"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<myReadWriteUser>"
},
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::<myS3Bucket>/*"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<myReadUser>"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<myS3Bucket>/*"
}
]
}
Option 2 - Root User vs. Read-Only Line of Business / Project / Department
This policy provides for a read-only user who is scoped to purely a specific "folder" for a department / project / line of business:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<myReadOnlyDepartmentUser>",
"arn:aws:iam::<myRootUser>"
]
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<myS3Bucket>"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<myRootUser>"
},
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::<myS3Bucket>/*"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<myReadOnlyDepartmentUser>"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<myS3Bucket>/<myDepartmentFolder>/*"
}
]
}