Skip to content

Commit

Permalink
Added storage class to s3 archive terraform provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcausey8 committed Feb 26, 2025
1 parent 80e8efc commit c01cf81
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions datadog/resource_datadog_logs_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ func resourceDatadogLogsArchive() *schema.Resource {
ValidateDiagFunc: validators.ValidateEnumValue(datadogV2.NewLogsArchiveEncryptionS3TypeFromValue),
},
"encryption_key": {Description: "The AWS KMS encryption key.", Type: schema.TypeString, Optional: true},
"storage_class": {
Description: "The storage class logs are uploaded to.",
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: validators.ValidateEnumValue([]string{
"STANDARD",
"STANDARD_IA",
"ONEZONE_IA",
"INTELLIGENT_TIERING",
"GLACIER_IR",
}),
},
},
},
},
Expand Down Expand Up @@ -271,6 +283,9 @@ func buildS3Map(destination datadogV2.LogsArchiveDestinationS3) map[string]inter
}
result["bucket"] = destination.GetBucket()
result["path"] = destination.GetPath()
if storageClass, ok := destination.GetStorageClassOk(); ok {

Check failure on line 286 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / linter-checks

destination.GetStorageClassOk undefined (type datadogV2.LogsArchiveDestinationS3 has no field or method GetStorageClassOk)

Check failure on line 286 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

destination.GetStorageClassOk undefined (type datadogV2.LogsArchiveDestinationS3 has no field or method GetStorageClassOk)

Check failure on line 286 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

destination.GetStorageClassOk undefined (type datadogV2.LogsArchiveDestinationS3 has no field or method GetStorageClassOk)
result["storage_class"] = storageClass
}
return result
}

Expand Down Expand Up @@ -451,6 +466,10 @@ func buildS3Destination(dest interface{}) (*datadogV2.LogsArchiveDestinationS3,
}
destination.SetEncryption(*encryption)
}
storageClass, ok := d["storage_class"]
if ok && storageClass != "" {
destination.SetStorageClass(datadogV2.LogsArchiveStorageClass(storageClass.(string)))

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / linter-checks

destination.SetStorageClass undefined (type *datadogV2.LogsArchiveDestinationS3 has no field or method SetStorageClass)

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.LogsArchiveStorageClass

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

destination.SetStorageClass undefined (type *datadogV2.LogsArchiveDestinationS3 has no field or method SetStorageClass)

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.LogsArchiveStorageClass

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

destination.SetStorageClass undefined (type *datadogV2.LogsArchiveDestinationS3 has no field or method SetStorageClass)

Check failure on line 471 in datadog/resource_datadog_logs_archive.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.LogsArchiveStorageClass
}
destination.Path = datadog.PtrString(path.(string))
return destination, nil
}
Expand Down

0 comments on commit c01cf81

Please sign in to comment.