acc

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const AwsProviderVersion = "5.1.0"
View Source
const (
	PrefixProjectKeep = prefixProject + "-keep"
)
View Source
const (
	// Provider name for single configuration testing
	ProviderNameMongoDBAtlas = "mongodbatlas"
)

Variables

View Source
var (
	ClusterTagsMap1 = map[string]string{
		"key":   "key 1",
		"value": "value 1",
	}

	ClusterTagsMap2 = map[string]string{
		"key":   "key 2",
		"value": "value 2",
	}

	ClusterTagsMap3 = map[string]string{
		"key":   "key 3",
		"value": "value 3",
	}
)
View Source
var MongoDBClient *config.MongoDBClient

MongoDBClient is used to configure client required for Framework-based acceptance tests.

View Source
var TestAccProviderV6Factories map[string]func() (tfprotov6.ProviderServer, error)

TestAccProviderV6Factories is used in all tests for ProtoV6ProviderFactories.

Functions

func AddAttrChecks added in v1.15.3

func AddAttrChecks(targetName string, checks []resource.TestCheckFunc, mapChecks map[string]string) []resource.TestCheckFunc

func AddAttrSetChecks added in v1.15.3

func AddAttrSetChecks(targetName string, checks []resource.TestCheckFunc, attrNames ...string) []resource.TestCheckFunc

func CheckDestroyCluster added in v1.15.2

func CheckDestroyCluster(s *terraform.State) error

func CheckDestroyFederatedDatabaseInstance

func CheckDestroyFederatedDatabaseInstance(s *terraform.State) error

func CheckDestroyNetworkPeering

func CheckDestroyNetworkPeering(s *terraform.State) error

func CheckDestroyOrgInvitation

func CheckDestroyOrgInvitation(s *terraform.State) error

func CheckDestroyProject

func CheckDestroyProject(s *terraform.State) error

func CheckDestroySearchIndex

func CheckDestroySearchIndex(state *terraform.State) error

func CheckDestroyStreamInstance

func CheckDestroyStreamInstance(state *terraform.State) error

func CheckDestroyTeam

func CheckDestroyTeam(s *terraform.State) error

func ConfigClusterGlobal

func ConfigClusterGlobal(resourceName, projectID, name, backupEnabled string) string

func ConfigDatabaseUserBasic

func ConfigDatabaseUserBasic(projectID, username, roleName, keyLabel, valueLabel string) string

func ConfigDatabaseUserWithAWSIAMType

func ConfigDatabaseUserWithAWSIAMType(projectID, username, roleName, keyLabel, valueLabel string) string

func ConfigDatabaseUserWithLDAPAuthType

func ConfigDatabaseUserWithLDAPAuthType(projectID, username, roleName, keyLabel, valueLabel string) string

func ConfigDatabaseUserWithLabels

func ConfigDatabaseUserWithLabels(projectID, username, roleName string, labels []admin.ComponentLabel) string

func ConfigDatabaseUserWithRoles

func ConfigDatabaseUserWithRoles(projectID, username, password string, rolesArr []*admin.DatabaseUserRole) string

func ConfigDatabaseUserWithScopes

func ConfigDatabaseUserWithScopes(projectID, username, password, roleName string, scopesArr []*admin.UserScope) string

func ConfigDatabaseUserWithX509Type

func ConfigDatabaseUserWithX509Type(projectID, username, x509Type, roleName, keyLabel, valueLabel string) string

func ConfigProjectWithSettings added in v1.15.0

func ConfigProjectWithSettings(projectName, orgID, projectOwnerID string, value bool) string

func ConfigServerlessInstanceBasic

func ConfigServerlessInstanceBasic(orgID, projectName, name string, ignoreConnectionStrings bool) string

func ConfigServerlessInstanceWithTags

func ConfigServerlessInstanceWithTags(orgID, projectName, name string, tags []admin.ResourceTag) string

func Conn added in v1.15.0

func Conn() *matlas.Client

func ConnV2 added in v1.15.0

func ConnV2() *admin.APIClient

func ConnV2UsingProxy added in v1.15.3

func ConnV2UsingProxy(proxyPort *int) *admin.APIClient

func DebugPlan

func DebugPlan() plancheck.PlanCheck

func ExistingClusterUsed added in v1.15.2

func ExistingClusterUsed() bool

func ExternalProviders added in v1.15.0

func ExternalProviders(versionAtlasProvider string) map[string]resource.ExternalProvider

func ExternalProvidersOnlyAWS added in v1.15.0

func ExternalProvidersOnlyAWS() map[string]resource.ExternalProvider

func ExternalProvidersWithAWS added in v1.15.0

func ExternalProvidersWithAWS(versionAtlasProvider string) map[string]resource.ExternalProvider

func GetProjectTeamsIDsWithPos added in v1.15.2

func GetProjectTeamsIDsWithPos(pos int) string

func ImportStateClusterIDFunc

func ImportStateClusterIDFunc(resourceName string) resource.ImportStateIdFunc

func ImportStateProjectIDFunc

func ImportStateProjectIDFunc(resourceName string) resource.ImportStateIdFunc

func InCI added in v1.15.3

func InCI() bool

func InUnitTest added in v1.15.2

func InUnitTest() bool

func IntGreatThan

func IntGreatThan(value int) resource.CheckResourceAttrWithFunc

func JSONEquals

func JSONEquals(expected string) resource.CheckResourceAttrWithFunc

func MatchesExpression

func MatchesExpression(expr string) resource.CheckResourceAttrWithFunc

func PreCheck

func PreCheck(tb testing.TB)

PreCheck checks common Atlas environment variables and MONGODB_ATLAS_PROJECT_ID. Deprecated: it should not be used as MONGODB_ATLAS_PROJECT_ID is not intended to be used in CI. Use PreCheckBasic instead.

func PreCheckAtlasUsername

func PreCheckAtlasUsername(tb testing.TB)

func PreCheckAwsEnv

func PreCheckAwsEnv(tb testing.TB)

func PreCheckBasic

func PreCheckBasic(tb testing.TB)

func PreCheckBasicOwnerID

func PreCheckBasicOwnerID(tb testing.TB)

func PreCheckCert added in v1.15.1

func PreCheckCert(tb testing.TB)

func PreCheckCloudProviderAccessAzure

func PreCheckCloudProviderAccessAzure(tb testing.TB)

func PreCheckDataLakePipelineRun

func PreCheckDataLakePipelineRun(tb testing.TB)

func PreCheckDataLakePipelineRuns

func PreCheckDataLakePipelineRuns(tb testing.TB)

func PreCheckEncryptionAtRestEnvAzure

func PreCheckEncryptionAtRestEnvAzure(tb testing.TB)

func PreCheckFederatedSettings

func PreCheckFederatedSettings(tb testing.TB)

func PreCheckGPCEnv

func PreCheckGPCEnv(tb testing.TB)

func PreCheckGov

func PreCheckGov(tb testing.TB)

func PreCheckLDAP

func PreCheckLDAP(tb testing.TB)

func PreCheckLDAPCert added in v1.15.2

func PreCheckLDAPCert(tb testing.TB)

func PreCheckPeeringEnvAWS

func PreCheckPeeringEnvAWS(tb testing.TB)

func PreCheckPeeringEnvAzure

func PreCheckPeeringEnvAzure(tb testing.TB)

func PreCheckPeeringEnvGCP

func PreCheckPeeringEnvGCP(tb testing.TB)

func PreCheckPreviewFlag added in v1.15.2

func PreCheckPreviewFlag(tb testing.TB)

func PreCheckPrivateEndpoint added in v1.15.2

func PreCheckPrivateEndpoint(tb testing.TB)

func PreCheckProjectTeamsIDsWithMinCount added in v1.15.2

func PreCheckProjectTeamsIDsWithMinCount(tb testing.TB, minTeamsCount int)

func PreCheckRegularCredsAreEmpty

func PreCheckRegularCredsAreEmpty(tb testing.TB)

func PreCheckS3Bucket added in v1.15.0

func PreCheckS3Bucket(tb testing.TB)

func PreCheckSTSAssumeRole

func PreCheckSTSAssumeRole(tb testing.TB)

func ProjectID added in v1.15.3

func ProjectID(tb testing.TB, name string) string

ProjectID returns the id for a project name. When `MONGODB_ATLAS_PROJECT_ID` is defined, it is used instead of creating a project. This is useful for local execution but not intended for CI executions.

func ProjectIDExecution added in v1.15.2

func ProjectIDExecution(tb testing.TB) string

ProjectIDExecution returns a project id created for the execution of the tests in the resource package. Even if a GH test group is run, every resource/package will create its own project, not a shared project for all the test group. When `MONGODB_ATLAS_PROJECT_ID` is defined, it is used instead of creating a project. This is useful for local execution but not intended for CI executions.

func ProjectIDGlobal added in v1.15.2

func ProjectIDGlobal(tb testing.TB) string

ProjectIDGlobal returns a common global project. Consider mig.ProjectIDGlobal for mig tests. When `MONGODB_ATLAS_PROJECT_ID` is defined, it is used instead of creating a project. This is useful for local execution but not intended for CI executions.

func RandomClusterName added in v1.15.2

func RandomClusterName() string

func RandomEmail added in v1.15.2

func RandomEmail() string

func RandomIAMRole added in v1.15.2

func RandomIAMRole() string

func RandomIAMUser added in v1.15.2

func RandomIAMUser() string

func RandomIP added in v1.15.2

func RandomIP(a, b, c byte) string

func RandomLDAPName added in v1.15.2

func RandomLDAPName() string

func RandomName added in v1.15.2

func RandomName() string

func RandomProjectName added in v1.15.2

func RandomProjectName() string

func SetupSharedResources added in v1.15.2

func SetupSharedResources() func()

SetupSharedResources must be called from TestMain test package in order to use ProjectIDExecution. It returns the cleanup function that must be called at the end of TestMain.

func SkipInUnitTest added in v1.15.2

func SkipInUnitTest(tb testing.TB)

SkipInUnitTest allows skipping a test entirely when TF_ACC=1 is not defined. This can be useful for acceptance tests that define logic prior to resource.Test/resource.ParallelTest functions as this code would always be run.

func SkipTestForCI

func SkipTestForCI(tb testing.TB)

SkipTestForCI is added to tests that cannot run as part of CI, e.g. in Github actions.

func StreamInstanceConfig

func StreamInstanceConfig(orgID, projectName, instanceName, region, cloudProvider string) string

func StreamInstanceWithStreamConfigConfig added in v1.15.2

func StreamInstanceWithStreamConfigConfig(orgID, projectName, instanceName, region, cloudProvider string) string

func TestAccProviderV6FactoriesWithProxy added in v1.15.3

func TestAccProviderV6FactoriesWithProxy(proxyPort *int) map[string]func() (tfprotov6.ProviderServer, error)

Types

type ClusterInfo

type ClusterInfo struct {
	ProjectIDStr        string
	ClusterName         string
	ClusterNameStr      string
	ClusterTerraformStr string
}

func GetClusterInfo

func GetClusterInfo(tb testing.TB, req *ClusterRequest) ClusterInfo

GetClusterInfo is used to obtain a project and cluster configuration resource. When `MONGODB_ATLAS_CLUSTER_NAME` and `MONGODB_ATLAS_PROJECT_ID` are defined, creation of resources is avoided. This is useful for local execution but not intended for CI executions. Clusters will be created in project ProjectIDExecution.

type ClusterRequest added in v1.15.2

type ClusterRequest struct {
	ProviderName string
	ExtraConfig  string
	CloudBackup  bool
	Geosharded   bool
}

Jump to

Keyboard shortcuts

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