-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new mongodbatlas_stream_connection
and mongodbatlas_stream_connections
data sources
#1757
Conversation
366b531
to
7ce5f8d
Compare
|
||
|
||
To learn more, see: [MongoDB Atlas API - Stream Connection](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/getStreamConnection) Documentation. | ||
The [Terraform Provider Examples Section](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/examples/atlas-streams/README.md) also contains details on the overall support for Atlas Streams in Terraform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
referenced README file is defined in #1752
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
func TestAccStreamDSStreamConnection_kafkaPlaintext(t *testing.T) { | ||
var ( | ||
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] not need to address it here. I am wondering if we should define MONGODB_ATLAS_ORG_ID
and other env vars in a common file and then import them. In this way, if we change the env var we just need to update it in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could remove some boilerplate for sure, on the other hand it does help to see want env variables are being used for each test so dont have a strong opinion
CheckDestroy: CheckDestroyStreamConnection, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: streamConnectionsDataSourceConfig(kafkaStreamConnectionConfig(orgID, projectName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q - not blocking] Since all the data source tests use a resource. Couldn't we just have one acceptance test file where we have data source and resource test together? I see how this would decrease the amount of resources that we need to run the acceptance tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good point, I did go for this option in the case of search_deployment resource as execution times were quite long.
For this case the creation/update/delete of instance connections is very fast, so saw no harm in leaving in separate tests. One test case, Cluster connection type, does require creating a cluster but when running locally you can reference existing an existing cluster using env variables.
@@ -0,0 +1,57 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add a new example in the example folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
7ce5f8d
to
c5ec932
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but added some style nits!
|
Description
Link to any related issue(s): CLOUDP-215323
Includes unit testing, acceptance tests, and documentation.
Type of change:
Required Checklist:
Further comments