Skip to content

Commit

Permalink
Get the sandbox account working
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktavious committed Nov 22, 2024
1 parent 41f9812 commit 0a181ae
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down
2 changes: 1 addition & 1 deletion modules/demo_account/rubric_gold.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
43 changes: 0 additions & 43 deletions workspace/.terraform.lock.hcl

This file was deleted.

5 changes: 5 additions & 0 deletions workspace/Readme.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 3 additions & 2 deletions workspace/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
9 changes: 9 additions & 0 deletions workspace/variables.tf
Original file line number Diff line number Diff line change
@@ -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."
}

0 comments on commit 0a181ae

Please sign in to comment.