Search code examples
amazon-web-servicesaws-lambdaamazon-redshiftamazon-redshift-serverless

Redshift Snapshot using Redshift Manager by triggering Lambda Function


How to create all prod redshift snapshots using Redshift Manager... action: aws:invokeLambdaFunction using this method (invoking Lambda Function) i want to create redshift cluster snapshots.


Solution

  • One of my friends helped me with the Solution.

    1. we need to allow the Invoke function as shown below.
    • PolicyName: AllowInvokeLambdaPolicy PolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Action: - lambda:InvokeFunction
    1. We created a script to run via the Lambda function which collects the Cluster Name and invokes Lambda.
    • name: BackupRedshiftCluster action: aws:invokeLambdaFunction maxAttempts: 3 inputs: FunctionName: !Sub redshift-manager Payload: !Sub | { "action": "snapshot", "cluster": "{{FetchClientName.ClientName}}"", "snapshot_suffix": "{{GenerateUniqueSnapshot.UniqueString}}"", "snapshot_retention": "15" }