Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/services/mongocluster/mongo_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type MongoClusterResourceModel struct {
AdministratorUserName string `tfschema:"administrator_username"`
AdministratorPassword string `tfschema:"administrator_password"`
CreateMode string `tfschema:"create_mode"`
InfrastructureVersion string `tfschema:"infrastructure_version"`
ShardCount int64 `tfschema:"shard_count"`
SourceLocation string `tfschema:"source_location"`
SourceServerId string `tfschema:"source_server_id"`
Expand Down Expand Up @@ -219,6 +220,10 @@ func (r MongoClusterResource) Attributes() map[string]*pluginsdk.Schema {
},
},
},
"infrastructure_version": {
Type: pluginsdk.TypeString,
Computed: true,
},
}
}

Expand Down Expand Up @@ -448,6 +453,8 @@ func (r MongoClusterResource) Read() sdk.ResourceFunc {
state.AdministratorUserName = pointer.From(v.UserName)
}

state.InfrastructureVersion = pointer.From(props.InfrastructureVersion)

if v := props.Replica; v != nil {
// API doesn't return the value of source_location, https://github.com/Azure/azure-rest-api-specs/issues/31266 has been filed to track it.
state.SourceLocation = metadata.ResourceData.Get("source_location").(string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func TestAccMongoCluster_previewFeature(t *testing.T) {
Config: r.previewFeature(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("infrastructure_version").Exists(),
),
},
data.ImportStep("administrator_password", "create_mode", "connection_strings.0.value", "connection_strings.1.value"),
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/mongo_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ In addition to the Arguments listed above - the following Attributes are exporte

* `connection_strings` - The list of `connection_strings` blocks as defined below.

* `infrastructure_version` - The infrastructure version of the MongoDB Cluster.

---

A `connection_strings` exports the following:
Expand Down
Loading