Skip to content

Commit

Permalink
Merge pull request #13 from toluna-terraform/stress_test_changes
Browse files Browse the repository at this point in the history
Update main.tf, appspec.json.tpl, and variables.tf
  • Loading branch information
Eli-Meitner authored Sep 1, 2022
2 parents f44f63c + f2483d7 commit d56753b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
locals {
image_uri = "${var.ecr_repo_url}:${var.from_env}"
artifacts_bucket_name = "s3-codepipeline-${var.app_name}-${var.env_type}"
run_tests = var.run_integration_tests || var.run_stress_tests ? true : false
}

module "ci-cd-code-pipeline" {
Expand Down Expand Up @@ -33,7 +34,7 @@ module "build" {
s3_bucket = local.artifacts_bucket_name
privileged_mode = true
environment_variables_parameter_store = var.environment_variables_parameter_store
environment_variables = merge(var.environment_variables, { APPSPEC = templatefile("${path.module}/templates/appspec.json.tpl", { APP_NAME = "${var.app_name}", ENV_TYPE = "${var.env_type}", HOOKS = var.run_integration_tests, PIPELINE_TYPE = var.pipeline_type})}) //TODO: try to replace with file
environment_variables = merge(var.environment_variables, { APPSPEC = templatefile("${path.module}/templates/appspec.json.tpl", { APP_NAME = "${var.app_name}", ENV_TYPE = "${var.env_type}", HOOKS = local.run_tests, PIPELINE_TYPE = var.pipeline_type})}) //TODO: try to replace with file
buildspec_file = templatefile("buildspec.yml.tpl",
{ APP_NAME = var.app_name,
ENV_TYPE = var.env_type,
Expand Down
2 changes: 1 addition & 1 deletion templates/appspec.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Hooks": [
%{ if HOOKS }
{
"AfterAllowTestTraffic": "${APP_NAME}-${ENV_TYPE}-test-framework"
"AfterAllowTestTraffic": "${APP_NAME}-${ENV_TYPE}-test-framework-manager"
},
%{ endif }
%{ if PIPELINE_TYPE != "dev" }
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ variable "run_integration_tests" {
default = false
}

variable "run_stress_tests" {
type = bool
default = false
}

variable "ecr_repo_url" {
type = string
}
Expand Down

0 comments on commit d56753b

Please sign in to comment.