Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Terraform module to create AWS MemoryDB resources 🇺🇦

License

NotificationsYou must be signed in to change notification settings

terraform-aws-modules/terraform-aws-memory-db

Terraform module which creates AWS MemoryDB resources.

Usage

Seeexamples directory for working examples to reference:

module"memory_db" {source="terraform-aws-modules/memory-db/aws"# Clustername="example"description="Example MemoryDB cluster"engine="valkey"engine_version="7.3"auto_minor_version_upgrade=truenode_type="db.t4g.small"num_shards=2num_replicas_per_shard=2tls_enabled=truesecurity_group_ids=["sg-12345678"]maintenance_window="sun:23:00-mon:01:30"sns_topic_arn="arn:aws:sns:us-east-1:012345678910:example-topic"snapshot_retention_limit=7snapshot_window="05:00-09:00"# Usersusers={    admin= {      user_name="admin-user"      access_string="on ~* &* +@all"      passwords= ["YouShouldPickAStrongSecurePassword987!"]      tags= { User="admin" }    }    readonly= {      user_name="readonly-user"      access_string="on ~* &* -@all +@read"      passwords= ["YouShouldPickAStrongSecurePassword123!"]      tags= { User="readonly" }    }  }# ACLacl_name="example-acl"acl_tags={ Acl="custom" }# Parameter groupparameter_group_name="example-param-group"parameter_group_description="Example MemoryDB parameter group"parameter_group_family="memorydb_redis6"parameter_group_parameters=[    {      name="activedefrag"      value="yes"    }  ]parameter_group_tags={    ParameterGroup="custom"  }# Subnet groupsubnet_group_name="example-subnet-group"subnet_group_description="Example MemoryDB subnet group"subnet_ids=["subnet-1fe3d837","subnet-129d66ab","subnet-1211eef5"]subnet_group_tags={    SubnetGroup="custom"  }tags={    Terraform="true"    Environment="dev"  }}

Conditional Creation

The following values are provided to toggle on/off creation of the associated resources as desired:

module"memory_db" {source="terraform-aws-modules/memory-db/aws"# Disable creation of cluster and all resourcescreate=false# Disable creation of userscreate_users=false# Disable creation of ACL - an ACL will need to be providedcreate_acl=falseacl_name="existing_acl"# Disable creation of parameter group - a parameter group will need to be providedcreate_parameter_group=falseparameter_group_name="existing_parameter_group"# Disable creation of subnet group - a subnet group will need to be providedcreate_subnet_group=falsesubnet_group_name="existing_subnet_group"# ... omitted}

Examples

Examples codified under theexamples are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!

Requirements

NameVersion
terraform>= 1.5.7
aws>= 6.0

Providers

NameVersion
aws>= 6.0

Modules

No modules.

Resources

NameType
aws_memorydb_acl.thisresource
aws_memorydb_cluster.thisresource
aws_memorydb_parameter_group.thisresource
aws_memorydb_subnet_group.thisresource
aws_memorydb_user.thisresource

Inputs

NameDescriptionTypeDefaultRequired
acl_nameName of ACL to be created ifcreate_acl istrue, otherwise its the name of an existing ACL to use ifcreate_acl isfalsestringnullno
acl_tagsAdditional tags for the ACL createdmap(string){}no
acl_use_name_prefixDetermines whetheracl_name is used as a prefixboolfalseno
acl_user_namesList of externally created user names to associate with the ACLlist(string)[]no
auto_minor_version_upgradeWhen set totrue, the cluster will automatically receive minor engine version upgrades after launch. Defaults totrueboolnullno
createDetermines whether resources will be created - affects all resourcesbooltrueno
create_aclDetermines whether to create ACL specifiedbooltrueno
create_parameter_groupDetermines whether to create parameter group specifiedbooltrueno
create_subnet_groupDetermines whether to create subnet group specifiedbooltrueno
create_usersDetermines whether to create users specifiedbooltrueno
data_tieringMust be set totrue when using a data tiering node typeboolnullno
descriptionDescription for the cluster. Defaults toManaged by Terraformstringnullno
engineThe engine that will run on your nodes. Supported values areredis andvalkeystringnullno
engine_versionVersion number of the engine to be used for the cluster. Downgrades are not supportedstringnullno
final_snapshot_nameName of the final cluster snapshot to be created when this resource is deleted. If omitted, no final snapshot will be madestringnullno
kms_key_arnARN of the KMS key used to encrypt the cluster at reststringnullno
maintenance_windowSpecifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the formatddd:hh24:mi-ddd:hh24:mistringnullno
multi_region_cluster_nameThe multi region cluster identifier if part of a multi region clusterstringnullno
nameCluster name - also default name used on all resources if more specific resource names are not providedstring""no
node_typeThe compute and memory capacity of the nodes in the cluster. See AWS documentation onsupported node types as well asvertical scalingstringnullno
num_replicas_per_shardThe number of replicas to apply to each shard, up to a maximum of 5. Defaults to1 (i.e. 2 nodes per shard)numbernullno
num_shardsThe number of shards in the cluster. Defaults to1numbernullno
parameter_group_descriptionDescription for the parameter group. Defaults toManaged by Terraformstringnullno
parameter_group_familyThe engine version that the parameter group can be used withstringnullno
parameter_group_nameName of parameter group to be created ifcreate_parameter_group istrue, otherwise its the name of an existing parameter group to use ifcreate_parameter_group isfalsestringnullno
parameter_group_parametersA list of parameter maps to applylist(map(string))[]no
parameter_group_tagsAdditional tags for the parameter group createdmap(string){}no
parameter_group_use_name_prefixDetermines whetherparameter_group_name is used as a prefixboolfalseno
portThe port number on which each of the nodes accepts connections. Defaults to6379numbernullno
regionRegion where this resource will be managed. Defaults to the Region set in the provider configurationstringnullno
security_group_idsSet of VPC Security Group ID-s to associate with this clusterlist(string)nullno
snapshot_arnsList of ARN-s that uniquely identify RDB snapshot files stored in S3. The snapshot files will be used to populate the new clusterlist(string)nullno
snapshot_nameThe name of a snapshot from which to restore data into the new clusterstringnullno
snapshot_retention_limitThe number of days for which MemoryDB retains automatic snapshots before deleting them. When set to0, automatic backups are disabled. Defaults to0numbernullno
snapshot_windowThe daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your shard. Example:05:00-09:00stringnullno
sns_topic_arnARN of the SNS topic to which cluster notifications are sentstringnullno
subnet_group_descriptionDescription for the subnet group. Defaults toManaged by Terraformstringnullno
subnet_group_nameName of subnet group to be created ifcreate_subnet_group istrue, otherwise its the name of an existing subnet group to use ifcreate_subnet_group isfalsestringnullno
subnet_group_tagsAdditional tags for the subnet group createdmap(string){}no
subnet_group_use_name_prefixDetermines whethersubnet_group_name is used as a prefixboolfalseno
subnet_idsSet of VPC Subnet ID-s for the subnet group. At least one subnet must be providedlist(string)[]no
tagsA map of tags to use on all resourcesmap(string){}no
tls_enabledA flag to enable in-transit encryption on the cluster. When set tofalse, theacl_name must beopen-access. Defaults totrueboolnullno
use_name_prefixDetermines whethername is used as a prefix for the clusterboolfalseno
usersA map of user definitions (maps) to be created
map(object({
user_name = string
access_string = string
type = optional(string, "password")
passwords = optional(list(string))
tags = optional(map(string), {})
}))
{}no

Outputs

NameDescription
acl_arnThe ARN of the ACL
acl_idName of the ACL
acl_minimum_engine_versionThe minimum engine version supported by the ACL
cluster_arnThe ARN of the cluster
cluster_endpoint_addressDNS hostname of the cluster configuration endpoint
cluster_endpoint_portPort number that the cluster configuration endpoint is listening on
cluster_engine_patch_versionPatch version number of the Redis engine used by the cluster
cluster_idCluster name
cluster_shardsSet of shards in this cluster
parameter_group_arnThe ARN of the parameter group
parameter_group_idName of the parameter group
subnet_group_arnARN of the subnet group
subnet_group_idName of the subnet group
subnet_group_vpc_idThe VPC in which the subnet group exists
usersMap of attributes for the users created

License

Apache-2.0 Licensed. SeeLICENSE.

Sponsor this project

  •  

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp