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

Fail to add new event_categories to an existing aws_db_event_subscription #21319

Closed
vnourdin opened this issue Oct 15, 2021 · 6 comments
Closed
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service.

Comments

@vnourdin
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.63.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

  • aws_db_event_subscription

Terraform Configuration Files

I have a Terraform module that do a db event subscription. I try to add new event categories to subscribe to, but it fails.

locals {
  rds_event_subscription_name = "${var.rds_name}-rds-event-subscription"
}

resource "aws_db_event_subscription" "rds_event_subscription" {
  name      = local.rds_event_subscription_name
  sns_topic = data.terraform_remote_state.lambda.outputs.sns_topic_arn

  source_ids       = var.event_source_ids
  source_type      = var.event_source_type
  event_categories = var.event_categories
  enabled          = var.enable_event_subscription

  tags = merge(
    var.custom_tags,
    { "name" = local.rds_event_subscription_name }
  )
}

Terraform plan

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.my_module.module.rds_event_subscription.aws_db_event_subscription.rds_event_subscription will be updated in-place
  ~ resource "aws_db_event_subscription" "rds_event_subscription" {
      ~ event_categories = [
          + "deletion",
          + "failure",
          + "maintenance",
          + "recovery",
          + "restoration",
            # (1 unchanged element hidden)
        ]
        id               = "my-subscription"
        name             = "my-subscription"
        tags             = {
            "name" = "my-subscription"
        }
        # (7 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Expected Behavior

It should add those events category ad showed by the plan.

Actual Behavior

│ Error: error updating RDS Event Subscription (my-subscription): InvalidParameterCombination: If SourceType is null, Categories must also be null.
│   status code: 400, request id: 44c82231-d1f1-41fe-9423-001ea409a5be
│ 
│   with module.my_module.module.rds_event_subscription.aws_db_event_subscription.rds_event_subscription,
│   on .terraform/modules/my_module.rds_event_subscription/rds-event-subscription/main.tf line 5, in resource "aws_db_event_subscription" "rds_event_subscription":
│    5: resource "aws_db_event_subscription" "rds_event_subscription" {

Steps to Reproduce

  1. terraform apply a subscription with only one category
  2. change your calling code to add more modules
  3. terraform apply

References

I see this problem should have been resolved a long time ago :

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/rds Issues and PRs that pertain to the rds service. labels Oct 15, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 15, 2021
@vnourdin
Copy link
Author

I just make it works by downgrading to provider 3.40.0, something happen between those versions.

@ewbankkit
Copy link
Contributor

@vnourdin Thanks for raising this issue.
I think that if you pin your provider version to v3.60.0 then this regression will disappear.
We will get this fixed.

@vnourdin
Copy link
Author

vnourdin commented Oct 15, 2021

Indeed, it's working in 3.60.0 too !
Thanks 🙏

@kamilturek
Copy link
Collaborator

Fixed by #21338.

@ewbankkit
Copy link
Contributor

@kamilturek Thanks, yes something was a bit screwy with the merge of #21338 so it didn't automatically close this issue.

@github-actions
Copy link

github-actions bot commented Jun 2, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
3 participants