forked from terraform-aws-modules/terraform-aws-alb
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from devops-workflow/master
Support multiple SSL certs for map-application
- Loading branch information
Showing
7 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ALB using HTTPS with multiple SSL certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
data "aws_vpc" "vpc" { | ||
tags { | ||
Env = "one" | ||
} | ||
} | ||
|
||
# Look up security group | ||
data "aws_subnet_ids" "public_subnet_ids" { | ||
vpc_id = "${data.aws_vpc.vpc.id}" | ||
|
||
tags { | ||
Network = "Public" | ||
} | ||
} | ||
|
||
data "aws_subnet_ids" "private_subnet_ids" { | ||
vpc_id = "${data.aws_vpc.vpc.id}" | ||
|
||
tags { | ||
Network = "Private" | ||
} | ||
} | ||
|
||
# | ||
module "lb-https" { | ||
source = "../../" | ||
name = "lb-https-multi" | ||
environment = "one" | ||
organization = "wiser" | ||
certificate_additional_names = ["*.one.wiser.com", "*.test.wiser.com"] | ||
certificate_name = "*.wiser.com" | ||
instance_http_ports = "" | ||
instance_https_ports = "443,8443" | ||
instance_tcp_ports = "" | ||
internal = false # PUBLIC | ||
lb_http_ports = "" | ||
lb_https_ports = "443,8443" | ||
lb_protocols = ["HTTPS"] | ||
lb_tcp_ports = "" | ||
ports = "3000,4000" | ||
security_groups = ["sg-bef0a5c2"] # PUBLIC -> use whitelist SG | ||
subnets = "${data.aws_subnet_ids.public_subnet_ids.ids}" # PUBLIC -> use public subnets | ||
vpc_id = "${data.aws_vpc.vpc.id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// | ||
// LB attributes | ||
// | ||
output "arn" { | ||
description = "ARN of the LB itself. Useful for debug output, for example when attaching a WAF." | ||
value = "${module.lb-https.arn}" | ||
} | ||
|
||
output "dns_name" { | ||
description = "The DNS name of the LB presumably to be used with a friendlier CNAME." | ||
value = "${module.lb-https.dns_name}" | ||
} | ||
|
||
output "id" { | ||
description = "The ID of the LB we created." | ||
value = "${module.lb-https.id}" | ||
} | ||
|
||
output "zone_id" { | ||
description = "The zone_id of the LB to assist with creating DNS records." | ||
value = "${module.lb-https.zone_id}" | ||
} | ||
|
||
# arn_suffix | ||
# canonical_hosted_zone_id | ||
|
||
// | ||
// LB Listener attributes | ||
// | ||
output "listener_http_arns" { | ||
description = "The ARNs of the HTTP LB Listeners" | ||
value = "${module.lb-https.listener_http_arns}" | ||
} | ||
|
||
output "listener_http_ids" { | ||
description = "The IDs of the HTTP LB Listeners" | ||
value = "${module.lb-https.listener_http_ids}" | ||
} | ||
|
||
output "listener_https_arns" { | ||
description = "The ARNs of the HTTPS LB Listeners" | ||
value = "${module.lb-https.listener_https_arns}" | ||
} | ||
|
||
output "listener_https_ids" { | ||
description = "The IDs of the HTTPS LB Listeners" | ||
value = "${module.lb-https.listener_https_ids}" | ||
} | ||
|
||
output "listener_tcp_arns" { | ||
description = "The ARNs of the network TCP LB Listeners" | ||
value = "${module.lb-https.listener_tcp_arns}" | ||
} | ||
|
||
output "listener_tcp_ids" { | ||
description = "The IDs of the network TCP LB Listeners" | ||
value = "${module.lb-https.listener_tcp_ids}" | ||
} | ||
|
||
output "listener_arns" { | ||
description = "ARNs of all the LB Listeners" | ||
value = "${module.lb-https.listener_arns}" | ||
} | ||
|
||
output "listener_ids" { | ||
description = "IDs of all the LB Listeners" | ||
value = "${module.lb-https.listener_ids}" | ||
} | ||
|
||
// | ||
// LB Target Group attributes | ||
// | ||
output "target_group_http_arns" { | ||
description = "ARNs of the HTTP target groups. Useful for passing to your Auto Scaling group module." | ||
value = "${module.lb-https.target_group_http_arns}" | ||
} | ||
|
||
output "target_group_https_arns" { | ||
description = "ARNs of the HTTPS target groups. Useful for passing to your Auto Scaling group module." | ||
value = "${module.lb-https.target_group_https_arns}" | ||
} | ||
|
||
output "target_group_tcp_arns" { | ||
description = "ARNs of the TCP target groups. Useful for passing to your Auto Scaling group module." | ||
value = "${module.lb-https.target_group_tcp_arns}" | ||
} | ||
|
||
output "target_group_arns" { | ||
description = "ARNs of all the target groups. Useful for passing to your Auto Scaling group module." | ||
value = "${module.lb-https.target_group_arns}" | ||
} | ||
|
||
output "target_group_http_ids" { | ||
description = "IDs of the HTTP target groups" | ||
value = "${module.lb-https.target_group_http_ids}" | ||
} | ||
|
||
output "target_group_https_ids" { | ||
description = "IDs of the HTTPS target groups" | ||
value = "${module.lb-https.target_group_https_ids}" | ||
} | ||
|
||
output "target_group_tcp_ids" { | ||
description = "IDs of the TCP target groups" | ||
value = "${module.lb-https.target_group_tcp_ids}" | ||
} | ||
|
||
output "target_group_ids" { | ||
description = "IDs of all the target groups" | ||
value = "${module.lb-https.target_group_ids}" | ||
} | ||
|
||
# arn_suffix | ||
# name | ||
|
||
// | ||
// Misc | ||
// | ||
output "principal_account_id" { | ||
description = "The AWS-owned account given permissions to write your LB logs to S3." | ||
value = "${module.lb-https.principal_account_id}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "aws" { | ||
region = "${var.region}" | ||
|
||
#version = "1.5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
variable "region" { | ||
default = "us-west-2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters