Skip to content

Commit 53acc81

Browse files
committed
[NRL-1386] Rename ec2 module, add toggle for powerbi gw deploy.
1 parent cfa08a5 commit 53acc81

File tree

15 files changed

+72
-43
lines changed

15 files changed

+72
-43
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module "vpc" {
2+
count = var.enable_powerbi_auto_push ? 1 : 0
23
source = "../modules/vpc"
34
vpc_cidr_block = var.vpc_cidr_block
45
enable_dns_hostnames = var.enable_dns_hostnames
@@ -8,16 +9,17 @@ module "vpc" {
89
name_prefix = "nhsd-nrlf--dev"
910
}
1011

11-
module "powerbi_gw_instance_v2" {
12-
source = "../modules/ec2"
13-
use_custom_ami = true
14-
instance_type = var.instance_type
12+
module "powerbi_gw_instance" {
13+
count = var.enable_powerbi_auto_push ? 1 : 0
14+
source = "../modules/powerbi-gw-ec2"
15+
use_custom_ami = var.use_powerbi_gw_custom_ami
16+
instance_type = var.powerbi_gw_instance_type
1517
name_prefix = "nhsd-nrlf--dev-powerbi-gw-v2"
1618
target_bucket_arn = module.dev-glue.target_bucket_arn
1719
glue_kms_key_arn = module.dev-glue.aws_kms_key_arn
1820
athena_kms_key_arn = module.dev-athena.kms_key_arn
1921
athena_bucket_arn = module.dev-athena.bucket_arn
2022

21-
subnet_id = module.vpc.private_subnet_id
22-
security_groups = [module.vpc.powerbi_gw_security_group_id]
23+
subnet_id = module.vpc[0].private_subnet_id
24+
security_groups = [module.vpc[0].powerbi_gw_security_group_id]
2325
}

terraform/account-wide-infrastructure/dev/vars.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,20 @@ variable "vpc_private_subnets_cidr_block" {
4444
default = "10.0.1.0/24"
4545
}
4646

47-
variable "instance_type" {
47+
variable "enable_powerbi_auto_push" {
48+
type = bool
49+
description = "Enable automatic pushing of info into PowerBI"
50+
default = false
51+
}
52+
53+
variable "powerbi_gw_instance_type" {
4854
type = string
49-
description = "Type for EC2 Instance"
55+
description = "Type for PowerBI GW EC2 Instance"
5056
default = "t2.micro"
5157
}
5258

53-
variable "use_custom_ami" {
59+
variable "use_powerbi_gw_custom_ami" {
5460
type = bool
55-
description = "Use custom image"
56-
default = false
61+
description = "Use custom image for PowerBI GW instance"
62+
default = true
5763
}

terraform/account-wide-infrastructure/modules/ec2/data.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/data.tf

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/ec2.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/ec2.tf

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/iam.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/iam.tf

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/locals.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/locals.tf

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/outputs.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/outputs.tf

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/scripts/user_data.tpl renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/scripts/user_data.tpl

File renamed without changes.

terraform/account-wide-infrastructure/modules/ec2/vars.tf renamed to terraform/account-wide-infrastructure/modules/powerbi-gw-ec2/vars.tf

File renamed without changes.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ resource "aws_route_table" "private_rt" {
5555
}
5656

5757
resource "aws_eip" "natgw-ip" {
58-
domain = "vpc"
5958
}
6059

6160
resource "aws_nat_gateway" "nat" {

0 commit comments

Comments
 (0)