Skip to content
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

enabled_cloudwatch_logs_exports description is incorrect #36

Closed
razorsedge opened this issue Jun 30, 2021 · 3 comments · Fixed by #99
Closed

enabled_cloudwatch_logs_exports description is incorrect #36

razorsedge opened this issue Jun 30, 2021 · 3 comments · Fixed by #99
Labels
bug 🐛 An issue with the system

Comments

@razorsedge
Copy link

Describe the Bug

The input variable enabled_cloudwatch_logs_exports description is incorrect compared to the the Terraform AWS provider version 3.47.0. Resource: aws_docdb_cluster enabled_cloudwatch_logs_exports states:

enabled_cloudwatch_logs_exports - (Optional) List of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: audit, profiler.

The resulting error is:

Error: expected enabled_cloudwatch_logs_exports.1 to be one of [audit profiler], got error

  on .terraform/modules/documentdb_cluster/main.tf line 63, in resource "aws_docdb_cluster" "default":
  63:   enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports

Expected Behavior

Variable documentation should not contradict the AWS provider's capabilities.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set module input to enabled_cloudwatch_logs_exports = ["audit", "error", "general", "slowquery"]
  2. Run 'terraform plan'
  3. See error

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • Module Version: 0.13.0
$ terraform version
Terraform v0.13.7
+ provider registry.terraform.io/hashicorp/aws v3.46.0
+ provider registry.terraform.io/hashicorp/external v2.1.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0
@razorsedge razorsedge added the bug 🐛 An issue with the system label Jun 30, 2021
@viyullas
Copy link

viyullas commented Aug 3, 2021

I was coming to say the same thing :-D

@ntman4real
Copy link

Still an issue, fyi, using tf 1.0.9

@5136Siegfried
Copy link

Still having this issue :

module.documentdb-cluster.aws_docdb_cluster.default[0]: Refreshing state... [id=*******************************]
╷
│ Error: expected enabled_cloudwatch_logs_exports.1 to be one of [audit profiler], got error
│ 
│   with module.documentdb-cluster.aws_docdb_cluster.default[0],
│   on .terraform/modules/documentdb-cluster/main.tf line 69, in resource "aws_docdb_cluster" "default":
│   69:   enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports
│ 
╵
╷
│ Error: expected enabled_cloudwatch_logs_exports.2 to be one of [audit profiler], got general
│ 
│   with module.documentdb-cluster.aws_docdb_cluster.default[0],
│   on .terraform/modules/documentdb-cluster/main.tf line 69, in resource "aws_docdb_cluster" "default":
│   69:   enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports
│ 
╵
╷
│ Error: expected enabled_cloudwatch_logs_exports.3 to be one of [audit profiler], got slowquery
│ 
│   with module.documentdb-cluster.aws_docdb_cluster.default[0],
│   on .terraform/modules/documentdb-cluster/main.tf line 69, in resource "aws_docdb_cluster" "default":
│   69:   enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports
│ 
╵
ERROR: Job failed: exit code 1

The solution is to apply possibles values from aws Doc :

-- logs_exports = ["audit","error","general","slowquery"]
=> 
++ logs_exports = ["audit","profiler"]

Please consider updating your ReadME with this.

Result :

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
Terraform will perform the following actions:
  # module.documentdb-cluster.aws_docdb_cluster.default[0] will be updated in-place
  ~ resource "aws_docdb_cluster" "default" {
      ~ enabled_cloudwatch_logs_exports = [
          + "audit",
          + "profiler",
        ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants