Documentation ¶
Index ¶
- Constants
- Variables
- func AddIDsToReplicationSpecs(replicationSpecs []admin.ReplicationSpec20240805, ...) []admin.ReplicationSpec20240805
- func CheckRegionConfigsPriorityOrder(regionConfigs []admin.ReplicationSpec20240805) error
- func CheckRegionConfigsPriorityOrderOld(regionConfigs []admin20240530.ReplicationSpec) error
- func ConvertClusterDescription20241023to20240805(clusterDescription *admin.ClusterDescription20240805) *admin20240805.ClusterDescription20240805
- func CreateStateChangeConfig(ctx context.Context, connV2 *admin.APIClient, projectID, name string, ...) retry.StateChangeConf
- func DataSource() *schema.Resource
- func DeleteStateChangeConfig(ctx context.Context, connV2 *admin.APIClient, projectID, name string, ...) retry.StateChangeConf
- func FlattenAdvancedReplicationSpecsOldShardingConfig(ctx context.Context, apiObjects []admin.ReplicationSpec20240805, ...) ([]map[string]any, error)
- func FlattenPinnedFCV(cluster *admin.ClusterDescription20240805) []map[string]string
- func FormatMongoDBMajorVersion(val any) string
- func GetDiskSizeGBFromReplicationSpec(cluster *admin.ClusterDescription20240805) float64
- func GetReplicationSpecAttributesFromOldAPI(ctx context.Context, projectID, clusterName string, ...) (map[string]OldShardConfigMeta, error)
- func HandlePinnedFCVUpdate(ctx context.Context, connV2 *admin.APIClient, projectID, clusterName string, ...) diag.Diagnostics
- func HashCodeString(s string) int
- func HashFunctionForKeyValuePair(v any) int
- func IsChangeStreamOptionsMinRequiredMajorVersion(input *string) bool
- func IsDefaultMaxTimeMinRequiredMajorVersion(input *string) bool
- func IsSharedTier(instanceSize string) bool
- func MigrateBIConnectorConfig(rawState map[string]any) map[string]any
- func PinFCV(ctx context.Context, connV2 *admin.APIClient, projectID, clusterName string, ...) diag.Diagnostics
- func PluralDataSource() *schema.Resource
- func Resource() *schema.Resource
- func ResourceClusterListAdvancedRefreshFunc(ctx context.Context, projectID string, clustersAPI admin.ClustersApi) retry.StateRefreshFunc
- func ResourceV0() *schema.Resource
- func SchemaAdvancedConfig() *schema.Schema
- func SchemaAdvancedConfigDS() *schema.Schema
- func SchemaConnectionStrings() *schema.Schema
- func SyncAutoScalingConfigs(replicationSpecs *[]admin.ReplicationSpec20240805)
- func UpgradeRefreshFunc(ctx context.Context, name, projectID string, client admin.ClustersApi) retry.StateRefreshFunc
- func WarningIfFCVExpiredOrUnpinnedExternally(d *schema.ResourceData, cluster *admin.ClusterDescription20240805) diag.Diagnostics
- type OldShardConfigMeta
- type ReplicationSpecSDKModel
Constants ¶
const ( ErrorClusterSetting = "error setting `%s` for MongoDB Cluster (%s): %s" ErrorAdvancedConfRead = "error reading Advanced Configuration Option %s for MongoDB Cluster (%s): %s" ErrorClusterAdvancedSetting = "error setting `%s` for MongoDB ClusterAdvanced (%s): %s" ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" ErrorOperationNotPermitted = "error operation not permitted" ErrorDefaultMaxTimeMinVersion = "default_max_time_ms can not be set for mongo_db_major_version lower than 8.0" DeprecationOldSchemaAction = "" /* 206-byte string literal not displayed */ V20240530 = "(v20240530)" )
Variables ¶
var ( DSTagsSchema = schema.Schema{ Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "key": { Type: schema.TypeString, Computed: true, }, "value": { Type: schema.TypeString, Computed: true, }, }, }, } RSTagsSchema = schema.Schema{ Type: schema.TypeSet, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "key": { Type: schema.TypeString, Required: true, }, "value": { Type: schema.TypeString, Required: true, }, }, }, } )
var DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction)
Functions ¶
func AddIDsToReplicationSpecs ¶ added in v1.18.0
func AddIDsToReplicationSpecs(replicationSpecs []admin.ReplicationSpec20240805, zoneToReplicationSpecsIDs map[string][]string) []admin.ReplicationSpec20240805
func CheckRegionConfigsPriorityOrder ¶ added in v1.21.0
func CheckRegionConfigsPriorityOrder(regionConfigs []admin.ReplicationSpec20240805) error
CheckRegionConfigsPriorityOrder will be deleted in CLOUDP-275825
func CheckRegionConfigsPriorityOrderOld ¶ added in v1.21.0
func CheckRegionConfigsPriorityOrderOld(regionConfigs []admin20240530.ReplicationSpec) error
CheckRegionConfigsPriorityOrderOld will be deleted in CLOUDP-275825
func ConvertClusterDescription20241023to20240805 ¶ added in v1.23.0
func ConvertClusterDescription20241023to20240805(clusterDescription *admin.ClusterDescription20240805) *admin20240805.ClusterDescription20240805
func CreateStateChangeConfig ¶ added in v1.16.0
func DataSource ¶
func DeleteStateChangeConfig ¶ added in v1.16.0
func FlattenAdvancedReplicationSpecsOldShardingConfig ¶ added in v1.23.0
func FlattenAdvancedReplicationSpecsOldShardingConfig(ctx context.Context, apiObjects []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecMeta map[string]OldShardConfigMeta, tfMapObjects []any, d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error)
func FlattenPinnedFCV ¶ added in v1.23.0
func FlattenPinnedFCV(cluster *admin.ClusterDescription20240805) []map[string]string
func GetDiskSizeGBFromReplicationSpec ¶ added in v1.18.0
func GetDiskSizeGBFromReplicationSpec(cluster *admin.ClusterDescription20240805) float64
GetDiskSizeGBFromReplicationSpec obtains the diskSizeGB value by looking into the electable spec of the first replication spec. Independent storage size scaling is not supported (CLOUDP-201331), meaning all electable/analytics/readOnly configs in all replication specs are the same.
func GetReplicationSpecAttributesFromOldAPI ¶ added in v1.23.0
func GetReplicationSpecAttributesFromOldAPI(ctx context.Context, projectID, clusterName string, client20240530 admin20240530.ClustersApi) (map[string]OldShardConfigMeta, error)
GetReplicationSpecAttributesFromOldAPI returns the id and num shard values of replication specs coming from old API. This is used to populate replication_specs.*.id and replication_specs.*.num_shard attributes for old sharding confirgurations. In the old API (2023-02-01), each replications spec has a 1:1 relation with each zone, so ids and num shards are stored in a struct oldShardConfigMeta and are returned in a map from zoneName to oldShardConfigMeta.
func HandlePinnedFCVUpdate ¶ added in v1.23.0
func HashCodeString ¶
HashCodeString hashes a string to a unique hashcode.
crc32 returns a uint32, but for our use we need and non negative integer. Here we cast to an integer and invert it if the result is negative.
func IsChangeStreamOptionsMinRequiredMajorVersion ¶ added in v1.20.0
func IsDefaultMaxTimeMinRequiredMajorVersion ¶ added in v1.23.0
func IsSharedTier ¶
func PluralDataSource ¶
func ResourceClusterListAdvancedRefreshFunc ¶
func ResourceClusterListAdvancedRefreshFunc(ctx context.Context, projectID string, clustersAPI admin.ClustersApi) retry.StateRefreshFunc
func ResourceV0 ¶
func SchemaAdvancedConfig ¶ added in v1.15.2
func SchemaAdvancedConfigDS ¶ added in v1.15.2
func SchemaConnectionStrings ¶ added in v1.15.2
func SyncAutoScalingConfigs ¶ added in v1.18.0
func SyncAutoScalingConfigs(replicationSpecs *[]admin.ReplicationSpec20240805)
Having the following considerations: - Existing replication specs can have the autoscaling values present in the state with default values even if not defined in the config (case when cluster is imported) - API expects autoScaling and analyticsAutoScaling aligned cross all region configs in the PATCH request This function is needed to avoid errors if a new replication spec is added, ensuring the PATCH request will have the auto scaling aligned with other replication specs when not present in config.
func UpgradeRefreshFunc ¶ added in v1.15.2
func UpgradeRefreshFunc(ctx context.Context, name, projectID string, client admin.ClustersApi) retry.StateRefreshFunc
func WarningIfFCVExpiredOrUnpinnedExternally ¶ added in v1.23.0
func WarningIfFCVExpiredOrUnpinnedExternally(d *schema.ResourceData, cluster *admin.ClusterDescription20240805) diag.Diagnostics
Types ¶
type OldShardConfigMeta ¶ added in v1.23.0
type ReplicationSpecSDKModel ¶ added in v1.18.0
type ReplicationSpecSDKModel interface { admin20240530.ReplicationSpec | admin.ReplicationSpec20240805 }