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

[Enhancement]: Add support for ElastiCache Serverless #34590

Closed
MichaelMandel26 opened this issue Nov 28, 2023 · 12 comments · Fixed by #34951
Closed

[Enhancement]: Add support for ElastiCache Serverless #34590

MichaelMandel26 opened this issue Nov 28, 2023 · 12 comments · Fixed by #34951
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/elasticache Issues and PRs that pertain to the elasticache service.
Milestone

Comments

@MichaelMandel26
Copy link

Description

As announced by AWS, there is now a serverless option of ElastiCache. This issue is to request adding support for it.

Affected Resource(s) and/or Data Source(s)

  • aws_elasticache_replication_group
  • elasticache_cluster

Potential Terraform Configuration

No response

References

Would you like to implement a fix?

No

@MichaelMandel26 MichaelMandel26 added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 28, 2023
@github-actions github-actions bot added the service/elasticache Issues and PRs that pertain to the elasticache service. label Nov 28, 2023
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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 28, 2023
@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 29, 2023
@haraldmeister
Copy link

On the purpose, it would be nice to implement a new resource as proposed in the followings:

Requested Resource(s) and/or Data Source(s)

  • aws_elasticache_serverless (NEW)

Potential Terraform Configuration

resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_subnet" "example" {
  vpc_id     = aws_vpc.example.id
  cidr_block = "10.0.1.0/24"

  tags = {
    Name = "my-subnet"
  }
}

resource "aws_elasticache_subnet_group" "example" {
  name       = "my-cache-subnet"
  subnet_ids = [aws_subnet.example.id]

resource "aws_elasticache_user" "default" {
  user_id       = "defaultUserID"
  user_name     = "default"
  access_string = "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember"
  engine        = "REDIS"
  passwords     = ["password123456789"]
}

resource "aws_elasticache_user_group" "example" {
  engine        = "REDIS"
  user_group_id = "userGroupId"
  user_ids      = [aws_elasticache_user.default.user_id]

  lifecycle {
    ignore_changes = [user_ids]
  }
}


## Redis cluster

resource "aws_elasticache_serverless" "example" {
  cluster_id           = "cluster-example" #mandatory
  engine               = "redis" #mandatory | or "memcached"
  description          = "Description"
  security_group_ids   = ["sg-0exxxxxyyyyzzz"]
  encryption           = "aws/elasticache" # or KMS ARN
  user_group           = aws_elasticache_user_group.example.user_group_id
  subnet_group_name    = aws_elasticache_subnet_group.example.name
  automatic_backup     = false
  usage_limits = {
     memory  =  100 #GB
     compute =  10000 #ECPUs
  }
  tags = {
    Name = "my-serverless-cache"
  }
}

@meetreks
Copy link
Contributor

meetreks commented Dec 6, 2023

I have looked at the changes needed and picked it up. Will update in this forum.

@meetreks
Copy link
Contributor

Done with the resource creation, writing some acpt tests. Will aim for this weeks release for sure.

@meetreks
Copy link
Contributor

I ran some tests and can see the config working on the console....last bits and pieces to tidy up. Getting some panic errors which I hope will be fixed tody

@meetreks
Copy link
Contributor

Most tests work now, just some minor tidy ups and some documentation to go. Nearly there...

@meetreks
Copy link
Contributor

ACCP tests are all fine. Ran a few more today and all are working as intended. Getting ready for the PR now!

@meetreks
Copy link
Contributor

Please track this PR for more details -- #34951
I will watch the pipeline and see if anything comes out of the woodwork

@github-actions github-actions bot added this to the v5.32.0 milestone Jan 3, 2024
Copy link

This functionality has been released in v5.32.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@Menahem1
Copy link

Hello,
How to get the endpoint (attribute reference) with only the address on string format ?
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_serverless_cache

@TonyLovesDevOps
Copy link
Contributor

TonyLovesDevOps commented Jan 12, 2024

Hello, How to get the endpoint (attribute reference) with only the address on string format ? https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_serverless_cache

It seems that the endpoint attribute is exposed as a list of maps w/ address & port keys. This seemed to work for me:

resource "aws_elasticache_serverless_cache" "example" {
  engine = "memcached"
  name   = "example"
}

output "example_endpoint_address" {
  value = aws_elasticache_serverless_cache.example.endpoint.0.address
}

I'm not sure if this data structure could look different with different configurations (e.g. multiple maps with different address and port values in the list), so caveat emptor.

Copy link

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 Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/elasticache Issues and PRs that pertain to the elasticache service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants