Skip to content

Commit

Permalink
Add suffix random string on LBU_name
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Oct 2, 2024
1 parent 3aa9a0f commit c722ac7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/public_load_balancer/load_balancer.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "outscale_load_balancer" "my_public_lb" {
subregion_names = ["${var.region}a"]
load_balancer_name = "my-public-lb"
load_balancer_name = "my-lb-public${var.suffixe_lbu_name}"
listeners {
backend_port = 80
backend_protocol = "HTTP"
Expand Down
4 changes: 4 additions & 0 deletions examples/public_load_balancer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ variable "region" {}
variable "image_id" {}
variable "vm_type" {}
variable "vm_count" {}

variable "suffixe_lbu_name" {
type = string
}
4 changes: 2 additions & 2 deletions scripts/terraform-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ project_root=$(cd $project_dir/.. && pwd)
EXAMPLES_DIR=$project_root/examples

go build -o terraform-provider-outscale

export TF_VAR_suffixe_lbu_name=$((RANDOM%10000))
for f in $EXAMPLES_DIR/*
do
if [ -d $f ]
then
cd $f
VERSION_DIR=`grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*' outscale.tf`
INSTALL_DIR=$f/terraform.d/plugins/registry.terraform.io/outscale-dev/outscale/$VERSION_DIR/linux_amd64/
INSTALL_DIR=$f/terraform.d/plugins/registry.terraform.io/outscale/outscale/$VERSION_DIR/linux_amd64/
echo $INSTALL_DIR
mkdir -p $INSTALL_DIR
cp ../../terraform-provider-outscale $INSTALL_DIR
Expand Down

0 comments on commit c722ac7

Please sign in to comment.