RemoveS3Triggers removes S3 bucket notifications and Lambda permissions
(ctx context.Context, bucketName, functionArn string)
| 55 | |
| 56 | // RemoveS3Triggers removes S3 bucket notifications and Lambda permissions |
| 57 | func (t *TriggerDeployer) RemoveS3Triggers(ctx context.Context, bucketName, functionArn string) error { |
| 58 | // Remove bucket notification first |
| 59 | if err := t.removeBucketNotification(ctx, bucketName); err != nil { |
| 60 | log.Printf("Warning: failed to remove bucket notification: %v", err) |
| 61 | } |
| 62 | |
| 63 | // Remove Lambda permission |
| 64 | if err := t.removeLambdaPermission(ctx, functionArn); err != nil { |
| 65 | log.Printf("Warning: failed to remove Lambda permission: %v", err) |
| 66 | } |
| 67 | |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | func (t *TriggerDeployer) addLambdaPermission(ctx context.Context, functionArn, bucketName string) error { |
| 72 | statementId := fmt.Sprintf("s3-trigger-%s", t.cfg.Deployment.StackName) |
no test coverage detected