File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
examples/alb_test_fixture Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ provider "aws" {
77 region = " ${ var . region } "
88}
99
10+ resource "random_id" "alb_name_suffix" {
11+ byte_length = 16
12+ }
13+
1014resource "aws_iam_server_certificate" "fixture_cert" {
1115 name = " test_cert-${ data . aws_caller_identity . current . account_id } -${ data . aws_region . current . name } "
1216 certificate_body = " ${ file (" ${ path . module } /../../examples/alb_test_fixture/certs/example.crt.pem" )} "
@@ -56,7 +60,7 @@ module "security_group" {
5660
5761module "alb" {
5862 source = " ../.."
59- load_balancer_name = " test-alb"
63+ load_balancer_name = " test-alb- ${ random_id . alb_name_suffix . hex } "
6064 load_balancer_security_groups = [" ${ module . security_group . this_security_group_id } " ]
6165 log_bucket_name = " ${ aws_s3_bucket . log_bucket . id } "
6266 log_location_prefix = " ${ var . log_location_prefix } "
Original file line number Diff line number Diff line change 1- locals {
2- prefix_length = " ${ length (var. load_balancer_name ) < 6 ? length (var. load_balancer_name ) : 6 } "
3- name_prefix = " ${ substr (var. load_balancer_name , 0 , local. prefix_length )} "
4- }
5-
61resource "aws_lb" "application" {
72 load_balancer_type = " application"
8- name_prefix = " ${ local . name_prefix } "
3+ name = " ${ var . load_balancer_name } "
94 internal = " ${ var . load_balancer_is_internal } "
105 security_groups = [" ${ var . load_balancer_security_groups } " ]
116 subnets = [" ${ var . subnets } " ]
You can’t perform that action at this time.
0 commit comments