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 5d0d3a7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 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
}
2 changes: 1 addition & 1 deletion examples/public_vm/outscale.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
outscale = {
source = "outscale/outscale"
version = "1.0.0-rc.1"
version = ">= 0.11.0"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/terraform-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ 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
3 changes: 2 additions & 1 deletion scripts/tofu-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ 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/providers/registry.opentofu.org/outscale/outscale/$VERSION_DIR/linux_amd64/
INSTALL_DIR=$f/terraform.d/plugins/registry.opentofu.org/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 5d0d3a7

Please sign in to comment.