我找不到用于 AWS S3 批量操作的 Terraform 资源?我能够通过 terraform 创建 AWS s3 库存文件,但无法创建 s3 批量操作。
有人通过 terraform 创建了 s3 批处理操作吗?
我尝试使用 S3Control 通过 boto3 创建 S3 Batch(不是 AWS Batch,这是 S3 Batch 操作)作业,但我收到“无效请求”响应。我通过控制台通过 AWS S3 批处理操作进行了尝试,但现在我尝试通过 boto3 创建批处理作业。附件是代码和错误消息。
\nimport json\nimport boto3\nimport time\nimport datetime\nimport os\ns3ControlClient = boto3.client('s3control')\ndef lambda_handler(event, context):\n accountId = boto3.client('sts').get_caller_identity().get('Account')\n print(accountId)\n response = s3ControlClient.create_job(\n AccountId = accountId,\n ConfirmationRequired = False,\n Operation = {\n 'S3PutObjectRetention': {\n 'BypassGovernanceRetention': False,\n 'Retention': {\n 'RetainUntilDate' : datetime.datetime(2050, 06, 03),\n 'Mode' : 'GOVERNANCE'\n }\n }\n },\n Report={\n 'Bucket' : 'arn:aws:s3:::test-s3-inventory',\n 'Format' : 'Report_CSV_20180820',\n 'Enabled' : True,\n #'Prefix' : time.strftime('%Y%m%d'),\n 'Prefix' : 'report',\n 'ReportScope' : 'AllTasks'\n …Run Code Online (Sandbox Code Playgroud)