# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 AWSTemplateFormatVersion: "2010-09-09" Transform: AWS::Serverless-2016-10-31 Description: "Example of how to bulk delete objects from S3 using Step Functions Distributed Map" Parameters: BucketName: Type: String Default: replace_with_bucket_name Description: Name of the bucket you want to allow delete against Resources: BulkDeleteObjectsFromS3: Type: AWS::Serverless::StateMachine Properties: Type: "STANDARD" Policies: - Version: 2012-10-17 Statement: - Effect: Allow Action: - s3:GetObject - s3:ListBucket - s3:DeleteObject Resource: - !Join ['',['arn:',!Ref AWS::Partition,':s3:::',!Ref BucketName]] - !Join ['',['arn:',!Ref AWS::Partition,':s3:::',!Ref BucketName,'/*']] - Effect: Allow Action: - states:StartExecution Resource: !Join ['',['arn:',!Ref AWS::Partition,':states:',!Ref AWS::Region,':',!Ref AWS::AccountId,':stateMachine:bulk_delete_from_s3']] DefinitionUri: bulk-delete-objects-from-s3.asl.json Name: bulk_delete_from_s3