How to create a Lambda Function in Python 2.7 to Create, Reboot, Delete, Modify a ElastiCache Redis? -
currently i'm working on lambda function create, reboot, delete, modify elasticache redis using python 2.7 script.
need iam rules , policies also.
i'm done ec2, rds stop & start actions. have not seen solutions elasticache redis, can people provide me scripts or solutions @ least delete, create elasticache redis.
you can use aws elasticache python sdk create, reboot, delete & modify using boto3.
- create: create_cache_cluster()
- reboot: reboot_cache_cluster()
- delete: delete_cache_cluster()
- modify: modify_cache_cluster()
example:
import boto3 client = boto3.client('elasticache') response = client.create_cache_cluster( cacheclusterid='string', replicationgroupid='string', azmode='single-az'|'cross-az', preferredavailabilityzone='string', preferredavailabilityzones=[ 'string', ], numcachenodes=123, cachenodetype='string', engine='string', engineversion='string', cacheparametergroupname='string', cachesubnetgroupname='string', cachesecuritygroupnames=[ 'string', ], securitygroupids=[ 'string', ], tags=[ { 'key': 'string', 'value': 'string' }, ], snapshotarns=[ 'string', ], snapshotname='string', preferredmaintenancewindow='string', port=123, notificationtopicarn='string', autominorversionupgrade=true|false, snapshotretentionlimit=123, snapshotwindow='string', authtoken='string' )
for more details on parameters refer this link.
Comments
Post a Comment