Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

ラベル付けに使用されるジョブタグを使用したバッチ操作ジョブの作成

フォーカスモード
ラベル付けに使用されるジョブタグを使用したバッチ操作ジョブの作成 - Amazon Simple Storage Service

タグを追加することで、Amazon S3 バッチオペレーションジョブへのラベル付けとアクセスの制御を実行できます。タグを使用して、バッチ操作ジョブの担当者を識別できます。タグをアタッチしてジョブを作成し、後でジョブにタグを追加できます。詳細については、「タグを使用したアクセスのコントロールとジョブのラベル付け」を参照してください。

次の AWS CLI の例では、ジョブタグをジョブのラベルとして使用して S3 バッチ操作 S3PutObjectCopy ジョブを作成します。

  1. バッチ操作ジョブで実行するアクションまたは OPERATION を選択してから、TargetResource を選択します。

    read -d '' OPERATION <<EOF { "S3PutObjectCopy": { "TargetResource": "arn:aws:s3:::amzn-s3-demo-destination-bucket" } } EOF
  2. ジョブに必要なジョブ TAGS を特定します。この場合、2 つのタグ department および FiscalYear を適用し、値 Marketing および 2020 をそれぞれ使用します。

    read -d '' TAGS <<EOF [ { "Key": "department", "Value": "Marketing" }, { "Key": "FiscalYear", "Value": "2020" } ] EOF
  3. バッチ操作ジョブの MANIFEST を指定します。

    read -d '' MANIFEST <<EOF { "Spec": { "Format": "EXAMPLE_S3BatchOperations_CSV_20180820", "Fields": [ "Bucket", "Key" ] }, "Location": { "ObjectArn": "arn:aws:s3:::amzn-s3-demo-manifest-bucket/example_manifest.csv", "ETag": "example-5dc7a8bfb90808fc5d546218" } } EOF
  4. バッチ操作ジョブの REPORT を設定します。

    read -d '' REPORT <<EOF { "Bucket": "arn:aws:s3:::amzn-s3-demo-completion-report-bucket", "Format": "Example_Report_CSV_20180820", "Enabled": true, "Prefix": "reports/copy-with-replace-metadata", "ReportScope": "AllTasks" } EOF
  5. create-job アクションを実行し、前のステップで設定した入力を使用してバッチ操作ジョブを作成します。

    aws \ s3control create-job \ --account-id 123456789012 \ --manifest "${MANIFEST//$'\n'}" \ --operation "${OPERATION//$'\n'/}" \ --report "${REPORT//$'\n'}" \ --priority 10 \ --role-arn arn:aws:iam::123456789012:role/batch-operations-role \ --tags "${TAGS//$'\n'/}" \ --client-request-token "$(uuidgen)" \ --region us-west-2 \ --description "Copy with Replace Metadata";

次の AWS CLI の例では、ジョブタグをジョブのラベルとして使用して S3 バッチ操作 S3PutObjectCopy ジョブを作成します。

  1. バッチ操作ジョブで実行するアクションまたは OPERATION を選択してから、TargetResource を選択します。

    read -d '' OPERATION <<EOF { "S3PutObjectCopy": { "TargetResource": "arn:aws:s3:::amzn-s3-demo-destination-bucket" } } EOF
  2. ジョブに必要なジョブ TAGS を特定します。この場合、2 つのタグ department および FiscalYear を適用し、値 Marketing および 2020 をそれぞれ使用します。

    read -d '' TAGS <<EOF [ { "Key": "department", "Value": "Marketing" }, { "Key": "FiscalYear", "Value": "2020" } ] EOF
  3. バッチ操作ジョブの MANIFEST を指定します。

    read -d '' MANIFEST <<EOF { "Spec": { "Format": "EXAMPLE_S3BatchOperations_CSV_20180820", "Fields": [ "Bucket", "Key" ] }, "Location": { "ObjectArn": "arn:aws:s3:::amzn-s3-demo-manifest-bucket/example_manifest.csv", "ETag": "example-5dc7a8bfb90808fc5d546218" } } EOF
  4. バッチ操作ジョブの REPORT を設定します。

    read -d '' REPORT <<EOF { "Bucket": "arn:aws:s3:::amzn-s3-demo-completion-report-bucket", "Format": "Example_Report_CSV_20180820", "Enabled": true, "Prefix": "reports/copy-with-replace-metadata", "ReportScope": "AllTasks" } EOF
  5. create-job アクションを実行し、前のステップで設定した入力を使用してバッチ操作ジョブを作成します。

    aws \ s3control create-job \ --account-id 123456789012 \ --manifest "${MANIFEST//$'\n'}" \ --operation "${OPERATION//$'\n'/}" \ --report "${REPORT//$'\n'}" \ --priority 10 \ --role-arn arn:aws:iam::123456789012:role/batch-operations-role \ --tags "${TAGS//$'\n'/}" \ --client-request-token "$(uuidgen)" \ --region us-west-2 \ --description "Copy with Replace Metadata";

次の例では、AWS SDK for Java を使用して、タグ付き S3 バッチ操作ジョブを作成します。

public String createJob(final AWSS3ControlClient awss3ControlClient) { final String manifestObjectArn = "arn:aws:s3:::amzn-s3-demo-manifest-bucket/manifests/10_manifest.csv"; final String manifestObjectVersionId = "example-5dc7a8bfb90808fc5d546218"; final JobManifestLocation manifestLocation = new JobManifestLocation() .withObjectArn(manifestObjectArn) .withETag(manifestObjectVersionId); final JobManifestSpec manifestSpec = new JobManifestSpec().withFormat(JobManifestFormat.S3InventoryReport_CSV_20161130); final JobManifest manifestToPublicApi = new JobManifest() .withLocation(manifestLocation) .withSpec(manifestSpec); final String jobReportBucketArn = "arn:aws:s3:::amzn-s3-demo-completion-report-bucket"; final String jobReportPrefix = "example-job-reports"; final JobReport jobReport = new JobReport() .withEnabled(true) .withReportScope(JobReportScope.AllTasks) .withBucket(jobReportBucketArn) .withPrefix(jobReportPrefix) .withFormat(JobReportFormat.Report_CSV_20180820); final String lambdaFunctionArn = "arn:aws:lambda:us-west-2:123456789012:function:example-function"; final JobOperation jobOperation = new JobOperation() .withLambdaInvoke(new LambdaInvokeOperation().withFunctionArn(lambdaFunctionArn)); final S3Tag departmentTag = new S3Tag().withKey("department").withValue("Marketing"); final S3Tag fiscalYearTag = new S3Tag().withKey("FiscalYear").withValue("2020"); final String roleArn = "arn:aws:iam::123456789012:role/example-batch-operations-role"; final Boolean requiresConfirmation = true; final int priority = 10; final CreateJobRequest request = new CreateJobRequest() .withAccountId("123456789012") .withDescription("Test lambda job") .withManifest(manifestToPublicApi) .withOperation(jobOperation) .withPriority(priority) .withRoleArn(roleArn) .withReport(jobReport) .withTags(departmentTag, fiscalYearTag) .withConfirmationRequired(requiresConfirmation); final CreateJobResult result = awss3ControlClient.createJob(request); return result.getJobId(); }

次の例では、AWS SDK for Java を使用して、タグ付き S3 バッチ操作ジョブを作成します。

public String createJob(final AWSS3ControlClient awss3ControlClient) { final String manifestObjectArn = "arn:aws:s3:::amzn-s3-demo-manifest-bucket/manifests/10_manifest.csv"; final String manifestObjectVersionId = "example-5dc7a8bfb90808fc5d546218"; final JobManifestLocation manifestLocation = new JobManifestLocation() .withObjectArn(manifestObjectArn) .withETag(manifestObjectVersionId); final JobManifestSpec manifestSpec = new JobManifestSpec().withFormat(JobManifestFormat.S3InventoryReport_CSV_20161130); final JobManifest manifestToPublicApi = new JobManifest() .withLocation(manifestLocation) .withSpec(manifestSpec); final String jobReportBucketArn = "arn:aws:s3:::amzn-s3-demo-completion-report-bucket"; final String jobReportPrefix = "example-job-reports"; final JobReport jobReport = new JobReport() .withEnabled(true) .withReportScope(JobReportScope.AllTasks) .withBucket(jobReportBucketArn) .withPrefix(jobReportPrefix) .withFormat(JobReportFormat.Report_CSV_20180820); final String lambdaFunctionArn = "arn:aws:lambda:us-west-2:123456789012:function:example-function"; final JobOperation jobOperation = new JobOperation() .withLambdaInvoke(new LambdaInvokeOperation().withFunctionArn(lambdaFunctionArn)); final S3Tag departmentTag = new S3Tag().withKey("department").withValue("Marketing"); final S3Tag fiscalYearTag = new S3Tag().withKey("FiscalYear").withValue("2020"); final String roleArn = "arn:aws:iam::123456789012:role/example-batch-operations-role"; final Boolean requiresConfirmation = true; final int priority = 10; final CreateJobRequest request = new CreateJobRequest() .withAccountId("123456789012") .withDescription("Test lambda job") .withManifest(manifestToPublicApi) .withOperation(jobOperation) .withPriority(priority) .withRoleArn(roleArn) .withReport(jobReport) .withTags(departmentTag, fiscalYearTag) .withConfirmationRequired(requiresConfirmation); final CreateJobResult result = awss3ControlClient.createJob(request); return result.getJobId(); }
プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.