Skip to content

Commit

Permalink
feat(gcp): Added Org ID value for terratest GCP (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
horiagunica authored Feb 24, 2025
1 parent b2c15ad commit 90e07b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/testskeleton/testskeleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type TerraformVarsInfo struct {
AzureResourceGroupName string
AzureStorageAccountName string
GoogleProjectId string
GoogleOrgId string
}

// Function that generates and returns information used by Terraform TFVARS.
Expand Down Expand Up @@ -100,6 +101,7 @@ func GenerateTerraformVarsInfo(cloud string) (TerraformVarsInfo, error) {
}
} else if cloud == "gcp" {
projectId := os.Getenv("PROJECT_ID")
orgId := os.Getenv("ORG_ID")
if prid != "" {
prid = fmt.Sprintf("p%s", prid)
} else {
Expand All @@ -109,6 +111,7 @@ func GenerateTerraformVarsInfo(cloud string) (TerraformVarsInfo, error) {
names = TerraformVarsInfo{
NamePrefix: fmt.Sprintf("ghci%s%s-", prid, prefixId),
GoogleProjectId: projectId,
GoogleOrgId: orgId,
}
} else {
// If no cloud is provided - throw an error
Expand Down

0 comments on commit 90e07b1

Please sign in to comment.