(ctx context.Context, functionArn string)
| 97 | } |
| 98 | |
| 99 | func (t *TriggerDeployer) removeLambdaPermission(ctx context.Context, functionArn string) error { |
| 100 | statementId := fmt.Sprintf("s3-trigger-%s", t.cfg.Deployment.StackName) |
| 101 | |
| 102 | input := &lambda.RemovePermissionInput{ |
| 103 | FunctionName: aws.String(functionArn), |
| 104 | StatementId: aws.String(statementId), |
| 105 | } |
| 106 | |
| 107 | _, err := t.clients.Lambda.RemovePermissionWithContext(ctx, input) |
| 108 | if err != nil { |
| 109 | if awsErr, ok := err.(awserr.Error); ok { |
| 110 | if awsErr.Code() == lambda.ErrCodeResourceNotFoundException { |
| 111 | // Permission doesn't exist, which is fine |
| 112 | return nil |
| 113 | } |
| 114 | } |
| 115 | return err |
| 116 | } |
| 117 | |
| 118 | log.Printf("Removed Lambda permission") |
| 119 | return nil |
| 120 | } |
| 121 | |
| 122 | func (t *TriggerDeployer) configureBucketNotification(ctx context.Context, bucketName, functionArn string) error { |
| 123 | // Create notification configuration |
no test coverage detected