diff --git a/lambda/transfer-encise-data/transfer-encise-data.py b/lambda/transfer-encise-data/transfer-encise-data.py index bc58963c..0f90483c 100644 --- a/lambda/transfer-encise-data/transfer-encise-data.py +++ b/lambda/transfer-encise-data/transfer-encise-data.py @@ -75,7 +75,9 @@ def lambda_handler(event, context): s3_client.copy_object( Bucket=ENCISE_BACKUP_BUCKET, Key=f'{event_folder_name}/{execute_date_yyyymm}/{event_file_name}', - CopySource=copy_source + CopySource=copy_source, + ContentType='text/csv', # ファイルのタイプを指定する必要があるため、ContentTypeを指定する。 + MetadataDirective='REPLACE' # ファイルのメタデータを置き換える必要があるため、MetadataDirectiveを指定する。 ) logger.info(f'I-04-01 Encise受信データのバックアップ完了:{ENCISE_BACKUP_BUCKET}/{event_folder_name}/{execute_date_yyyymm}/{event_file_name}') @@ -83,7 +85,9 @@ def lambda_handler(event, context): s3_client.copy_object( Bucket=DATA_IMPORT_BUCKET, Key=f'{ENCISE_TARGET_FOLDER}/{event_file_name}', - CopySource=copy_source + CopySource=copy_source, + ContentType='text/csv', # ファイルのタイプを指定する必要があるため、ContentTypeを指定する。 + MetadataDirective='REPLACE' # ファイルのメタデータを置き換える必要があるため、MetadataDirectiveを指定する。 ) # コピー後、元のバケットからは削除する s3_client.delete_object(Bucket=event_bucket_name, Key=event_object_key)