Last active
April 12, 2023 03:27
-
-
Save vinodjayachandran/86d2f24a74a1a01481c09818ec38fb85 to your computer and use it in GitHub Desktop.
Create AWS ElastiCache (Redis) Cluster with encryption in transit and AUTH token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redisParameterGroup = new elasticache.CfnParameterGroup(this, 'redisParameterGroup', { | |
cacheParameterGroupFamily: 'redis7', | |
description: 'Redis Cluster Parameter Overrides', | |
properties: { | |
timeout: '120', // Close connection if client is idle for a given number of seconds | |
}, | |
}); | |
const redisPrimaryReplicationGroup = new elasticache.CfnReplicationGroup(this, 'redisPrimaryReplicationGroup', { | |
replicationGroupDescription: '{CLUSTER_DESCRIPTION}', | |
// the properties below are optional | |
atRestEncryptionEnabled: false, | |
authToken: '{YOUR_PASSWORD}', | |
cacheNodeType: 'cache.r6g.large', | |
engine: 'redis', | |
engineVersion: '7.0', | |
multiAzEnabled: true, | |
automaticFailoverEnabled: true, | |
replicasPerNodeGroup: 2, | |
replicationGroupId: `{UNIQUE_NAME_FOR_CLUSTER}`, | |
securityGroupIds: [secuityGroup.securityGroupId], | |
transitEncryptionEnabled: true, | |
cacheParameterGroupName: redisParameterGroup.ref, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment