<commit_before>// Module included in the following assemblies:
//
// * metering/configuring_metering/metering-configure-persistent-storage.adoc

[id="metering-store-data-in-s3_{context}"]
= Storing data in Amazon S3

Metering can use an existing Amazon S3 bucket or create a bucket for storage.

[NOTE]
====
Metering does not manage or delete any S3 bucket data. When uninstalling metering, any S3 buckets used to store metering data must be manually cleaned up.
====

To use Amazon S3 for storage, edit the `spec.storage` section in the example `s3-storage.yaml` file below.

[source,yaml]
----
apiVersion: metering.openshift.io/v1
kind: MeteringConfig
metadata:
  name: "operator-metering"
spec:
  storage:
    type: "hive"
    hive:
      type: "s3"
      s3:
        bucket: "bucketname/path/" <1>
        region: "us-west-1" <2>
        secretName: "my-aws-secret" <3>
        # Set to false if you want to provide an existing bucket, instead of
        # having metering create the bucket on your behalf.
        createBucket: true <4>
----
<1> Specify the name of the bucket where you would like to store your data. You may optionally specify the path within the bucket.
<2> Specify the region of your bucket.
<3> The name of a secret in the metering namespace containing the AWS credentials in the `data.aws-access-key-id` and `data.aws-secret-access-key` fields. See the examples that follow for more details.
<4> Set this field to `false` if you want to provide an existing S3 bucket, or if you do not want to provide IAM credentials that have `CreateBucket` permissions.<commit_msg>BZ-1798741 Modify note for manual cleanup of S3 bucket data used for metering<commit_after>// Module included in the following assemblies:
//
// * metering/configuring_metering/metering-configure-persistent-storage.adoc

[id="metering-store-data-in-s3_{context}"]
= Storing data in Amazon S3

Metering can use an existing Amazon S3 bucket or create a bucket for storage.

[NOTE]
====
Metering does not manage or delete any S3 bucket data. You must manually clean up S3 buckets that are used to store metering data.
====

To use Amazon S3 for storage, edit the `spec.storage` section in the example `s3-storage.yaml` file below.

[source,yaml]
----
apiVersion: metering.openshift.io/v1
kind: MeteringConfig
metadata:
  name: "operator-metering"
spec:
  storage:
    type: "hive"
    hive:
      type: "s3"
      s3:
        bucket: "bucketname/path/" <1>
        region: "us-west-1" <2>
        secretName: "my-aws-secret" <3>
        # Set to false if you want to provide an existing bucket, instead of
        # having metering create the bucket on your behalf.
        createBucket: true <4>
----
<1> Specify the name of the bucket where you would like to store your data. You may optionally specify the path within the bucket.
<2> Specify the region of your bucket.
<3> The name of a secret in the metering namespace containing the AWS credentials in the `data.aws-access-key-id` and `data.aws-secret-access-key` fields. See the examples that follow for more details.
<4> Set this field to `false` if you want to provide an existing S3 bucket, or if you do not want to provide IAM credentials that have `CreateBucket` permissions.
{'fraction_non_alphanumeric': 0.08803471791692498, 'fraction_numerical': 0.014879107253564786, 'mean_word_length': 3.532303370786517, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '960452', 'n_tokens_mistral': 968, 'n_tokens_neox': 943, 'n_words': 425}