-
Notifications
You must be signed in to change notification settings - Fork 178
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: mongodbatlas_search_deployment
data source with acceptance tests and docs
#1621
Conversation
5815052
to
71b377f
Compare
71b377f
to
6fc6e3e
Compare
search_deployment
data source with acceptance tests and docs
search_deployment
data source with acceptance tests and docsmongodbatlas_search_deployment
data source with acceptance tests and docs
DSCommon | ||
} | ||
|
||
func (d *SearchDeploymentDS) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { |
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.
this is more of a generic question: in the context of a data source I don't understand the concept of Computed
: aren't they all computed?
On the other side I'd imagine Required
means that if we don't fill it up with the backend response terraform would raise an error, but why do we really need to set it as required? Couldn't we just leave it as Optional?
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.
in the context of a data source, aren't they all computed?
Not exactly. When using a data source there are some attributes that need to be provided by the user in order to identify the resource that will be fetched. In this case the resource is identified through the project_id
and cluster_name
, which is why they are marked as required.
You will see this is also clarified in the documentation of the data source, separating the concept of arguments (attributes that have to be defined), and then an attributes sections for values that are exported (or as we call computed).
@@ -31,12 +31,13 @@ var _ resource.ResourceWithImportState = &SearchDeploymentRS{} | |||
|
|||
const ( | |||
searchDeploymentDoesNotExistsError = "ATLAS_FTS_DEPLOYMENT_DOES_NOT_EXIST" | |||
searchDeploymentName = "search_deployment" |
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: this looks like a separate PR? no need to do it now, but consider it for the next time
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.
Yes true. Tried to keep this PR as clean as possible with respect to the resource implementation, but you usually some pending details always get adjusted when implementing the data source.
merged in #1633 |
Description
Jira ticket: INTMDB-1273
Currently open as draft pull request as we have to make use of a dev preview of the Atlas SDK.
This PR includes:
mongodbatlas_search_deployment
data sourceType of change:
Required Checklist:
Further comments