Skip to content

Commit 6305a54

Browse files
Merge pull request #36 from bcgov/upload-qrreporrts-s3
put back code to store qr reports to s3
2 parents e48e238 + c44ccee commit 6305a54

File tree

1 file changed

+8
-0
lines changed
  • terraform/operations-account

1 file changed

+8
-0
lines changed

terraform/operations-account/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ locals {
3232
app_name = "octk-aws-sea-billing-reports"
3333
}
3434

35+
resource "aws_s3_bucket" "quarterly_reports_bucket" {
36+
bucket = "bcgov-quarterly-reports-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}"
37+
}
3538
resource "aws_ses_email_identity" "source_email_address" {
3639
email = "info@cloud.gov.bc.ca"
3740
}
@@ -125,6 +128,7 @@ resource "aws_iam_policy" "ecs_task_access_policies" {
125128
Effect = "Allow",
126129
Action = [
127130
"s3:Get*",
131+
"s3:PutObject",
128132
"s3:List*"
129133
],
130134
Resource = ["*"] // TODO: Too relaxed. Need to revise for LZ deployment
@@ -653,6 +657,10 @@ resource "aws_cloudwatch_event_target" "billing_reports_quarterly_target" {
653657
{
654658
"name" = "CMK_SSE_KMS_ALIAS"
655659
"value" = "arn:aws:kms:ca-central-1:${var.lz_mgmt_account_id}:alias/BCGov-BillingReports"
660+
},
661+
{
662+
"name" = "QR_S3_Bucket"
663+
"value" = "${aws_s3_bucket.quarterly_reports_bucket.bucket}"
656664
}
657665
],
658666
}]

0 commit comments

Comments
 (0)