envvar

package
v0.0.0-...-7000f67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: MPL-2.0

Index

Constants

View Source
const TestEnvVar = "TF_ACC"

Variables

View Source
var BillingAccountEnvVars = []string{
	"GOOGLE_BILLING_ACCOUNT",
}

This is the billing account that will be charged for the infrastructure used during testing. For that reason, it is also the billing account used for creating new projects.

View Source
var CredsEnvVars = []string{
	"GOOGLE_CREDENTIALS",
	"GOOGLE_CLOUD_KEYFILE_JSON",
	"GCLOUD_KEYFILE_JSON",
	"GOOGLE_APPLICATION_CREDENTIALS",
	"GOOGLE_USE_DEFAULT_CREDENTIALS",
}
View Source
var CustIdEnvVars = []string{
	"GOOGLE_CUST_ID",
}

This value is the Customer ID of the GOOGLE_ORG_DOMAIN workspace. See https://admin.google.com/ac/accountsettings when logged into an org admin for the value.

View Source
var FirestoreProjectEnvVars = []string{
	"GOOGLE_FIRESTORE_PROJECT",
}
View Source
var IdentityUserEnvVars = []string{
	"GOOGLE_IDENTITY_USER",
}

This value is the username of an identity account within the GOOGLE_ORG_DOMAIN workspace. For example in the org example.com with a user "foo@example.com", this would be set to "foo". See https://admin.google.com/ac/users when logged into an org admin for a list.

View Source
var MasterBillingAccountEnvVars = []string{
	"GOOGLE_MASTER_BILLING_ACCOUNT",
}

This is the billing account that will be modified to test billing-related functionality. It is expected to have more permissions granted to the test user and support subaccounts.

View Source
var OrgEnvDomainVars = []string{
	"GOOGLE_ORG_DOMAIN",
}
View Source
var OrgEnvVars = []string{
	"GOOGLE_ORG",
}
View Source
var OrgTargetEnvVars = []string{
	"GOOGLE_ORG_2",
}
View Source
var PapDescriptionEnvVars = []string{
	"GOOGLE_PUBLIC_AVERTISED_PREFIX_DESCRIPTION",
}

This value is the description used for test PublicAdvertisedPrefix setup to avoid required DNS setup. This is only used during integration tests and would be invalid to surface to users

View Source
var ProjectEnvVars = []string{
	"GOOGLE_PROJECT",
	"GCLOUD_PROJECT",
	"CLOUDSDK_CORE_PROJECT",
}
View Source
var ProjectNumberEnvVars = []string{
	"GOOGLE_PROJECT_NUMBER",
}
View Source
var RegionEnvVars = []string{
	"GOOGLE_REGION",
	"GCLOUD_REGION",
	"CLOUDSDK_COMPUTE_REGION",
}
View Source
var ServiceAccountEnvVars = []string{
	"GOOGLE_SERVICE_ACCOUNT",
}
View Source
var ZoneEnvVars = []string{
	"GOOGLE_ZONE",
	"GCLOUD_ZONE",
	"CLOUDSDK_COMPUTE_ZONE",
}

Functions

func GetTestBillingAccountFromEnv

func GetTestBillingAccountFromEnv(t *testing.T) string

This is the billing account that will be charged for the infrastructure used during testing. For that reason, it is also the billing account used for creating new projects.

func GetTestCredsFromEnv

func GetTestCredsFromEnv() string

AccTestPreCheck ensures at least one of the credentials env variables is set.

func GetTestCustIdFromEnv

func GetTestCustIdFromEnv(t *testing.T) string

func GetTestFirestoreProjectFromEnv

func GetTestFirestoreProjectFromEnv(t *testing.T) string

Firestore can't be enabled at the same time as Datastore, so we need a new project to manage it until we can enable Firestore programmatically.

func GetTestIdentityUserFromEnv

func GetTestIdentityUserFromEnv(t *testing.T) string

func GetTestMasterBillingAccountFromEnv

func GetTestMasterBillingAccountFromEnv(t *testing.T) string

This is the billing account that will be modified to test billing-related functionality. It is expected to have more permissions granted to the test user and support subaccounts.

func GetTestOrgDomainFromEnv

func GetTestOrgDomainFromEnv(t *testing.T) string

func GetTestOrgFromEnv

func GetTestOrgFromEnv(t *testing.T) string

Returns the raw organization id like 1234567890, skipping the test if one is not found.

func GetTestOrgTargetFromEnv

func GetTestOrgTargetFromEnv(t *testing.T) string

func GetTestProjectFromEnv

func GetTestProjectFromEnv() string

AccTestPreCheck ensures at least one of the project env variables is set.

func GetTestProjectNumberFromEnv

func GetTestProjectNumberFromEnv() string

AccTestPreCheck ensures at least one of the project env variables is set.

func GetTestPublicAdvertisedPrefixDescriptionFromEnv

func GetTestPublicAdvertisedPrefixDescriptionFromEnv(t *testing.T) string

func GetTestRegionFromEnv

func GetTestRegionFromEnv() string

AccTestPreCheck ensures at least one of the region env variables is set.

func GetTestServiceAccountFromEnv

func GetTestServiceAccountFromEnv(t *testing.T) string

func GetTestZoneFromEnv

func GetTestZoneFromEnv() string

func ServiceAccountCanonicalEmail

func ServiceAccountCanonicalEmail(account string) string

func SkipIfEnvNotSet

func SkipIfEnvNotSet(t *testing.T, envs ...string)

func UnsafeGetTestOrgFromEnv

func UnsafeGetTestOrgFromEnv() string

Alternative to GetTestOrgFromEnv that doesn't need *testing.T If using this, you need to process unset values at the call site

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL