diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 99414b1537..acd2f7d5b7 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -35,7 +35,7 @@ jobs: advanced_cluster: ${{ steps.filter.outputs.advanced_cluster }} cluster: ${{ steps.filter.outputs.cluster }} search_deployment: ${{ steps.filter.outputs.search_deployment }} - stream_instance: ${{ steps.filter.outputs.stream_instance }} + stream: ${{ steps.filter.outputs.stream }} generic: ${{ steps.filter.outputs.generic }} backup_online_archive: ${{ steps.filter.outputs.backup_online_archive }} backup_snapshots: ${{ steps.filter.outputs.backup_snapshots }} @@ -65,7 +65,7 @@ jobs: - 'internal/service/cluster/*.go' search_deployment: - 'internal/service/searchdeployment/*.go' - stream_instance: + stream: - 'internal/service/streaminstance/*.go' generic: - 'internal/service/backupcompliancepolicy/*.go' @@ -213,9 +213,9 @@ jobs: TEST_REGEX: "^TestAccSearchDeployment" run: make testacc - stream_instance: + stream: needs: [ change-detection ] - if: ${{ needs.change-detection.outputs.stream_instance == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event.label.name == 'run-testacc' || github.event.label.name == 'run-testacc-stream-instance' }} + if: ${{ needs.change-detection.outputs.stream == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event.label.name == 'run-testacc' || github.event.label.name == 'run-testacc-stream' }} runs-on: ubuntu-latest steps: - name: Checkout @@ -234,7 +234,7 @@ jobs: MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }} MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV }} MONGODB_ATLAS_BASE_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }} - TEST_REGEX: "^TestAccStreamInstance" + TEST_REGEX: "^TestAccStream" run: make testacc generic: # Acceptance tests that do not use any time-consuming resource (example: cluster) diff --git a/internal/common/dsschema/pagination_schema.go b/internal/common/dsschema/pagination_schema.go new file mode 100644 index 0000000000..1ed5e6fe93 --- /dev/null +++ b/internal/common/dsschema/pagination_schema.go @@ -0,0 +1,34 @@ +package dsschema + +import ( + "maps" + + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" +) + +func PaginatedDSSchema(arguments, resultAttributes map[string]schema.Attribute) schema.Schema { + result := schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "page_num": schema.Int64Attribute{ + Optional: true, + }, + "items_per_page": schema.Int64Attribute{ + Optional: true, + }, + "total_count": schema.Int64Attribute{ + Computed: true, + }, + "results": schema.ListNestedAttribute{ + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: resultAttributes, + }, + }, + }, + } + maps.Copy(result.Attributes, arguments) + return result +} diff --git a/internal/common/dsschema/pagination_schema_test.go b/internal/common/dsschema/pagination_schema_test.go new file mode 100644 index 0000000000..2d61bed750 --- /dev/null +++ b/internal/common/dsschema/pagination_schema_test.go @@ -0,0 +1,63 @@ +package dsschema_test + +import ( + "reflect" + "testing" + + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema" +) + +func TestPaginatedDSSchema(t *testing.T) { + expectedSchema := schema.Schema{ + Attributes: map[string]schema.Attribute{ + "project_id": schema.StringAttribute{ + Required: true, + }, + "id": schema.StringAttribute{ + Computed: true, + }, + "page_num": schema.Int64Attribute{ + Optional: true, + }, + "items_per_page": schema.Int64Attribute{ + Optional: true, + }, + "total_count": schema.Int64Attribute{ + Computed: true, + }, + "results": schema.ListNestedAttribute{ + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "instance_name": schema.StringAttribute{ + Computed: true, + }, + }, + }, + }, + }, + } + + resultSchema := dsschema.PaginatedDSSchema( + map[string]schema.Attribute{ + "project_id": schema.StringAttribute{ + Required: true, + }, + }, + map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "instance_name": schema.StringAttribute{ + Computed: true, + }, + }) + + if !reflect.DeepEqual(resultSchema, expectedSchema) { + t.Errorf("created schema does not matched expected") + } +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 17a9f47bb1..adb40f28ef 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -414,6 +414,7 @@ func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.D atlasuser.PluralDataSource, searchdeployment.DataSource, streaminstance.DataSource, + streaminstance.PluralDataSource, } } diff --git a/internal/service/streaminstance/data_source_stream_instance.go b/internal/service/streaminstance/data_source_stream_instance.go index 74921adac0..277f8fe4e4 100644 --- a/internal/service/streaminstance/data_source_stream_instance.go +++ b/internal/service/streaminstance/data_source_stream_instance.go @@ -26,31 +26,39 @@ type streamInstanceDS struct { func (d *streamInstanceDS) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Computed: true, - }, - "instance_name": schema.StringAttribute{ - Required: true, - }, - "project_id": schema.StringAttribute{ - Required: true, - }, - "data_process_region": schema.SingleNestedAttribute{ - Computed: true, - Attributes: map[string]schema.Attribute{ - "cloud_provider": schema.StringAttribute{ - Computed: true, - }, - "region": schema.StringAttribute{ - Computed: true, - }, + Attributes: DSAttributes(true), + } +} + +// DSAttributes returns the attribute definitions for a single stream instance. +// `withArguments` marks certain attributes as required (for singular data source) or as computed (for plural data source) +func DSAttributes(withArguments bool) map[string]schema.Attribute { + return map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "instance_name": schema.StringAttribute{ + Required: withArguments, + Computed: !withArguments, + }, + "project_id": schema.StringAttribute{ + Required: withArguments, + Computed: !withArguments, + }, + "data_process_region": schema.SingleNestedAttribute{ + Computed: true, + Attributes: map[string]schema.Attribute{ + "cloud_provider": schema.StringAttribute{ + Computed: true, + }, + "region": schema.StringAttribute{ + Computed: true, }, }, - "hostnames": schema.ListAttribute{ - ElementType: types.StringType, - Computed: true, - }, + }, + "hostnames": schema.ListAttribute{ + ElementType: types.StringType, + Computed: true, }, } } diff --git a/internal/service/streaminstance/data_source_stream_instance_test.go b/internal/service/streaminstance/data_source_stream_instance_test.go index 552a49deaf..e98a7354d3 100644 --- a/internal/service/streaminstance/data_source_stream_instance_test.go +++ b/internal/service/streaminstance/data_source_stream_instance_test.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) -func TestAccStreamInstanceDS_basic(t *testing.T) { +func TestAccStreamDSStreamInstance_basic(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acctest.RandomWithPrefix("test-acc-stream") diff --git a/internal/service/streaminstance/data_source_stream_instances.go b/internal/service/streaminstance/data_source_stream_instances.go new file mode 100644 index 0000000000..1ca3cfb1a7 --- /dev/null +++ b/internal/service/streaminstance/data_source_stream_instances.go @@ -0,0 +1,77 @@ +package streaminstance + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + "go.mongodb.org/atlas-sdk/v20231115002/admin" +) + +var _ datasource.DataSource = &streamInstancesDS{} +var _ datasource.DataSourceWithConfigure = &streamInstancesDS{} + +func PluralDataSource() datasource.DataSource { + return &streamInstancesDS{ + DSCommon: config.DSCommon{ + DataSourceName: fmt.Sprintf("%ss", streamInstanceName), + }, + } +} + +type streamInstancesDS struct { + config.DSCommon +} + +type TFStreamInstancesModel struct { + ID types.String `tfsdk:"id"` + ProjectID types.String `tfsdk:"project_id"` + Results []TFStreamInstanceModel `tfsdk:"results"` + PageNum types.Int64 `tfsdk:"page_num"` + ItemsPerPage types.Int64 `tfsdk:"items_per_page"` + TotalCount types.Int64 `tfsdk:"total_count"` +} + +func (d *streamInstancesDS) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = dsschema.PaginatedDSSchema( + map[string]schema.Attribute{ + "project_id": schema.StringAttribute{ + Required: true, + }, + }, + DSAttributes(false)) +} + +func (d *streamInstancesDS) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var streamInstancesConfig TFStreamInstancesModel + resp.Diagnostics.Append(req.Config.Get(ctx, &streamInstancesConfig)...) + if resp.Diagnostics.HasError() { + return + } + + connV2 := d.Client.AtlasV2 + projectID := streamInstancesConfig.ProjectID.ValueString() + itemsPerPage := streamInstancesConfig.ItemsPerPage.ValueInt64Pointer() + pageNum := streamInstancesConfig.PageNum.ValueInt64Pointer() + apiResp, _, err := connV2.StreamsApi.ListStreamInstancesWithParams(ctx, &admin.ListStreamInstancesApiParams{ + GroupId: projectID, + ItemsPerPage: conversion.Int64PtrToIntPtr(itemsPerPage), + PageNum: conversion.Int64PtrToIntPtr(pageNum), + }).Execute() + if err != nil { + resp.Diagnostics.AddError("error fetching results", err.Error()) + return + } + + newStreamInstancesModel, diags := NewTFStreamInstances(ctx, &streamInstancesConfig, apiResp) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + resp.Diagnostics.Append(resp.State.Set(ctx, newStreamInstancesModel)...) +} diff --git a/internal/service/streaminstance/data_source_stream_instances_test.go b/internal/service/streaminstance/data_source_stream_instances_test.go new file mode 100644 index 0000000000..7ee76a7dae --- /dev/null +++ b/internal/service/streaminstance/data_source_stream_instances_test.go @@ -0,0 +1,89 @@ +package streaminstance_test + +import ( + "fmt" + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" + "go.mongodb.org/atlas-sdk/v20231115002/admin" +) + +func TestAccStreamDSStreamInstances_basic(t *testing.T) { + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acctest.RandomWithPrefix("test-acc-stream") + instanceName = acctest.RandomWithPrefix("test-acc-name") + dataSourceName = "data.mongodbatlas_stream_instances.test" + ) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: checkDestroyStreamInstance, + Steps: []resource.TestStep{ + { + Config: streamInstancesDataSourceConfig(orgID, projectName, instanceName, region, cloudProvider), + Check: streamInstancesAttributeChecks(dataSourceName, nil, nil, 1), + }, + }, + }) +} + +func TestAccStreamDSStreamInstances_withPageConfig(t *testing.T) { + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acctest.RandomWithPrefix("test-acc-stream") + instanceName = acctest.RandomWithPrefix("test-acc-name") + dataSourceName = "data.mongodbatlas_stream_instances.test" + ) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: checkDestroyStreamInstance, + Steps: []resource.TestStep{ + { + Config: streamInstancesWithPageAttrDataSourceConfig(orgID, projectName, instanceName, region, cloudProvider), + Check: streamInstancesAttributeChecks(dataSourceName, admin.PtrInt(2), admin.PtrInt(1), 0), + }, + }, + }) +} + +func streamInstancesDataSourceConfig(orgID, projectName, instanceName, region, cloudProvider string) string { + return fmt.Sprintf(` + %s + + data "mongodbatlas_stream_instances" "test" { + project_id = mongodbatlas_stream_instance.test.project_id + } + `, streamInstanceConfig(orgID, projectName, instanceName, region, cloudProvider)) +} + +func streamInstancesWithPageAttrDataSourceConfig(orgID, projectName, instanceName, region, cloudProvider string) string { + return fmt.Sprintf(` + %s + + data "mongodbatlas_stream_instances" "test" { + project_id = mongodbatlas_stream_instance.test.project_id + page_num = 2 + items_per_page = 1 + } + `, streamInstanceConfig(orgID, projectName, instanceName, region, cloudProvider)) +} + +func streamInstancesAttributeChecks(resourceName string, pageNum, itemsPerPage *int, totalCount int) resource.TestCheckFunc { + resourceChecks := []resource.TestCheckFunc{ + resource.TestCheckResourceAttrSet(resourceName, "project_id"), + resource.TestCheckResourceAttrSet(resourceName, "total_count"), + resource.TestCheckResourceAttr(resourceName, "results.#", fmt.Sprint(totalCount)), + } + if pageNum != nil { + resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "page_num", fmt.Sprint(*pageNum))) + } + if itemsPerPage != nil { + resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "items_per_page", fmt.Sprint(*itemsPerPage))) + } + return resource.ComposeTestCheckFunc(resourceChecks...) +} diff --git a/internal/service/streaminstance/model_stream_instance.go b/internal/service/streaminstance/model_stream_instance.go index b1c347dcbc..4871b93a37 100644 --- a/internal/service/streaminstance/model_stream_instance.go +++ b/internal/service/streaminstance/model_stream_instance.go @@ -6,6 +6,8 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "go.mongodb.org/atlas-sdk/v20231115002/admin" ) @@ -59,3 +61,22 @@ func NewTFStreamInstance(ctx context.Context, apiResp *admin.StreamsTenant) (*TF Hostnames: hostnames, }, nil } + +func NewTFStreamInstances(ctx context.Context, streamInstancesConfig *TFStreamInstancesModel, paginatedResult *admin.PaginatedApiStreamsTenant) (*TFStreamInstancesModel, diag.Diagnostics) { + results := make([]TFStreamInstanceModel, len(paginatedResult.Results)) + for i := range paginatedResult.Results { + instance, diags := NewTFStreamInstance(ctx, &paginatedResult.Results[i]) + if diags.HasError() { + return nil, diags + } + results[i] = *instance + } + return &TFStreamInstancesModel{ + ID: types.StringValue(id.UniqueId()), + ProjectID: streamInstancesConfig.ProjectID, + PageNum: streamInstancesConfig.PageNum, + ItemsPerPage: streamInstancesConfig.ItemsPerPage, + TotalCount: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(paginatedResult.TotalCount)), + Results: results, + }, nil +} diff --git a/internal/service/streaminstance/model_stream_instance_test.go b/internal/service/streaminstance/model_stream_instance_test.go index d168f2738b..2ff58a6e27 100644 --- a/internal/service/streaminstance/model_stream_instance_test.go +++ b/internal/service/streaminstance/model_stream_instance_test.go @@ -10,12 +10,6 @@ import ( "go.mongodb.org/atlas-sdk/v20231115002/admin" ) -type sdkToTFModelTestCase struct { - SDKResp *admin.StreamsTenant - expectedTFModel *streaminstance.TFStreamInstanceModel - name string -} - const ( dummyProjectID = "111111111111111111111111" dummyStreamInstanceID = "222222222222222222222222" @@ -26,6 +20,12 @@ const ( var hostnames = []string{"atlas-stream.virginia-usa.a.query.mongodb-dev.net"} +type sdkToTFModelTestCase struct { + SDKResp *admin.StreamsTenant + expectedTFModel *streaminstance.TFStreamInstanceModel + name string +} + func TestStreamInstanceSDKToTFModel(t *testing.T) { testCases := []sdkToTFModelTestCase{ { @@ -78,6 +78,86 @@ func TestStreamInstanceSDKToTFModel(t *testing.T) { } } +type paginatedInstancesSDKToTFModelTestCase struct { + SDKResp *admin.PaginatedApiStreamsTenant + providedConfig *streaminstance.TFStreamInstancesModel + expectedTFModel *streaminstance.TFStreamInstancesModel + name string +} + +func TestStreamInstancesSDKToTFModel(t *testing.T) { + testCases := []paginatedInstancesSDKToTFModelTestCase{ + { + name: "Complete SDK response with configured page options", + SDKResp: &admin.PaginatedApiStreamsTenant{ + Results: []admin.StreamsTenant{ + { + Id: admin.PtrString(dummyStreamInstanceID), + DataProcessRegion: &admin.StreamsDataProcessRegion{ + CloudProvider: cloudProvider, + Region: region, + }, + GroupId: admin.PtrString(dummyProjectID), + Hostnames: hostnames, + Name: admin.PtrString(instanceName), + }, + }, + TotalCount: admin.PtrInt(1), + }, + providedConfig: &streaminstance.TFStreamInstancesModel{ + ProjectID: types.StringValue(dummyProjectID), + PageNum: types.Int64Value(1), + ItemsPerPage: types.Int64Value(2), + }, + expectedTFModel: &streaminstance.TFStreamInstancesModel{ + ProjectID: types.StringValue(dummyProjectID), + PageNum: types.Int64Value(1), + ItemsPerPage: types.Int64Value(2), + TotalCount: types.Int64Value(1), + Results: []streaminstance.TFStreamInstanceModel{ + { + ID: types.StringValue(dummyStreamInstanceID), + DataProcessRegion: tfRegionObject(t, cloudProvider, region), + ProjectID: types.StringValue(dummyProjectID), + Hostnames: tfHostnamesList(t, hostnames), + InstanceName: types.StringValue(instanceName), + }, + }, + }, + }, + { + name: "Without defining page options", + SDKResp: &admin.PaginatedApiStreamsTenant{ + Results: []admin.StreamsTenant{}, + TotalCount: admin.PtrInt(0), + }, + providedConfig: &streaminstance.TFStreamInstancesModel{ + ProjectID: types.StringValue(dummyProjectID), + }, + expectedTFModel: &streaminstance.TFStreamInstancesModel{ + ProjectID: types.StringValue(dummyProjectID), + PageNum: types.Int64Null(), + ItemsPerPage: types.Int64Null(), + TotalCount: types.Int64Value(0), + Results: []streaminstance.TFStreamInstanceModel{}, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resultModel, diags := streaminstance.NewTFStreamInstances(context.Background(), tc.providedConfig, tc.SDKResp) + tc.expectedTFModel.ID = resultModel.ID // id is auto-generated, have no way of defining within expected model + if diags.HasError() { + t.Errorf("unexpected errors found: %s", diags.Errors()[0].Summary()) + } + if !reflect.DeepEqual(resultModel, tc.expectedTFModel) { + t.Errorf("created terraform model did not match expected output") + } + }) + } +} + type tfToSDKCreateModelTestCase struct { tfModel *streaminstance.TFStreamInstanceModel expectedSDKReq *admin.StreamsTenant diff --git a/internal/service/streaminstance/resource_stream_instance_test.go b/internal/service/streaminstance/resource_stream_instance_test.go index 4055376a6d..7536d41611 100644 --- a/internal/service/streaminstance/resource_stream_instance_test.go +++ b/internal/service/streaminstance/resource_stream_instance_test.go @@ -13,7 +13,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) -func TestAccStreamInstanceRS_basic(t *testing.T) { +func TestAccStreamRSStreamInstance_basic(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acctest.RandomWithPrefix("test-acc-stream") diff --git a/website/docs/d/stream_instances.html.markdown b/website/docs/d/stream_instances.html.markdown new file mode 100644 index 0000000000..e5fc13e0dd --- /dev/null +++ b/website/docs/d/stream_instances.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "mongodbatlas" +page_title: "MongoDB Atlas: stream instances" +sidebar_current: "docs-mongodbatlas-datasource-stream-instances" +description: |- + Describes stream instances of a project. +--- + +# Data Source: mongodbatlas_stream_instances + +`mongodbatlas_stream_instances` describes the stream instances defined in a project. + +## Example Usage + +```terraform +data "mongodbatlas_stream_instances" "test" { + project_id = "" +} +``` + +## Argument Reference + +* `project_id` - (Required) Unique 24-hexadecimal digit string that identifies your project. + +* `page_num` - (Optional) Number of the page that displays the current set of the total objects that the response returns. Defaults to `1`. +* `items_per_page` - (Optional) Number of items that the response returns per page, up to a maximum of `500`. Defaults to `100`. + + +## Attributes Reference + +In addition to all arguments above, it also exports the following attributes: + +* `results` - A list where each element contains a Stream Instance. +* `total_count` - Count of the total number of items in the result set. The count might be greater than the number of objects in the results array if the entire result set is paginated. + +### Stream Instance + +* `project_id` - Unique 24-hexadecimal digit string that identifies your project. +* `instance_name` - Human-readable label that identifies the stream instance. +* `data_process_region` - Defines the cloud service provider and region where MongoDB Cloud performs stream processing. See [data process region](#data-process-region). +* `hostnames` - List that contains the hostnames assigned to the stream instance. + +### Data Process Region + +* `cloud_provider` - Label that identifies the cloud service provider where MongoDB Cloud performs stream processing. The [MongoDB Atlas API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/createStreamInstance) describes the valid values. +* `region` - Name of the cloud provider region hosting Atlas Stream Processing. The [MongoDB Atlas API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/createStreamInstance) describes the valid values. + +To learn more, see: [MongoDB Atlas API - Stream Instance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/createStreamInstance) Documentation.