Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDestroyCluster(s *terraform.State) error
- func CheckDestroyFederatedDatabaseInstance(s *terraform.State) error
- func CheckDestroyNetworkPeering(s *terraform.State) error
- func CheckDestroyOrgInvitation(s *terraform.State) error
- func CheckDestroyProject(s *terraform.State) error
- func CheckDestroyProjectIPAccessList(s *terraform.State) error
- func CheckDestroySearchIndex(state *terraform.State) error
- func CheckDestroyStreamInstance(state *terraform.State) error
- func CheckDestroyTeam(s *terraform.State) error
- func CheckProjectAttributes(project *admin.Group, projectName string) resource.TestCheckFunc
- func CheckProjectExists(resourceName string, project *admin.Group) resource.TestCheckFunc
- func CheckProjectIPAccessListExists(resourceName string) resource.TestCheckFunc
- func ConfigClusterGlobal(resourceName, projectID, name, backupEnabled string) string
- func ConfigDatabaseUserBasic(projectID, username, roleName, keyLabel, valueLabel string) string
- func ConfigDatabaseUserWithAWSIAMType(projectID, username, roleName, keyLabel, valueLabel string) string
- func ConfigDatabaseUserWithLDAPAuthType(projectID, username, roleName, keyLabel, valueLabel string) string
- func ConfigDatabaseUserWithLabels(projectID, username, roleName string, labels []admin.ComponentLabel) string
- func ConfigDatabaseUserWithRoles(projectID, username, password string, rolesArr []*admin.DatabaseUserRole) string
- func ConfigDatabaseUserWithScopes(projectID, username, password, roleName string, scopesArr []*admin.UserScope) string
- func ConfigDatabaseUserWithX509Type(projectID, username, x509Type, roleName, keyLabel, valueLabel string) string
- func ConfigProject(projectName, orgID string, teams []*admin.TeamRole) string
- func ConfigProjectGovWithOwner(projectName, orgID, projectOwnerID string) string
- func ConfigProjectIPAccessListWithAWSSecurityGroup(...) string
- func ConfigProjectIPAccessListWithCIDRBlock(orgID, projectName, cidrBlock, comment string) string
- func ConfigProjectIPAccessListWithIPAddress(orgID, projectName, ipAddress, comment string) string
- func ConfigProjectIPAccessListWithMultiple(projectName, orgID string, accessList []map[string]string, isUpdate bool) string
- func ConfigProjectWithFalseDefaultSettings(projectName, orgID, projectOwnerID string) string
- func ConfigProjectWithLimits(projectName, orgID string, limits []*admin.DataFederationLimit) string
- func ConfigProjectWithOwner(projectName, orgID, projectOwnerID string) string
- func ConfigProjectWithSettings(projectName, orgID, projectOwnerID string, value bool) string
- func ConfigProjectWithUpdatedRole(projectName, orgID, teamID, roleName string) string
- func ConfigServerlessInstanceBasic(orgID, projectName, name string, ignoreConnectionStrings bool) string
- func ConfigServerlessInstanceWithTags(orgID, projectName, name string, tags []admin.ResourceTag) string
- func Conn() *matlas.Client
- func ConnV2() *admin.APIClient
- func DebugPlan() plancheck.PlanCheck
- func ExistingClusterUsed() bool
- func ExternalProviders(versionAtlasProvider string) map[string]resource.ExternalProvider
- func ExternalProvidersOnlyAWS() map[string]resource.ExternalProvider
- func ExternalProvidersWithAWS(versionAtlasProvider string) map[string]resource.ExternalProvider
- func GetProjectTeamsIDsWithPos(pos int) string
- func ImportStateClusterIDFunc(resourceName string) resource.ImportStateIdFunc
- func ImportStateProjecIPAccessListtIDFunc(resourceName string) resource.ImportStateIdFunc
- func ImportStateProjectIDFunc(resourceName string) resource.ImportStateIdFunc
- func InUnitTest() bool
- func IntGreatThan(value int) resource.CheckResourceAttrWithFunc
- func JSONEquals(expected string) resource.CheckResourceAttrWithFunc
- func MatchesExpression(expr string) resource.CheckResourceAttrWithFunc
- func PreCheck(tb testing.TB)
- func PreCheckAtlasUsername(tb testing.TB)
- func PreCheckAwsEnv(tb testing.TB)
- func PreCheckBasic(tb testing.TB)
- func PreCheckBasicOwnerID(tb testing.TB)
- func PreCheckCert(tb testing.TB)
- func PreCheckCloudProviderAccessAzure(tb testing.TB)
- func PreCheckDataLakePipelineRun(tb testing.TB)
- func PreCheckDataLakePipelineRuns(tb testing.TB)
- func PreCheckEncryptionAtRestEnvAzure(tb testing.TB)
- func PreCheckFederatedSettings(tb testing.TB)
- func PreCheckGPCEnv(tb testing.TB)
- func PreCheckGov(tb testing.TB)
- func PreCheckLDAP(tb testing.TB)
- func PreCheckLDAPCert(tb testing.TB)
- func PreCheckPeeringEnvAWS(tb testing.TB)
- func PreCheckPeeringEnvAzure(tb testing.TB)
- func PreCheckPeeringEnvGCP(tb testing.TB)
- func PreCheckPreviewFlag(tb testing.TB)
- func PreCheckPrivateEndpoint(tb testing.TB)
- func PreCheckProjectTeamsIDsWithMinCount(tb testing.TB, minTeamsCount int)
- func PreCheckRegularCredsAreEmpty(tb testing.TB)
- func PreCheckS3Bucket(tb testing.TB)
- func PreCheckSTSAssumeRole(tb testing.TB)
- func ProjectID(tb testing.TB, name string) string
- func ProjectIDExecution(tb testing.TB) string
- func ProjectIDGlobal(tb testing.TB) string
- func RandomClusterName() string
- func RandomEmail() string
- func RandomIAMRole() string
- func RandomIAMUser() string
- func RandomIP(a, b, c byte) string
- func RandomLDAPName() string
- func RandomName() string
- func RandomProjectName() string
- func SetupSharedResources() func()
- func SkipInUnitTest(tb testing.TB)
- func SkipTestForCI(tb testing.TB)
- func StreamInstanceConfig(orgID, projectName, instanceName, region, cloudProvider string) string
- func StreamInstanceWithStreamConfigConfig(orgID, projectName, instanceName, region, cloudProvider string) string
- type ClusterInfo
- type ClusterRequest
Constants ¶
const (
PrefixProjectKeep = prefixProject + "-keep"
)
const (
// Provider name for single configuration testing
ProviderNameMongoDBAtlas = "mongodbatlas"
)
Variables ¶
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", } )
var MongoDBClient *config.MongoDBClient
MongoDBClient is used to configure client required for Framework-based acceptance tests.
var TestAccProviderV6Factories map[string]func() (tfprotov6.ProviderServer, error)
TestAccProviderV6Factories is used in all tests for ProtoV6ProviderFactories.
Functions ¶
func CheckDestroyCluster ¶ added in v1.15.2
func CheckDestroyProject ¶
func CheckDestroySearchIndex ¶
func CheckDestroyTeam ¶
func CheckProjectAttributes ¶
func CheckProjectAttributes(project *admin.Group, projectName string) resource.TestCheckFunc
func CheckProjectExists ¶
func CheckProjectExists(resourceName string, project *admin.Group) resource.TestCheckFunc
func CheckProjectIPAccessListExists ¶
func CheckProjectIPAccessListExists(resourceName string) resource.TestCheckFunc
func ConfigClusterGlobal ¶
func ConfigDatabaseUserBasic ¶
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 ConfigProjectWithLimits ¶
func ConfigProjectWithLimits(projectName, orgID string, limits []*admin.DataFederationLimit) string
func ConfigProjectWithOwner ¶
func ConfigProjectWithSettings ¶ added in v1.15.0
func ConfigServerlessInstanceWithTags ¶
func ConfigServerlessInstanceWithTags(orgID, projectName, name string, tags []admin.ResourceTag) string
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 ImportStateClusterIDFunc ¶
func ImportStateClusterIDFunc(resourceName string) resource.ImportStateIdFunc
func ImportStateProjecIPAccessListtIDFunc ¶
func ImportStateProjecIPAccessListtIDFunc(resourceName string) resource.ImportStateIdFunc
func ImportStateProjectIDFunc ¶
func ImportStateProjectIDFunc(resourceName string) resource.ImportStateIdFunc
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 PreCheckAtlasUsername ¶
func PreCheckAwsEnv ¶
func PreCheckBasic ¶
func PreCheckBasicOwnerID ¶
func PreCheckCert ¶ added in v1.15.1
func PreCheckGPCEnv ¶
func PreCheckGov ¶
func PreCheckLDAP ¶
func PreCheckLDAPCert ¶ added in v1.15.2
func PreCheckPeeringEnvAWS ¶
func PreCheckPeeringEnvAzure ¶
func PreCheckPeeringEnvGCP ¶
func PreCheckPreviewFlag ¶ added in v1.15.2
func PreCheckPrivateEndpoint ¶ added in v1.15.2
func PreCheckProjectTeamsIDsWithMinCount ¶ added in v1.15.2
func PreCheckS3Bucket ¶ added in v1.15.0
func PreCheckSTSAssumeRole ¶
func ProjectIDExecution ¶ added in v1.15.2
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.
func ProjectIDGlobal ¶ added in v1.15.2
ProjectIDGlobal returns a common global project. Consider mig.ProjectIDGlobal for mig tests.
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 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
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 ¶
SkipTestForCI is added to tests that cannot run as part of CI, e.g. in Github actions.
func StreamInstanceConfig ¶
func StreamInstanceWithStreamConfigConfig ¶ added in v1.15.2
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.