-
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: Adds support for skip_default_alerts_settings
in mongodbatlas_organization
resource & data sources
#2933
base: master
Are you sure you want to change the base?
Conversation
APIx bot: a message has been sent to Docs Slack channel |
docs/data-sources/organization.md
Outdated
@@ -27,6 +27,6 @@ In addition to all arguments above, the following attributes are exported: | |||
* `multi_factor_auth_required` - (Optional) Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/. | |||
* `restrict_employee_access` - (Optional) Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/. | |||
* `gen_ai_features_enabled` - (Optional) Flag that indicates whether this organization has access to generative AI features. This setting only applies to Atlas Commercial and defaults to `true`. With this setting on, Project Owners may be able to enable or disable individual AI features at the project level. To learn more, see https://www.mongodb.com/docs/generative-ai-faq/. | |||
|
|||
* `skip_default_alerts_settings` - (Optional) Disables automatic alert creation and defaults to `true`. When set to true, no organization level alerts will be created automatically. |
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.
* `skip_default_alerts_settings` - (Optional) Disables automatic alert creation and defaults to `true`. When set to true, no organization level alerts will be created automatically. | |
* `skip_default_alerts_settings` - (Optional) Disables automatic alert creation. When set to true, Atlas doesn't automatically create organization-level alerts. Defaults to `true`. |
Favor active voice and present tense. Default values generally come after the 'core' description.
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.
@maastha @lmkerbey-mdb Terraform (and other IaCs) are intentionally defaulting to true to avoid drift changes in the customer state configurations (since alerts would be created as a side-effect). Should we add a small note about to explain why we are defaulting to true?
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 I think the 'why' would make sense since we diverge from API behavior which clearly states the default value to be 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.
Updated and added a note about we we default to true
docs/data-sources/organizations.md
Outdated
@@ -32,5 +32,6 @@ data "mongodbatlas_organizations" "test" { | |||
* `multi_factor_auth_required` - (Optional) Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/. | |||
* `restrict_employee_access` - (Optional) Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/. | |||
* `gen_ai_features_enabled` - (Optional) Flag that indicates whether this organization has access to generative AI features. This setting only applies to Atlas Commercial and defaults to `true`. With this setting on, Project Owners may be able to enable or disable individual AI features at the project level. To learn more, see https://www.mongodb.com/docs/generative-ai-faq/. | |||
|
|||
* `skip_default_alerts_settings` - (Optional) Disables automatic alert creation and defaults to `true`. When set to true, no organization level alerts will be created automatically. |
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.
See above.
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.
updated
docs/resources/organization.md
Outdated
@@ -33,6 +33,8 @@ resource "mongodbatlas_organization" "test" { | |||
* `multi_factor_auth_required` - (Optional) Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/. | |||
* `restrict_employee_access` - (Optional) Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/. | |||
* `gen_ai_features_enabled` - (Optional) Flag that indicates whether this organization has access to generative AI features. This setting only applies to Atlas Commercial and defaults to `true`. With this setting on, Project Owners may be able to enable or disable individual AI features at the project level. To learn more, see https://www.mongodb.com/docs/generative-ai-faq/. | |||
* `skip_default_alerts_settings` - (Optional) Disables automatic alert creation and defaults to `true`. When set to true, no organization level alerts will be created automatically. |
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.
See above.
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.
updated
@@ -82,6 +82,11 @@ func Resource() *schema.Resource { | |||
Optional: true, | |||
Default: true, | |||
}, | |||
"skip_default_alerts_settings": { |
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.
is there a way to define the default value here?
I could only find the following in the docs so just wondering if you know:
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.
https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#computed
The above clarifies that default cannot be used with Computed.
The problem is that if backend ever returns a false
for an org that may be created with <1.25 (assuming this would be released in 1.25), then:
- user config will not have this attr specified
- so TF will try to use the default
true
value - during Read() TF will get
false
from the backend - since we cannot mark the attribute as
Computed
if it also hasDefault
, TF will plan to change the value to defaulttrue
resulting in below non-empty plan for orgs created with older versions of our provider:
~ update in-place
Terraform will perform the following actions:
# mongodbatlas_organization.test will be updated in-place
~ resource "mongodbatlas_organization" "test" {
id = "b3JnX2lk:Njc3Mjk1Y2Y4ZTMyNWI0MjExOTVjMGJl"
name = "manual-org-renamed-3-def"
~ skip_default_alerts_settings = false -> true
# (10 unchanged attributes hidden)
}
We may be able to define Default: true
here ONLY if it can be guaranteed from the backend for all IaC orgs created with older versions of our provider to return true
for this attribute. But we should not go this route because APIx 1 may do a one-time 'backfill' of this attr to true
for IaC orgs but it may be possible in the future for users to use lower provider version for some reason and create new orgs. Does that make sense?
This PR has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy! |
Description
Adds support for
skip_default_alerts_settings
inmongodbatlas_organization
resource & data sourcesLink to any related issue(s): CLOUDP-282824
Type of change:
Required Checklist:
Further comments