diff --git a/.gitignore b/.gitignore index b4fef2e..f261b7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ # Local .terraform directories -**/.terraform/* +workspace/.terraform/* # .tfstate files **/*.tfstate* -**/.terraform.lock.hcl +workspace/.terraform.lock.hcl # Crash log files crash.log diff --git a/Taskfile.yml b/Taskfile.yml index 04c9051..ada2b46 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -43,7 +43,9 @@ tasks: TF_VAR_user_email: sh: echo "$PAYLOAD" | jq -r '.user_email' cmds: - - task: init-and-apply + - task: install-terraform + - "terraform -chdir={{.WORKSPACE_DIR}} init --upgrade" + - "terraform -chdir={{.WORKSPACE_DIR}} apply {{.CLI_ARGS}}" destroy: desc: Run "terraform destroy" in "{{.WORKSPACE_DIR}}" diff --git a/modules/demo_account/rubric_gold.tf b/modules/demo_account/rubric_gold.tf index f2ebb86..bd68097 100644 --- a/modules/demo_account/rubric_gold.tf +++ b/modules/demo_account/rubric_gold.tf @@ -83,7 +83,7 @@ module "github_check_package_version" { package_constraint = "matches_version" package_manager = "github" - package_name = "action/checkout" + package_name = "actions/checkout" missing_package_result = "passed" version_constraint_predicate = { type = "matches_regex" diff --git a/workspace/.terraform.lock.hcl b/workspace/.terraform.lock.hcl deleted file mode 100644 index 4fab8e0..0000000 --- a/workspace/.terraform.lock.hcl +++ /dev/null @@ -1,43 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/random" { - version = "3.6.3" - hashes = [ - "h1:f6jXn4MCv67kgcofx9D49qx1ZEBv8oyvwKDMPBr0A24=", - "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451", - "zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8", - "zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe", - "zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1", - "zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36", - "zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30", - "zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615", - "zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad", - "zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556", - "zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0", - ] -} - -provider "registry.terraform.io/opslevel/opslevel" { - version = "1.2.7" - constraints = "1.2.7" - hashes = [ - "h1:BJIrazDC7vtfubkQS5MQ/0DPwNoA09ILrEoAk+h0tVo=", - "zh:029eba5650fa518f835814a9b2561bbf16366e9c7cd667ba5147d4b63b897264", - "zh:21c2c408dc74fdbdd6cf83aaa259ed07cb8f11c9787c1c5c21dbce2fccb4daf5", - "zh:261b89ddc22fc792a6a9332a045be00d414ade4f37e6934f3db4353a94247e52", - "zh:3fcbef0d3d698fc7770864a655307ca7ddf498397b4cfa371041d648bd3c15f7", - "zh:42630898a93de50595f0fa195ce0113c6da43fce21c3c653262c883a0a8b5b2d", - "zh:5bc16622777e42595b7485731718f857904e4270df7468396ce2b5c9da58b338", - "zh:6430c1e31b72e6a1bfc1af533ae9a1f726f117919168524b84cf125759dea6d1", - "zh:64d76cf5753c67b4d80f824afcf516559e77898f1accf894bf168f4699c93d3d", - "zh:723f7340fda53e0d21df8beed693676390d39d3067fc6929370b38361a83eaa0", - "zh:846047e59994123b44a95f1952b2da0549190cb4d3519b55c9286e40cbdd2942", - "zh:9cd0fd174e88a513718f1700391a1f755596ea0a10151f2fe62f85cf5dca57df", - "zh:c7720ee3d17a1b79bdbd2b7abfe4c1f8945aaf305db1b09ef8fd50c0c281b62d", - "zh:dda8110a68aa09910d3315b80e57cf9f5899b8e0d24388cfa4c123bf9780fd6f", - "zh:e65d9e71a8dc0a55a45218622d93ceac4babac6e83f2a7fa814edd50436ffeeb", - ] -} diff --git a/workspace/Readme.md b/workspace/Readme.md new file mode 100644 index 0000000..5a6868d --- /dev/null +++ b/workspace/Readme.md @@ -0,0 +1,5 @@ +# Demo Accounts Tools + +This folder contains the setup and configuration files for building out demo accounts. + +It is used by the `task apply-demo` to create demo accounts for the OpsLevel custom action. diff --git a/workspace/main.tf b/workspace/main.tf index 6313be1..53a583c 100644 --- a/workspace/main.tf +++ b/workspace/main.tf @@ -4,7 +4,8 @@ provider "opslevel" { module "account" { source = "../modules/demo_account" - # account_token = "" - # account_name = "Demo Account" + account_token = var.account_token + account_name = "Big River Books" + account_users = [var.user_email] #generate_services = 500 # Due note that due to API rate limits generating 500 services will take upwards of 10 mins and will significantly increase the time of future apply operations } \ No newline at end of file diff --git a/workspace/variables.tf b/workspace/variables.tf new file mode 100644 index 0000000..f55d321 --- /dev/null +++ b/workspace/variables.tf @@ -0,0 +1,9 @@ +variable "account_token" { + description = "The token for the account." + type = string + sensitive = true +} + +variable "user_email" { + description = "The email address of the user to invite to this demo account." +}