Skip to content

Commit 705c51f

Browse files
committed
permissions for reading our bucket
1 parent e196294 commit 705c51f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

docker/info-event.tftpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"userIdentity": {
1010
"principalId": "AWS:AIDAINPONIXQXHT3IKHL2"
1111
},
12-
"requestParameters": {
12+
"requestParameters": {
1313
"sourceIPAddress": "205.255.255.255"
1414
},
1515
"responseElements": {
@@ -20,7 +20,7 @@
2020
"s3SchemaVersion": "1.0",
2121
"configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1",
2222
"bucket": {
23-
"name": "${bucket}",
23+
"name": "${ bucket}",
2424
"ownerIdentity": {
2525
"principalId": "A3I5XTEXAMAI3E"
2626
},

terraform/resources/roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ data "aws_iam_policy_document" "iam_for_lambda_policy_document" {
3838
"s3:DeleteObject",
3939
]
4040
effect = "Allow"
41-
resources = [aws_s3_bucket.storage.arn]
41+
resources = [aws_s3_bucket.storage.arn,"${aws_s3_bucket.storage.arn}/*"]
4242
sid = "ReadS3"
4343
}
4444

terraform/resources/storage.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,16 @@ output "bucket" {
3636

3737
locals {
3838
our_rendered_content = templatefile("${path.root}/../docker/info-event.tftpl", {bucket = aws_s3_bucket.storage.bucket})
39+
triggers = {
40+
template_file = md5(file("${path.root}/../docker/info-event.tftpl"))
41+
}
3942
}
4043

4144
resource "null_resource" "local" {
4245
triggers = {
4346
template = local.our_rendered_content
4447
}
4548

46-
depends_on = [
47-
aws_s3_bucket.storage,
48-
]
49-
5049
# Render to local file on machine
5150
# https://github.com/hashicorp/terraform/issues/8090#issuecomment-291823613
5251
provisioner "local-exec" {

0 commit comments

Comments
 (0)