Skip to content

Commit

Permalink
docs(quicksight): bucket manifest json example
Browse files Browse the repository at this point in the history
  • Loading branch information
GlennChia committed Feb 7, 2025
1 parent 7cffc32 commit 76cd612
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions website/docs/r/quicksight_data_source.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,33 @@ resource "aws_quicksight_data_source" "default" {

### S3 Data Source with IAM Role ARN

This example assumes that you have an S3 bucket `aws_s3_bucket.example` with an object `aws_s3_object.example` containing the manifest.json file.

```terraform
data "aws_caller_identity" "current" {}
data "aws_partition" "current" {}
data "aws_region" "current" {}
resource "aws_s3_bucket" "example" {
}
resource "aws_s3_object" "example" {
bucket = aws_s3_bucket.example.bucket
key = "manifest.json"
content = jsonencode({
fileLocations = [
{
URIPrefixes = [
"https://${aws_s3_bucket.example.id}.s3-${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}"
]
}
]
globalUploadSettings = {
format = "CSV"
delimiter = ","
textqualifier = "\""
containsHeader = true
}
})
}
resource "aws_iam_role" "example" {
name = "example"
Expand All @@ -53,7 +76,7 @@ resource "aws_iam_role" "example" {
}
Condition = {
StringEquals = {
"aws:SourceAccount" = "${data.aws_caller_identity.current.account_id}"
"aws:SourceAccount" = data.aws_caller_identity.current.account_id
}
}
}
Expand All @@ -76,7 +99,7 @@ resource "aws_iam_policy" "example" {
{
Action = ["s3:ListBucket"],
Effect = "Allow",
Resource = "${aws_s3_bucket.example.arn}"
Resource = aws_s3_bucket.example.arn
}
]
})
Expand Down

0 comments on commit 76cd612

Please sign in to comment.