-
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: support new tags attribute in cluster, advanced_cluster, and serverless_instance #1461
Conversation
f679d4a
to
160db5b
Compare
Type: schema.TypeSet, | ||
Optional: true, | ||
Elem: &schema.Resource{ |
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.
When comparing to labels
attribute schema, no Set
function is defined as it is not needed. Using hashicorp/terraform#10520 (comment) as reference, the default implementation will properly hash the entire data structure.
…rverless_instance
160db5b
to
73caa32
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.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
Passed | Infrastructure as Code | 0 0 0 0 | View in Orca |
Passed | Vulnerabilities | 0 0 0 0 | View in Orca |
Passed | Secrets | 0 0 0 0 | View in Orca |
Computed: true, | ||
Type: schema.TypeSet, | ||
Computed: true, | ||
Deprecated: fmt.Sprintf(DeprecationByDateWithReplacement, "November 2023", "tags"), |
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 might be useful to have constants with deprecation dates so it's easier to see next deprecation dates
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 could be helpful, but I believe configuring due date within jira tickets will be our best bet to make sure we are aware of removing deprecated fields.
resource.TestCheckResourceAttr(dataSourceName, "tags.#", "2"), | ||
resource.TestCheckResourceAttr(dataSourceName, "tags.0.key", "key 1"), | ||
resource.TestCheckResourceAttr(dataSourceName, "tags.0.value", "value 1"), | ||
resource.TestCheckResourceAttr(dataSourceName, "tags.1.key", "key 2"), |
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'd be nice to have a less verbose way to check tags, or other attributes
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.
Agree.
I have looked into one alternative to simplify defining assertions of the terraform state, this is the PoC: #1448.
@@ -74,15 +75,25 @@ Specifies BI Connector for Atlas configuration. | |||
* `enabled` - Specifies whether or not BI Connector for Atlas is enabled on the cluster.l | |||
* `read_preference` - Specifies the read preference to be used by BI Connector for Atlas on the cluster. Each BI Connector for Atlas read preference contains a distinct combination of [readPreference](https://docs.mongodb.com/manual/core/read-preference/) and [readPreferenceTags](https://docs.mongodb.com/manual/core/read-preference/#tag-sets) options. For details on BI Connector for Atlas read preferences, refer to the [BI Connector Read Preferences Table](https://docs.atlas.mongodb.com/tutorial/create-global-writes-cluster/#bic-read-preferences). | |||
|
|||
### Tags | |||
|
|||
Key-value pairs used for tagging and categorizing the cluster. Each key and value has a maximum length of 255 characters. |
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.
I don't see any check here for limit 255 in key & values, shouldn't we do it here or it's ok if it's only done in the SDK?
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.
Within the terraform provider we currently are not defining any validations, such as regex, min/max lengths, or enums. We could analyse what benefit benefit it brings to the user taking into account the additional maintenance we add to the provider.
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.
Thanks @AgustinBettati! I commented with mostly copy nits. I do recommend that you use a dochub URL instead of a direct link to the page. https://dochub.mongodb.org/core/add-cluster-tag-atlas.
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!
will merge, if any future comments appear will address in a followup PR. |
Description
Ticket: INTMDB-515
tags
attribute in cluster, advanced_cluster, and serverless_instance resource and data sources.labels
attribute defined in cluster, advanced_cluster.Type of change:
Required Checklist:
Further comments
Testing comments
Acceptance tests
Manual verification