From 6fd5ada477fdb323dd1d6db72932fa2048a88e00 Mon Sep 17 00:00:00 2001 From: "nik.n" Date: Tue, 19 Mar 2024 11:50:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=81=E4=BF=A1=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92CSV=E3=81=AB=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lambda/transfer-encise-data/transfer-encise-data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lambda/transfer-encise-data/transfer-encise-data.py b/lambda/transfer-encise-data/transfer-encise-data.py index bc58963c..5e09b7d3 100644 --- a/lambda/transfer-encise-data/transfer-encise-data.py +++ b/lambda/transfer-encise-data/transfer-encise-data.py @@ -83,7 +83,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) From f97f80f84eaa389f3bda8f3a5692323d3f3d744d Mon Sep 17 00:00:00 2001 From: "nik.n" Date: Tue, 19 Mar 2024 17:07:50 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=AF=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E7=94=A8=E3=81=AEContentType=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lambda/transfer-encise-data/transfer-encise-data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lambda/transfer-encise-data/transfer-encise-data.py b/lambda/transfer-encise-data/transfer-encise-data.py index 5e09b7d3..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}')