Create it
- Console
- CLI and API
- Coding agent
- Open the environment, then New service › Blueprint.
- Find Amazon ElastiCache Serverless for Valkey in the catalog and pick the major version.
- Fill in the variables. Required ones are marked; the others use their defaults.
- Create the service, and deploy it now or later.
Variables and outputs
Generated fromqbm.yml at AWS/valkey-serverless/9/1.2.1, the manifest the Console form is built from.
All 10 variables
All 10 variables
All 10 outputs
All 10 outputs
Reference
From the Blueprint’s README. Creates an AWS ElastiCache Serverless cache on Valkey 9. There is no node type or shard count to pick: AWS scales the cache with the load and bills the data stored and the ECPUs consumed. Traffic is encrypted in transit, data is encrypted at rest, and access goes through a password-protected user. For a cache with a fixed node type, use theaws-elasticache-valkey blueprint instead.
Connecting
Three things differ from the node-based blueprint:- Use a cluster-mode client. A serverless cache always runs in cluster mode, and AWS only supports clients that speak the cluster protocol. Multi-key commands only work on keys that share a hash slot; across slots they fail with
CROSSSLOT. - Two ports. The cache serves writes and consistent reads on
6379and replica reads on6380, on the same hostname. Many clients open connections to both, so the security group opens both. - A user name is required. Applications authenticate as the
appuser withvalkey_password. There is no auth token and no usabledefaultuser.
valkey_url output carries all of it: rediss://app:<password>@<host>:6379. The rediss:// scheme is correct: Valkey speaks the Redis protocol, and TLS is always on.
Variables
Required
The limit is 32 characters to leave room for the suffixes of the user id (
<name>-app) and the user group id (<name>-users), which ElastiCache caps at 40.
Credentials
In the Console, leaving the field blank omits it. Through the API or Terraform, omit the variable rather than sending an empty string: the platform rejects an empty variable value.
Changing
valkey_password replaces the password in place, without touching the cache or its data. AWS takes a few minutes to apply it (close to four in testing). Applications still holding the old one must be redeployed with the new value.
Usage limits
With both at
0, the cache scales as far as AWS allows. A cap bounds the bill as well as the capacity.
The blueprint always sends both limits, with 0 translated to the AWS maximum. A cache whose limits are removed altogether cannot be updated: AWS rejects the call with No modifications were requested.
Network
By default the cache is attached to the Qovery cluster network. The subnets come from the ElastiCache subnet group created at cluster bootstrap (
elasticache-<cluster vpc id>): one subnet per Availability Zone, three at most. The security group is created by the blueprint, named qovery-valkey-serverless-<name>, and opens 6379–6380 to every CIDR of the VPC. It does not reuse the cluster workers security group, which opens 6379 only.
ElastiCache cannot move a serverless cache to other subnets, so subnet_ids is read once. A later change to the variable or to the cluster’s subnet group leaves the cache where it is.
Backups
Deleting the service deletes the cache without a final snapshot. The AWS Terraform provider has no argument for one on a serverless cache. To keep the data, take a manual snapshot in AWS before deleting the service.
IAM role
Outputs
Access control
The blueprint creates one ElastiCache user and one user group, both on thevalkey engine, and attaches the group to the cache:
- user
<name>-app, user nameapp, access stringon ~* &* +@all(every key, every pub/sub channel, every command), authenticated by password; - user group
<name>-users, holding that user.
Lifecycle ignore_changes
subnet_ids— set at creation; see Network.
Assuming an IAM role
Optional. Set therole_arn variable to make the blueprint assume an IAM role instead of using the configured credentials directly; leave it unset to use them as is.
- Format:
arn:aws:iam::<account-id>:role/<name>, with an optional path (role/<path>/<name>). Theaws-cn,aws-us-govandaws-iso*partitions are accepted too. - The role must be in the same AWS account as the credentials; cross-account roles are not supported.
- The role’s trust policy must allow the deploy credentials’ IAM principal to assume it.
- The role itself must carry the permissions listed in Required AWS IAM permissions.
Required AWS IAM permissions
WhenUnlessrole_arnis set, Terraform makes these AWS calls as the assumed role, so the permissions below belong to that role. Access to a user-provided Terraform backend, if you use one, is not covered byrole_arn: it keeps using the deploy credentials.
role_arn is set, the credentials used to deploy this blueprint must allow the actions below. The EC2 read actions let Terraform look up the cluster VPC and its subnets. ec2:CreateVpcEndpoint, the ec2:CreateTags that goes with it and iam:CreateServiceLinkedRole are the ones the AWS managed policy AmazonElastiCacheFullAccess grants for serverless caches: ElastiCache places a VPC endpoint in the chosen subnets.