|
1 | 1 | ---
|
2 |
| -page_title: "datadog_logs_archive" |
| 2 | +page_title: "datadog_logs_archive Resource - terraform-provider-datadog" |
| 3 | +subcategory: "" |
| 4 | +description: |- |
| 5 | + Provides a Datadog Logs Archive API resource, which is used to create and manage Datadog logs archives. |
3 | 6 | ---
|
4 | 7 |
|
5 |
| -# datadog_logs_archive Resource |
| 8 | +# Resource `datadog_logs_archive` |
6 | 9 |
|
7 |
| -Provides a Datadog [Logs Archive API](https://docs.datadoghq.com/api/v2/logs-archives/) resource, which is used to create and manage Datadog logs archives. |
| 10 | +Provides a Datadog Logs Archive API resource, which is used to create and manage Datadog logs archives. |
8 | 11 |
|
9 | 12 | ## Example Usage
|
10 | 13 |
|
11 |
| -Create a Datadog logs archive: |
12 |
| - |
13 |
| -```hcl |
| 14 | +```terraform |
14 | 15 | resource "datadog_logs_archive" "my_s3_archive" {
|
15 |
| - name = "my s3 archive" |
16 |
| - query = "service:myservice" |
17 |
| - s3_archive { |
18 |
| - bucket = "my-bucket" |
19 |
| - path = "/path/foo" |
20 |
| - account_id = "001234567888" |
21 |
| - role_name = "my-role-name" |
22 |
| - } |
| 16 | + name = "my s3 archive" |
| 17 | + query = "service:myservice" |
| 18 | + s3_archive { |
| 19 | + bucket = "my-bucket" |
| 20 | + path = "/path/foo" |
| 21 | + account_id = "001234567888" |
| 22 | + role_name = "my-role-name" |
| 23 | + } |
23 | 24 | }
|
24 | 25 | ```
|
25 | 26 |
|
26 |
| -## Argument Reference |
27 |
| - |
28 |
| -The following arguments are supported: |
29 |
| - |
30 |
| -- `name`: (Required) Your archive name. |
31 |
| -- `query`: (Required) The archive query/filter. Logs matching this query are included in the archive. |
32 |
| -- `s3_archive`: (Optional) Definition of an s3 archive. List of one element with the structure below. |
33 |
| - - `bucket`: (Required) Name of your s3 bucket. |
34 |
| - - `path`: (Optional, default = "") Path where the archive will be stored. |
35 |
| - - `account_id`: (Required) Your AWS account id. |
36 |
| - - `role_name`: (Required) Your AWS role name. |
37 |
| -- `gcs_archive`: (Optional) Definition of an gcs archive. List of one element with the structure below. |
38 |
| - - `bucket`: (Required) Name of your gcs bucket. |
39 |
| - - `path`: (Optional, default = "") Path where the archive will be stored. |
40 |
| - - `client_email`: (Required) Your client email. |
41 |
| - - `project_id`: (Required) Your project id. |
42 |
| -- `azure_archive`: (Optional) Definition of an azure archive. List of one element with the structure below. |
43 |
| - - `container`: (Required) The container where the archive will be stored. |
44 |
| - - `path`: (Optional, default = "") The path where the archive will be stored. |
45 |
| - - `tenant_id`: (Required) Your tenant id. |
46 |
| - - `client_id`: (Required) Your client id. |
47 |
| - - `storage_account`: (Required) The associated storage account. |
48 |
| -- `s3`: (Deprecated, Optional) Definition of an s3 archive. Use `s3_archive` instead. |
49 |
| -- `gcs`: (Deprecated, Optional) Definition of an gcs archive. Use `gcs_archive` instead. |
50 |
| -- `azure`: (Deprecated, Optional) Definition of an azure archive. Use `azure_archive` instead. |
51 |
| -- `rehydration_tags`: (Optional) An array of tags to add to rehydrated logs from an archive. |
52 |
| -- `include_tags`: (Optional, default=false) To store the tags in the archive, set the value "true". If it is set to "false", the tags will be dropped when the logs are sent to the archive. |
53 |
| - |
54 |
| -An archive definition must have one (and only one) of the three possible types defined: s3, gcs, azure. |
| 27 | +## Schema |
| 28 | + |
| 29 | +### Required |
| 30 | + |
| 31 | +- **name** (String, Required) Your archive name. |
| 32 | +- **query** (String, Required) The archive query/filter. Logs matching this query are included in the archive. |
| 33 | + |
| 34 | +### Optional |
| 35 | + |
| 36 | +- **azure** (Map of String, Optional, Deprecated) Definition of an azure archive. |
| 37 | +- **azure_archive** (Block List, Max: 1) Definition of an azure archive. (see [below for nested schema](#nestedblock--azure_archive)) |
| 38 | +- **gcs** (Map of String, Optional, Deprecated) Definition of a GCS archive. |
| 39 | +- **gcs_archive** (Block List, Max: 1) Definition of a GCS archive. (see [below for nested schema](#nestedblock--gcs_archive)) |
| 40 | +- **id** (String, Optional) The ID of this resource. |
| 41 | +- **include_tags** (Boolean, Optional) To store the tags in the archive, set the value `true`. If it is set to `false`, the tags will be dropped when the logs are sent to the archive. |
| 42 | +- **rehydration_tags** (List of String, Optional) An array of tags to add to rehydrated logs from an archive. |
| 43 | +- **s3** (Map of String, Optional, Deprecated) Definition of an s3 archive. |
| 44 | +- **s3_archive** (Block List, Max: 1) Definition of an s3 archive. (see [below for nested schema](#nestedblock--s3_archive)) |
| 45 | + |
| 46 | +<a id="nestedblock--azure_archive"></a> |
| 47 | +### Nested Schema for `azure_archive` |
| 48 | + |
| 49 | +Required: |
| 50 | + |
| 51 | +- **client_id** (String, Required) Your client id. |
| 52 | +- **container** (String, Required) The container where the archive will be stored. |
| 53 | +- **storage_account** (String, Required) The associated storage account. |
| 54 | +- **tenant_id** (String, Required) Your tenant id. |
| 55 | + |
| 56 | +Optional: |
| 57 | + |
| 58 | +- **path** (String, Optional) The path where the archive will be stored. |
| 59 | + |
| 60 | + |
| 61 | +<a id="nestedblock--gcs_archive"></a> |
| 62 | +### Nested Schema for `gcs_archive` |
| 63 | + |
| 64 | +Required: |
| 65 | + |
| 66 | +- **bucket** (String, Required) Name of your GCS bucket. |
| 67 | +- **client_email** (String, Required) Your client email. |
| 68 | +- **path** (String, Required) Path where the archive will be stored. |
| 69 | +- **project_id** (String, Required) Your project id. |
| 70 | + |
| 71 | + |
| 72 | +<a id="nestedblock--s3_archive"></a> |
| 73 | +### Nested Schema for `s3_archive` |
| 74 | + |
| 75 | +Required: |
| 76 | + |
| 77 | +- **account_id** (String, Required) Your AWS account id. |
| 78 | +- **bucket** (String, Required) Name of your s3 bucket. |
| 79 | +- **path** (String, Required) Path where the archive will be stored. |
| 80 | +- **role_name** (String, Required) Your AWS role name |
55 | 81 |
|
56 | 82 | ## Import
|
57 | 83 |
|
58 |
| -Logs archives can be imported using their public string ID, e.g. |
| 84 | +Import is supported using the following syntax: |
59 | 85 |
|
60 |
| -``` |
61 |
| -$ terraform import datadog_logs_archive.my_s3_archive 1Aabc2_dfQPLnXy3HlfK4hi |
| 86 | +```shell |
| 87 | +terraform import datadog_logs_archive.my_s3_archive 1Aabc2_dfQPLnXy3HlfK4hi |
62 | 88 | ```
|
0 commit comments