-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-opensearchservice: cannot disable logging #29200
Comments
I am not sure if this is a bug from cloudformation but we should note this in the CDK doc. Thank you for the report. |
|
I think perhaps there was a miscommunication here, as I feel the PR doesn't accurately describe the situation and actually increases confusion. The PR creates the assumption that it is possible to disable OpenSearch logging if you set the parameters explicitly to false, but the CDK in its current form does not behave that way. Take a look at
Cloudformation needs THOSE logPublishingOptions to contain "enabled: false" for it to have any effect |
@SigniantJoe Do you mean if I specify this way new opensearch.Domain(this, 'Domain', {
version: opensearch.EngineVersion.OPENSEARCH_2_11,
logging: {
slowSearchLogEnabled: false,
appLogEnabled: false,
slowIndexLogEnabled: false,
},
}) it should synthesize to "LogPublishingOptions": {
"ES_APPLICATION_LOGS": {
"Enabled": false
},
"SEARCH_SLOW_LOGS": {
"Enabled": false
},
"INDEX_SLOW_LOGS": {
"Enabled": false
}
}, but we are actually getting
If yes, I agree with you. My question is - if I have enabled it like new opensearch.Domain(this, 'Domain', {
version: opensearch.EngineVersion.OPENSEARCH_2_11,
logging: {
slowSearchLogEnabled: true,
appLogEnabled: true,
slowIndexLogEnabled: true,
},
}) Now I need to disable them and update to new opensearch.Domain(this, 'Domain', {
version: opensearch.EngineVersion.OPENSEARCH_2_11,
}) Will they be disabled from the enabled state? If not, I think #29202 is still relevant? |
Reopen this issue as it's still relevant. |
|
### Issue # (if applicable) Closes #29200 ### Reason for this change Disabling the logging from the enabled status requires an explicit `false`. This PR adds the description in the doc. ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@pahud you are correct in your latest interpretation about getting empty logPublishingOptions when it should be populated. This means that if you deploy with logging enabled then try to deploy with logging disabled, logging will remain enabled. I actually made my own PR with unit tests for this, which I think explains the issue: #29205 It's currently stuck waiting on me to updating snapshots, which I'm looking into |
Describe the bug
Enabling logging on OpenSearch clusters will populate LogPublishingOptions in the output template, but disabling logging leaves LogPublishingOptions empty so the cluster will retain the previous logging config. I don't see any documentation saying that enabling logging is a one-way trip, so I think this is a bug.
Specifically, I'm talking about these logging props:
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
If you don't need the current behaviour, then have it perform the expected behaviour from above.
If there is a good reason it works that way or you want backwards-compatibility, then maybe have logging props like appLogEnabled default to some non-boolean value (e.g.
-1
). If left default (not specified by user), then LogPublishingOptions can be empty. If the user explicitly specifies either true or false, then populate the LogPublishingOptions to enable or disable logging as appropriate.Additional Information/Context
An environment hit the limit on cloudwatch resource policies, so I'm working on a change related to the new (much appreciated)
suppressLogsResourcePolicy
prop. The way things are currently, I'll have to manually (shudder) disable logging on a cluster to clear up policy space before I can deploy the new multi-cluster logging resource policy.CDK CLI Version
2.128.0
Framework Version
No response
Node.js Version
v18.18.2
OS
OSX
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: