Skip to content

Commit 8b88655

Browse files
committed
NRL-1188 fix tf plan errors
1 parent 3b35af9 commit 8b88655

File tree

7 files changed

+19
-11
lines changed

7 files changed

+19
-11
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ override.tf.json
4242
*_override.tf
4343
*_override.tf.json
4444

45+
# Ignore output of data object
46+
terraform/account-wide-infrastructure/modules/glue/files/src.zip
47+
4548
# Include override files you do wish to add to version control using negated pattern
4649
#
4750
# !example_override.tf
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module "dev-athena" {
2-
source = "../modules/athena"
3-
name_prefix = "nhsd-nrlf--dev"
2+
source = "../modules/athena"
3+
name_prefix = "nhsd-nrlf--dev"
4+
target_bucket_name = module.dev-glue.target_bucket_name
45
}

terraform/account-wide-infrastructure/modules/athena/athena.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "aws_athena_database" "reporting-db" {
22
name = var.database
33

4-
bucket = data.aws_s3_bucket.target-data-bucket.bucket
4+
bucket = var.target_bucket_name
55

66
# encryption_configuration {
77
# encryption_option = "SSE_KMS"

terraform/account-wide-infrastructure/modules/athena/s3.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,3 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "athena" {
5050
}
5151

5252
}
53-
54-
data "aws_s3_bucket" "target-data-bucket" {
55-
bucket = "${var.name_prefix}-target-data-bucket"
56-
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
variable "database" {
22
description = "What the db will be called"
3-
default = "NRL-Reporting"
3+
default = "nrl_reporting"
44
}
55

66
variable "name_prefix" {
77
type = string
88
description = "The prefix to apply to all resources in the module."
99
}
10+
11+
variable "target_bucket_name" {
12+
type = string
13+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "target_bucket_name" {
2+
description = "Name of destination bucket"
3+
value = aws_s3_bucket.target-data-bucket.id
4+
}

terraform/account-wide-infrastructure/modules/glue/s3.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ resource "aws_s3_bucket_public_access_block" "code-bucket-public-access-block" {
125125
restrict_public_buckets = true
126126
}
127127

128-
resource "aws_s3_bucket_object" "script" {
128+
resource "aws_s3_object" "script" {
129129
bucket = aws_s3_bucket.code-bucket.bucket
130130
key = "main.py"
131131
source = "${path.module}/src/main.py"
@@ -139,8 +139,8 @@ data "archive_file" "python" {
139139
source_dir = "${path.module}/src"
140140
}
141141

142-
resource "aws_s3_bucket_object" "zip" {
142+
resource "aws_s3_object" "zip" {
143143
bucket = aws_s3_bucket.code-bucket.bucket
144144
key = "main.py"
145-
source = data.archive_file.python
145+
source = "${path.module}/files/src.zip"
146146
}

0 commit comments

Comments
 (0)