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

[Bug]: removing cache_usage_limits block in aws_elasticache_serverless_cache results in an inconsistent result after apply #36374

Open
emdneto opened this issue Mar 14, 2024 · 2 comments
Labels
bug Addresses a defect in current functionality. service/elasticache Issues and PRs that pertain to the elasticache service.

Comments

@emdneto
Copy link

emdneto commented Mar 14, 2024

Terraform Core Version

1.7.4

AWS Provider Version

5.40.0

Affected Resource(s)

aws_elasticache_serverless_cache

Expected Behavior

After creating the serverless_cache with cache_usage_limits configured, removing the cache_usage_limits block should result in the serverless instance configured to not use limits.

Actual Behavior

If I remove the cache_usage_limits block, results in Error: Provider produced inconsistent result after apply

Relevant Error/Panic Output Snippet

2024-03-13T23:31:26.561-0300 [ERROR] vertex "aws_elasticache_serverless_cache.example" error: Provider produced inconsistent result after apply
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to aws_elasticache_serverless_cache.example, provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value:
│ .cache_usage_limits: block count changed from 0 to 1.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform Configuration Files

resource "aws_elasticache_serverless_cache" "example" {
  engine = "redis"
  name   = "example"

  cache_usage_limits {
    data_storage {
      maximum = 12
      unit    = "GB"
    }
    ecpu_per_second {
      maximum = 1000
    }
  }

  daily_snapshot_time      = "09:00"
  description              = "Test Server"
  major_engine_version     = "7"
  snapshot_retention_limit = 1
  security_group_ids = [aws_security_group.this.id]
  subnet_ids = aws_subnet.this[*].id
}

Steps to Reproduce

  • Create a redis serverless cache instance with cache_usage_limits configured;
  • Remove the change_usage_limits block from the configuration to not use limits anymore and apply;

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

@emdneto emdneto added the bug Addresses a defect in current functionality. label Mar 14, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/elasticache Issues and PRs that pertain to the elasticache service. label Mar 14, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 14, 2024
@leojaardim
Copy link

I'm having the same problem, when I make the change to remove the limits via the AWS console it works without any problems, but when I try via terraform I have the same problem as @emdneto.

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 21, 2024
dszlawski-chaos added a commit to dszlawski-chaos/terraform-aws-elasticache that referenced this issue Sep 9, 2024
There is a bug in terraform provider which causes issues when deploying empty cache_usage_limits block (described here: hashicorp/terraform-provider-aws#36374), passing empty map in var.cache_usage_limits as [var.cache_usage_limits] generates list with one element [ null, ] which causes terraform to pass empty cache_usage_limits hence triggers provider bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/elasticache Issues and PRs that pertain to the elasticache service.
Projects
None yet
Development

No branches or pull requests

3 participants