# s3_delete>: Delete files in Amazon S3 **s3_delete>** operator deletes files from Amazon S3. ```yaml +delete_file: s3_delete>: my-bucket/my-file.gz ``` ```yaml +delete_with_params: s3_delete>: bucket: my-bucket key: my-file.gz ``` ## Secrets When you don't know how to set secrets, please refer to [Managing Workflow Secret](https://docs.treasuredata.com/articles/pd/about-workflow-secret-management) * **aws.s3.region, aws.region** An optional explicit AWS Region in which to access S3. Default is us-east-1. * **aws.s3.access_key_id, aws.access_key_id** The AWS Access Key ID to use when accessing S3. When using `credential_provider: assume_role`, this is not required. * **aws.s3.secret_access_key, aws.secret_access_key** The AWS Secret Access Key to use when accessing S3. When using `credential_provider: assume_role`, this is not required. ## Options * **s3_delete>**: BUCKET/KEY Path to the file in Amazon S3 to delete. Use either the operator command or the combination of `bucket` and `key`. Examples: ```yaml s3_delete>: my-bucket/my-data.gz ``` ```yaml s3_delete>: my-bucket/file/in/a/directory ``` * **bucket**: BUCKET The S3 bucket where the file is located. Can be used together with the `key` parameter instead of putting the path on the operator line. * **key**: KEY The S3 key of the file to delete. Can be used together with the `bucket` parameter instead of putting the path on the operator line. * **recursive**: BOOLEAN Delete all objects with the specified prefix recursively. Default is false. Examples: ```yaml +delete_directory: s3_delete>: my-bucket/old-data/ recursive: true ``` * **objects_per_iteration**: NUMBER Maximum number of objects to delete per iteration when using recursive mode. Must be between 1 and 1000. Default is 1000. * **region**: REGION An optional explicit AWS Region in which to access S3. This may also be specified using the `aws.s3.region` secret. Default is us-east-1. * **path_style_access**: BOOLEAN An optional flag to control whether to use path-style or virtual hosted-style access when accessing S3. Default is false. * **log_each_object**: BOOLEAN Whether to log each object being deleted. Default is true. * **credential_provider**: NAME The credential provider to use for AWS authentication. Supported values are `access_key` (default) and `assume_role`. Examples: ```yaml +delete_file_with_assume_role: s3_delete>: my-bucket/my-file.gz credential_provider: assume_role assume_role_authentication_id: ${auth_id} ``` * **assume_role_authentication_id**: NUMBER The authentication ID for assume role when using `credential_provider: assume_role`. This corresponds to the `Amazon S3 Import Integration v2` configuration. How to get authentication_id is written in [Reusing the existing Authentication](https://docs.treasuredata.com/articles/#!int/amazon-s3-import-integration-v2/a/AmazonS3ImportIntegrationv2-reuseAuthenticationReusingtheexistingAuthentication). ## Notes * If you try to delete a file that doesn't exist, the operation will succeed without errors.