

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# File pembantu untuk menggunakan Lensa Penyimpanan Amazon S3
<a name="S3LensHelperFilesCLI"></a>

Gunakan file JSON berikut dan input kuncinya untuk contoh Anda.

## Konfigurasi contoh Lensa Penyimpanan S3 di JSON
<a name="S3LensHelperFilesSampleConfigurationCLI"></a>

**Example `config.json`**  
File `config.json` tersebut berisi detail *metrik dan konfigurasi rekomendasi tingkat lanjut* tingkat Organisasi Lensa Penyimpanan S3. Untuk menggunakan contoh berikut, ganti `user input placeholders` dengan informasi Anda sendiri.  
Biaya tambahan berlaku untuk metrik dan rekomendasi tingkat lanjut. Untuk informasi selengkapnya, lihat [metrik dan rekomendasi tingkat lanjut](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_basics_metrics_recommendations.html#storage_lens_basics_metrics_selection).

```
{
  "Id": "SampleS3StorageLensConfiguration", //Use this property to identify your S3 Storage Lens configuration.
  "AwsOrg": { //Use this property when enabling S3 Storage Lens for AWS Organizations.
    "Arn": "arn:aws:organizations::123456789012:organization/o-abcdefgh"
  },
  "AccountLevel": {
    "ActivityMetrics": {
      "IsEnabled":true
    },
    "AdvancedCostOptimizationMetrics": {
      "IsEnabled":true
    },
    "AdvancedDataProtectionMetrics": {
      "IsEnabled":true
    },
    "DetailedStatusCodesMetrics": {
      "IsEnabled":true
    },
    "BucketLevel": {
      "ActivityMetrics": {
        "IsEnabled":true
      },
      "AdvancedDataProtectionMetrics": {
      "IsEnabled":true
      },
      "AdvancedCostOptimizationMetrics": {
        "IsEnabled":true
      },
      "DetailedStatusCodesMetrics": {
        "IsEnabled":true
      },
      "PrefixLevel":{
        "StorageMetrics":{
          "IsEnabled":true,
          "SelectionCriteria":{
            "MaxDepth":5,
            "MinStorageBytesPercentage":1.25,
            "Delimiter":"/"
          }
        }
      }
    }
  },
  "Exclude": { //Replace with "Include" if you prefer to include Regions.
    "Regions": [
      "eu-west-1"
    ],
    "Buckets": [ //This attribute is not supported for AWS Organizations-level configurations.
      "arn:aws:s3:::amzn-s3-demo-source-bucket"
    ]
  },
  "IsEnabled": true, //Whether the configuration is enabled
  "DataExport": { //Details about the metrics export
    "S3BucketDestination": {
      "OutputSchemaVersion": "V_1",
      "Format": "CSV", //You can add "Parquet" if you prefer.
      "AccountId": "111122223333",
      "Arn": "arn:aws:s3:::
amzn-s3-demo-destination-bucket", // The destination bucket for your metrics export must be in the same Region as your S3 Storage Lens configuration. 
      "Prefix": "prefix-for-your-export-destination",
      "Encryption": {
        "SSES3": {}
      }
    },
    "CloudWatchMetrics": {
      "IsEnabled": true
    }
  }
}
```

## Konfigurasi contoh Lensa Penyimpanan S3 dengan grup Lensa Penyimpanan di JSON
<a name="StorageLensGroupsHelperFilesCLI"></a>

**Example `config.json`**  

File `config.json` berisi detail yang ingin Anda terapkan ke konfigurasi Lensa Penyimpanan Anda saat menggunakan grup Lensa Penyimpanan. Untuk menggunakan contoh, ganti `user input placeholders` dengan informasi Anda sendiri.

Untuk memasang semua grup Lensa Penyimpanan ke dasbor Anda, perbarui konfigurasi Lensa Penyimpanan Anda dengan sintaks berikut:

```
{
  "Id": "ExampleS3StorageLensConfiguration",
  "AccountLevel": {
    "ActivityMetrics": {
      "IsEnabled":true
    },
    "AdvancedCostOptimizationMetrics": {
      "IsEnabled":true
    },
    "AdvancedDataProtectionMetrics": {
      "IsEnabled":true
    },
    "BucketLevel": {
      "ActivityMetrics": {
      "IsEnabled":true
      },
    "StorageLensGroupLevel": {},
  "IsEnabled": true
}
```

Untuk menyertakan hanya dua grup Lensa Penyimpanan dalam konfigurasi dasbor Lensa Penyimpanan (*slg-1*dan*slg-2*), gunakan sintaks berikut:

```
{
  "Id": "ExampleS3StorageLensConfiguration",
  "AccountLevel": {
    "ActivityMetrics": {
      "IsEnabled":true
    },
    "AdvancedCostOptimizationMetrics": {
      "IsEnabled":true
    },
    "AdvancedDataProtectionMetrics": {
      "IsEnabled":true
    },
    "BucketLevel": {
      "ActivityMetrics": {
      "IsEnabled":true
      },
   "StorageLensGroupLevel": {
        "SelectionCriteria": {
            "Include": [
                "arn:aws:s3:us-east-1:111122223333:storage-lens-group/slg-1",
                "arn:aws:s3:us-east-1:444455556666:storage-lens-group/slg-2"
            ]
    },
  "IsEnabled": true
}
```

Untuk mengecualikan hanya grup Lensa Penyimpanan tertentu agar tidak dipasang ke konfigurasi dasbor Anda, gunakan sintaks berikut:

```
{
  "Id": "ExampleS3StorageLensConfiguration",
  "AccountLevel": {
    "ActivityMetrics": {
      "IsEnabled":true
    },
    "AdvancedCostOptimizationMetrics": {
      "IsEnabled":true
    },
    "AdvancedDataProtectionMetrics": {
      "IsEnabled":true
    },
    "BucketLevel": {
      "ActivityMetrics": {
      "IsEnabled":true
      },
   "StorageLensGroupLevel": {
        "SelectionCriteria": {
            "Exclude": [
                "arn:aws:s3:us-east-1:111122223333:storage-lens-group/slg-1",
                "arn:aws:s3:us-east-1:444455556666:storage-lens-group/slg-2"
            ]
    },
  "IsEnabled": true
}
```

## Konfigurasi contoh tag Lensa Penyimpanan S3 di JSON
<a name="S3LensHelperFilesSampleConfigurationTagsCLI"></a>

**Example `tags.json`**  
File `tags.json` berisi tag yang ingin Anda terapkan ke konfigurasi Lensa Penyimpanan S3 Anda. Untuk menggunakan contoh ini, ganti `user input placeholders` dengan informasi Anda sendiri.  

```
[
    {
        "Key": "key1",
        "Value": "value1"
    },
    {
        "Key": "key2",
        "Value": "value2"
    }
]
```

## Konfigurasi contoh Lensa Penyimpanan S3 untuk izin IAM
<a name="S3LensHelperFilesSampleConfigurationIAMPermissionsCLI"></a>

**Example `permissions.json`–Nama dasbor khusus**  
Kebijakan contoh ini menunjukkan file `permissions.json` IAM Lensa Penyimpanan S3 dengan nama dasbor tertentu yang ditentukan. Ganti *`value1`*, `us-east-1`, `your-dashboard-name`, dan `example-account-id` dengan nilai Anda sendiri.    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetStorageLensConfiguration",
                "s3:DeleteStorageLensConfiguration",
                "s3:PutStorageLensConfiguration"
            ],
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/key1": "value1"
                }
            },
            "Resource": "arn:aws:s3:us-east-1:111122223333:storage-lens/your-dashboard-name"
        }
    ]
}
```

**Example `permissions.json`–Tidak ada nama dasbor khusus**  
Kebijakan contoh ini menunjukkan file `permissions.json` IAM Lensa Penyimpanan S3 tanpa nama dasbor tertentu yang ditentukan. Ganti *`value1`*, `us-east-1`, dan `example-account-id` dengan nilai Anda sendiri.    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetStorageLensConfiguration",
                "s3:DeleteStorageLensConfiguration",
                "s3:PutStorageLensConfiguration"
            ],
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/key1": "value1"
                }
            },
            "Resource": "arn:aws:s3:us-east-1:111122223333:storage-lens/*"
        }
    ]
}
```