File tree Expand file tree Collapse file tree 7 files changed +19
-11
lines changed
terraform/account-wide-infrastructure Expand file tree Collapse file tree 7 files changed +19
-11
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11module "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}
Original file line number Diff line number Diff line change 11resource "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"
Original file line number Diff line number Diff 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- }
Original file line number Diff line number Diff line change 11variable "database" {
22 description = " What the db will be called"
3- default = " NRL-Reporting "
3+ default = " nrl_reporting "
44}
55
66variable "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+ }
Original file line number Diff line number Diff line change 1+ output "target_bucket_name" {
2+ description = " Name of destination bucket"
3+ value = aws_s3_bucket. target-data-bucket . id
4+ }
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments