Documentation ¶
Index ¶
- Constants
- Variables
- func AddAdvancedConfig(ctx context.Context, tfModel *TFModel, ...)
- func AutoScalingSchema() schema.SingleNestedAttribute
- func AwaitChanges(ctx context.Context, api admin.ClustersApi, t *timeouts.Value, ...) (cluster *admin.ClusterDescription20240805)
- func CreateStateChangeConfig(ctx context.Context, api admin.ClustersApi, ...) retry.StateChangeConf
- func DataSource() datasource.DataSource
- func FormatMongoDBMajorVersion(version string) string
- func MajorVersionCompatible(input *string, version float64, operator MajorVersionOperator) *bool
- func NewAtlasReq(ctx context.Context, input *TFModel, diags *diag.Diagnostics) *admin.ClusterDescription20240805
- func NewAtlasReqAdvancedConfiguration(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805
- func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs
- func NewAutoScalingObjType(ctx context.Context, input *admin.AdvancedAutoScalingSettings, ...) types.Object
- func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.List
- func NewConnectionStringsObjType(ctx context.Context, input *admin.ClusterConnectionStrings, ...) types.Object
- func NewEndpointsObjType(ctx context.Context, ...) types.List
- func NewLabelsObjType(ctx context.Context, input *[]admin.ComponentLabel, diags *diag.Diagnostics) types.Set
- func NewPrivateEndpointObjType(ctx context.Context, ...) types.List
- func NewRegionConfigsObjType(ctx context.Context, input *[]admin.CloudRegionConfig20240805, ...) types.List
- func NewReplicationSpecsObjType(ctx context.Context, input *[]admin.ReplicationSpec20240805, ...) types.List
- func NewSpecsFromHwObjType(ctx context.Context, input *admin.HardwareSpec20240805, ...) types.Object
- func NewSpecsObjType(ctx context.Context, input *admin.DedicatedHardwareSpec20240805, ...) types.Object
- func NewTagsObjType(ctx context.Context, input *[]admin.ResourceTag, diags *diag.Diagnostics) types.Set
- func PluralDataSource() datasource.DataSource
- func Resource() resource.Resource
- func SpecsSchema(markdownDescription string) schema.SingleNestedAttribute
- type ExtraAPIInfo
- type FailOnIncompatibleMongoDBVersion
- func (v FailOnIncompatibleMongoDBVersion) Description(ctx context.Context) string
- func (v FailOnIncompatibleMongoDBVersion) MarkdownDescription(_ context.Context) string
- func (v FailOnIncompatibleMongoDBVersion) PlanModifyBool(ctx context.Context, req planmodifier.BoolRequest, ...)
- func (v FailOnIncompatibleMongoDBVersion) PlanModifyInt64(ctx context.Context, req planmodifier.Int64Request, ...)
- type MajorVersionOperator
- type RegionSpecPriorityOrderDecreasingValidator
- func (v RegionSpecPriorityOrderDecreasingValidator) Description(ctx context.Context) string
- func (v RegionSpecPriorityOrderDecreasingValidator) MarkdownDescription(_ context.Context) string
- func (v RegionSpecPriorityOrderDecreasingValidator) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse)
- type TFAdvancedConfigurationModel
- type TFAutoScalingModel
- type TFBiConnectorModel
- type TFConnectionStringsModel
- type TFEndpointsModel
- type TFLabelsModel
- type TFModel
- type TFModelDS
- type TFModelPluralDS
- type TFPinnedFCVModel
- type TFPrivateEndpointModel
- type TFRegionConfigsModel
- type TFReplicationSpecsModel
- type TFSpecsModel
- type TFTagsModel
Constants ¶
View Source
const ( ErrorClusterSetting = "error setting `%s` for MongoDB Cluster (%s): %s" ErrorAdvancedConfRead = "error reading Advanced Configuration Option form 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" DeprecationOldSchemaAction = "" /* 206-byte string literal not displayed */ ErrorCodeClusterNotFound = "CLUSTER_NOT_FOUND" )
Variables ¶
View Source
var ( RetryMinTimeout = 1 * time.Minute RetryDelay = 30 * time.Second RetryPollInterval = 30 * time.Second )
View Source
var AdvancedConfigurationObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "change_stream_options_pre_and_post_images_expire_after_seconds": types.Int64Type, "default_read_concern": types.StringType, "default_write_concern": types.StringType, "fail_index_key_too_long": types.BoolType, "javascript_enabled": types.BoolType, "minimum_enabled_tls_protocol": types.StringType, "no_table_scan": types.BoolType, "oplog_min_retention_hours": types.Float64Type, "oplog_size_mb": types.Int64Type, "sample_refresh_interval_bi_connector": types.Int64Type, "sample_size_bi_connector": types.Int64Type, "transaction_lifetime_limit_seconds": types.Int64Type, }}
View Source
var AutoScalingObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "compute_enabled": types.BoolType, "compute_max_instance_size": types.StringType, "compute_min_instance_size": types.StringType, "compute_scale_down_enabled": types.BoolType, "disk_gb_enabled": types.BoolType, }}
View Source
var BiConnectorConfigObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "enabled": types.BoolType, "read_preference": types.StringType, }}
View Source
var ConnectionStringsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "private": types.StringType, "private_endpoint": types.ListType{ElemType: PrivateEndpointObjType}, "private_srv": types.StringType, "standard": types.StringType, "standard_srv": types.StringType, }}
View Source
var (
DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction)
)
View Source
var EndpointsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "endpoint_id": types.StringType, "provider_name": types.StringType, "region": types.StringType, }}
View Source
var LabelsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "key": types.StringType, "value": types.StringType, }}
View Source
var PinnedFCVObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "version": types.StringType, "expiration_date": types.StringType, }}
View Source
var PrivateEndpointObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "connection_string": types.StringType, "endpoints": types.ListType{ElemType: EndpointsObjType}, "srv_connection_string": types.StringType, "srv_shard_optimized_connection_string": types.StringType, "type": types.StringType, }}
View Source
var RegionConfigsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "analytics_auto_scaling": AutoScalingObjType, "analytics_specs": SpecsObjType, "auto_scaling": AutoScalingObjType, "backing_provider_name": types.StringType, "electable_specs": SpecsObjType, "priority": types.Int64Type, "provider_name": types.StringType, "read_only_specs": SpecsObjType, "region_name": types.StringType, }}
View Source
var ReplicationSpecsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "id": types.StringType, "container_id": types.MapType{ElemType: types.StringType}, "external_id": types.StringType, "num_shards": types.Int64Type, "region_configs": types.ListType{ElemType: RegionConfigsObjType}, "zone_id": types.StringType, "zone_name": types.StringType, }}
View Source
var SpecsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "disk_iops": types.Int64Type, "disk_size_gb": types.Float64Type, "ebs_volume_type": types.StringType, "instance_size": types.StringType, "node_count": types.Int64Type, }}
View Source
var TagsObjType = types.ObjectType{AttrTypes: map[string]attr.Type{ "key": types.StringType, "value": types.StringType, }}
Functions ¶
func AddAdvancedConfig ¶ added in v1.22.0
func AddAdvancedConfig(ctx context.Context, tfModel *TFModel, input *admin.ClusterDescriptionProcessArgs20240805, inputLegacy *admin20240530.ClusterDescriptionProcessArgs, diags *diag.Diagnostics)
func AutoScalingSchema ¶ added in v1.22.0
func AutoScalingSchema() schema.SingleNestedAttribute
func AwaitChanges ¶ added in v1.22.0
func AwaitChanges(ctx context.Context, api admin.ClustersApi, t *timeouts.Value, diags *diag.Diagnostics, projectID, clusterName, changeReason string) (cluster *admin.ClusterDescription20240805)
func CreateStateChangeConfig ¶ added in v1.22.0
func CreateStateChangeConfig(ctx context.Context, api admin.ClustersApi, projectID, name, targetState string, timeout time.Duration, extraPending ...string) retry.StateChangeConf
func DataSource ¶
func DataSource() datasource.DataSource
func FormatMongoDBMajorVersion ¶ added in v1.23.0
func MajorVersionCompatible ¶ added in v1.23.0
func MajorVersionCompatible(input *string, version float64, operator MajorVersionOperator) *bool
func NewAtlasReq ¶
func NewAtlasReq(ctx context.Context, input *TFModel, diags *diag.Diagnostics) *admin.ClusterDescription20240805
func NewAtlasReqAdvancedConfiguration ¶ added in v1.22.0
func NewAtlasReqAdvancedConfiguration(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805
func NewAtlasReqAdvancedConfigurationLegacy ¶ added in v1.22.0
func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs
func NewAutoScalingObjType ¶ added in v1.22.0
func NewAutoScalingObjType(ctx context.Context, input *admin.AdvancedAutoScalingSettings, diags *diag.Diagnostics) types.Object
func NewBiConnectorConfigObjType ¶ added in v1.22.0
func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.List
func NewConnectionStringsObjType ¶ added in v1.22.0
func NewConnectionStringsObjType(ctx context.Context, input *admin.ClusterConnectionStrings, diags *diag.Diagnostics) types.Object
func NewEndpointsObjType ¶ added in v1.22.0
func NewEndpointsObjType(ctx context.Context, input *[]admin.ClusterDescriptionConnectionStringsPrivateEndpointEndpoint, diags *diag.Diagnostics) types.List
func NewLabelsObjType ¶ added in v1.22.0
func NewLabelsObjType(ctx context.Context, input *[]admin.ComponentLabel, diags *diag.Diagnostics) types.Set
func NewPrivateEndpointObjType ¶ added in v1.22.0
func NewPrivateEndpointObjType(ctx context.Context, input *[]admin.ClusterDescriptionConnectionStringsPrivateEndpoint, diags *diag.Diagnostics) types.List
func NewRegionConfigsObjType ¶ added in v1.22.0
func NewRegionConfigsObjType(ctx context.Context, input *[]admin.CloudRegionConfig20240805, diags *diag.Diagnostics) types.List
func NewReplicationSpecsObjType ¶ added in v1.22.0
func NewReplicationSpecsObjType(ctx context.Context, input *[]admin.ReplicationSpec20240805, diags *diag.Diagnostics, apiInfo *ExtraAPIInfo) types.List
func NewSpecsFromHwObjType ¶ added in v1.22.0
func NewSpecsFromHwObjType(ctx context.Context, input *admin.HardwareSpec20240805, diags *diag.Diagnostics) types.Object
func NewSpecsObjType ¶ added in v1.22.0
func NewSpecsObjType(ctx context.Context, input *admin.DedicatedHardwareSpec20240805, diags *diag.Diagnostics) types.Object
func NewTagsObjType ¶ added in v1.22.0
func NewTagsObjType(ctx context.Context, input *[]admin.ResourceTag, diags *diag.Diagnostics) types.Set
func PluralDataSource ¶
func PluralDataSource() datasource.DataSource
func SpecsSchema ¶ added in v1.22.0
func SpecsSchema(markdownDescription string) schema.SingleNestedAttribute
Types ¶
type ExtraAPIInfo ¶ added in v1.23.0
type FailOnIncompatibleMongoDBVersion ¶ added in v1.23.0
type FailOnIncompatibleMongoDBVersion struct { Version float64 Operator MajorVersionOperator }
func PlanMustUseMongoDBVersion ¶ added in v1.23.0
func PlanMustUseMongoDBVersion(version float64, operator MajorVersionOperator) FailOnIncompatibleMongoDBVersion
func (FailOnIncompatibleMongoDBVersion) Description ¶ added in v1.23.0
func (v FailOnIncompatibleMongoDBVersion) Description(ctx context.Context) string
func (FailOnIncompatibleMongoDBVersion) MarkdownDescription ¶ added in v1.23.0
func (v FailOnIncompatibleMongoDBVersion) MarkdownDescription(_ context.Context) string
func (FailOnIncompatibleMongoDBVersion) PlanModifyBool ¶ added in v1.23.0
func (v FailOnIncompatibleMongoDBVersion) PlanModifyBool(ctx context.Context, req planmodifier.BoolRequest, resp *planmodifier.BoolResponse)
func (FailOnIncompatibleMongoDBVersion) PlanModifyInt64 ¶ added in v1.23.0
func (v FailOnIncompatibleMongoDBVersion) PlanModifyInt64(ctx context.Context, req planmodifier.Int64Request, resp *planmodifier.Int64Response)
type MajorVersionOperator ¶ added in v1.23.0
type MajorVersionOperator int
const ( EqualOrHigher MajorVersionOperator = iota Higher EqualOrLower Lower )
type RegionSpecPriorityOrderDecreasingValidator ¶ added in v1.23.0
type RegionSpecPriorityOrderDecreasingValidator struct{}
func (RegionSpecPriorityOrderDecreasingValidator) Description ¶ added in v1.23.0
func (v RegionSpecPriorityOrderDecreasingValidator) Description(ctx context.Context) string
func (RegionSpecPriorityOrderDecreasingValidator) MarkdownDescription ¶ added in v1.23.0
func (v RegionSpecPriorityOrderDecreasingValidator) MarkdownDescription(_ context.Context) string
func (RegionSpecPriorityOrderDecreasingValidator) ValidateList ¶ added in v1.23.0
func (v RegionSpecPriorityOrderDecreasingValidator) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse)
type TFAdvancedConfigurationModel ¶ added in v1.22.0
type TFAdvancedConfigurationModel struct { OplogMinRetentionHours types.Float64 `tfsdk:"oplog_min_retention_hours"` MinimumEnabledTlsProtocol types.String `tfsdk:"minimum_enabled_tls_protocol"` DefaultWriteConcern types.String `tfsdk:"default_write_concern"` DefaultReadConcern types.String `tfsdk:"default_read_concern"` ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds types.Int64 `tfsdk:"change_stream_options_pre_and_post_images_expire_after_seconds"` OplogSizeMb types.Int64 `tfsdk:"oplog_size_mb"` SampleRefreshIntervalBiconnector types.Int64 `tfsdk:"sample_refresh_interval_bi_connector"` SampleSizeBiconnector types.Int64 `tfsdk:"sample_size_bi_connector"` TransactionLifetimeLimitSeconds types.Int64 `tfsdk:"transaction_lifetime_limit_seconds"` JavascriptEnabled types.Bool `tfsdk:"javascript_enabled"` NoTableScan types.Bool `tfsdk:"no_table_scan"` FailIndexKeyTooLong types.Bool `tfsdk:"fail_index_key_too_long"` }
type TFAutoScalingModel ¶ added in v1.22.0
type TFAutoScalingModel struct { ComputeMaxInstanceSize types.String `tfsdk:"compute_max_instance_size"` ComputeMinInstanceSize types.String `tfsdk:"compute_min_instance_size"` ComputeEnabled types.Bool `tfsdk:"compute_enabled"` ComputeScaleDownEnabled types.Bool `tfsdk:"compute_scale_down_enabled"` DiskGBEnabled types.Bool `tfsdk:"disk_gb_enabled"` }
type TFBiConnectorModel ¶ added in v1.22.0
type TFConnectionStringsModel ¶ added in v1.22.0
type TFEndpointsModel ¶ added in v1.22.0
type TFLabelsModel ¶ added in v1.22.0
type TFModel ¶
type TFModel struct { DiskSizeGB types.Float64 `tfsdk:"disk_size_gb"` Labels types.Set `tfsdk:"labels"` ReplicationSpecs types.List `tfsdk:"replication_specs"` Tags types.Set `tfsdk:"tags"` StateName types.String `tfsdk:"state_name"` ConnectionStrings types.Object `tfsdk:"connection_strings"` CreateDate types.String `tfsdk:"create_date"` AcceptDataRisksAndForceReplicaSetReconfig types.String `tfsdk:"accept_data_risks_and_force_replica_set_reconfig"` EncryptionAtRestProvider types.String `tfsdk:"encryption_at_rest_provider"` Timeouts timeouts.Value `tfsdk:"timeouts"` ProjectID types.String `tfsdk:"project_id"` ClusterID types.String `tfsdk:"cluster_id"` ConfigServerManagementMode types.String `tfsdk:"config_server_management_mode"` MongoDBMajorVersion types.String `tfsdk:"mongo_db_major_version"` MongoDBVersion types.String `tfsdk:"mongo_db_version"` Name types.String `tfsdk:"name"` VersionReleaseSystem types.String `tfsdk:"version_release_system"` BiConnectorConfig types.List `tfsdk:"bi_connector_config"` ConfigServerType types.String `tfsdk:"config_server_type"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` ClusterType types.String `tfsdk:"cluster_type"` RootCertType types.String `tfsdk:"root_cert_type"` AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` PinnedFCV types.Object `tfsdk:"pinned_fcv"` TerminationProtectionEnabled types.Bool `tfsdk:"termination_protection_enabled"` Paused types.Bool `tfsdk:"paused"` RetainBackupsEnabled types.Bool `tfsdk:"retain_backups_enabled"` BackupEnabled types.Bool `tfsdk:"backup_enabled"` GlobalClusterSelfManagedSharding types.Bool `tfsdk:"global_cluster_self_managed_sharding"` RedactClientLogData types.Bool `tfsdk:"redact_client_log_data"` PitEnabled types.Bool `tfsdk:"pit_enabled"` }
func NewTFModel ¶
func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, timeout timeouts.Value, diags *diag.Diagnostics, apiInfo ExtraAPIInfo) *TFModel
type TFModelDS ¶ added in v1.23.0
type TFModelDS struct { DiskSizeGB types.Float64 `tfsdk:"disk_size_gb"` Labels types.Set `tfsdk:"labels"` ReplicationSpecs types.List `tfsdk:"replication_specs"` Tags types.Set `tfsdk:"tags"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` Name types.String `tfsdk:"name"` AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` BiConnectorConfig types.List `tfsdk:"bi_connector_config"` RootCertType types.String `tfsdk:"root_cert_type"` ClusterType types.String `tfsdk:"cluster_type"` MongoDBMajorVersion types.String `tfsdk:"mongo_db_major_version"` ConfigServerType types.String `tfsdk:"config_server_type"` VersionReleaseSystem types.String `tfsdk:"version_release_system"` ConnectionStrings types.Object `tfsdk:"connection_strings"` StateName types.String `tfsdk:"state_name"` MongoDBVersion types.String `tfsdk:"mongo_db_version"` CreateDate types.String `tfsdk:"create_date"` EncryptionAtRestProvider types.String `tfsdk:"encryption_at_rest_provider"` ProjectID types.String `tfsdk:"project_id"` ClusterID types.String `tfsdk:"cluster_id"` ConfigServerManagementMode types.String `tfsdk:"config_server_management_mode"` PinnedFCV types.Object `tfsdk:"pinned_fcv"` UseReplicationSpecPerShard types.Bool `tfsdk:"use_replication_spec_per_shard"` RedactClientLogData types.Bool `tfsdk:"redact_client_log_data"` GlobalClusterSelfManagedSharding types.Bool `tfsdk:"global_cluster_self_managed_sharding"` BackupEnabled types.Bool `tfsdk:"backup_enabled"` RetainBackupsEnabled types.Bool `tfsdk:"retain_backups_enabled"` Paused types.Bool `tfsdk:"paused"` TerminationProtectionEnabled types.Bool `tfsdk:"termination_protection_enabled"` PitEnabled types.Bool `tfsdk:"pit_enabled"` }
TFModelDS differs from TFModel: removes timeouts, accept_data_risks_and_force_replica_set_reconfig; adds use_replication_spec_per_shard.
type TFModelPluralDS ¶ added in v1.23.0
type TFModelPluralDS struct { ProjectID types.String `tfsdk:"project_id"` Results []*TFModelDS `tfsdk:"results"` UseReplicationSpecPerShard types.Bool `tfsdk:"use_replication_spec_per_shard"` // TODO: added as in current resource IncludeDeletedWithRetainedBackups types.Bool `tfsdk:"include_deleted_with_retained_backups"` // TODO: not in current resource, decide if keep }
type TFPinnedFCVModel ¶ added in v1.23.0
type TFPrivateEndpointModel ¶ added in v1.22.0
type TFPrivateEndpointModel struct { ConnectionString types.String `tfsdk:"connection_string"` Endpoints types.List `tfsdk:"endpoints"` SrvConnectionString types.String `tfsdk:"srv_connection_string"` SrvShardOptimizedConnectionString types.String `tfsdk:"srv_shard_optimized_connection_string"` Type types.String `tfsdk:"type"` }
type TFRegionConfigsModel ¶ added in v1.22.0
type TFRegionConfigsModel struct { AnalyticsAutoScaling types.Object `tfsdk:"analytics_auto_scaling"` AnalyticsSpecs types.Object `tfsdk:"analytics_specs"` AutoScaling types.Object `tfsdk:"auto_scaling"` BackingProviderName types.String `tfsdk:"backing_provider_name"` ElectableSpecs types.Object `tfsdk:"electable_specs"` ProviderName types.String `tfsdk:"provider_name"` ReadOnlySpecs types.Object `tfsdk:"read_only_specs"` RegionName types.String `tfsdk:"region_name"` Priority types.Int64 `tfsdk:"priority"` }
type TFReplicationSpecsModel ¶ added in v1.22.0
type TFReplicationSpecsModel struct { RegionConfigs types.List `tfsdk:"region_configs"` ContainerId types.Map `tfsdk:"container_id"` Id types.String `tfsdk:"id"` ExternalId types.String `tfsdk:"external_id"` ZoneId types.String `tfsdk:"zone_id"` ZoneName types.String `tfsdk:"zone_name"` NumShards types.Int64 `tfsdk:"num_shards"` }
type TFSpecsModel ¶ added in v1.22.0
Source Files ¶
- data_source.go
- model_ClusterDescription20240805.go
- model_ClusterDescriptionProcessArgs20240805.go
- model_to_AdvancedClusterDescription.go
- model_to_ClusterDescription20240805.go
- model_to_ClusterDescription20240805_legacy.go
- model_to_ClusterDescriptionProcessArgs20240805.go
- model_to_ClusterDescriptionProcessArgsLegacy.go
- move_state.go
- plural_data_source.go
- resource.go
- resource_compatibility_reuse.go
- resource_compatiblity.go
- resource_upgrade.go
- schema.go
- state_transition.go
- validate_schema.go
Click to show internal directories.
Click to hide internal directories.