From 8db9efdc18d63324627527bdb72f698ca2f2f85a Mon Sep 17 00:00:00 2001 From: Sergey Novikov Date: Thu, 7 Nov 2024 18:54:43 +0100 Subject: [PATCH] OPS-6304 Radomize job name for examples --- examples/titan/README.md | 3 +++ examples/titan/main.tf | 7 ++++++- examples/titan/versions.tf | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/titan/README.md b/examples/titan/README.md index 4a0cb82..1afe8de 100644 --- a/examples/titan/README.md +++ b/examples/titan/README.md @@ -7,12 +7,14 @@ |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | | [aws](#requirement\_aws) | ~> 5.73 | +| [random](#requirement\_random) | ~> 3.6 | ## Providers | Name | Version | |------|---------| | [aws](#provider\_aws) | ~> 5.73 | +| [random](#provider\_random) | ~> 3.6 | ## Modules @@ -30,6 +32,7 @@ | [aws_s3_bucket.output](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | [aws_s3_bucket.training](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | [aws_s3_object.data](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object) | resource | +| [random_string.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | | [aws_iam_policy_document.s3_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | | [aws_iam_policy_document.trust_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | diff --git a/examples/titan/main.tf b/examples/titan/main.tf index a3c3530..e1fa19d 100644 --- a/examples/titan/main.tf +++ b/examples/titan/main.tf @@ -64,11 +64,16 @@ resource "aws_s3_object" "data" { source = "train.jsonl" } +resource "random_string" "this" { + length = 16 + special = false +} + module "model" { source = "../../" name = "titan" - job_name = "titan-job-1" + job_name = "titan-job-${random_string.this.result}" foundation_model_id = "amazon.titan-text-express-v1" model_role_arn = aws_iam_role.this.arn diff --git a/examples/titan/versions.tf b/examples/titan/versions.tf index 74007d0..eb7034d 100644 --- a/examples/titan/versions.tf +++ b/examples/titan/versions.tf @@ -5,5 +5,9 @@ terraform { source = "hashicorp/aws" version = "~> 5.73" } + random = { + source = "hashicorp/random" + version = "~> 3.6" + } } }