From 81f9992cc476b44f4ec21b814bf6f248fa0fb3ed Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 12 Aug 2024 20:28:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20expose=20cloudwatch=20config=20f?= =?UTF-8?q?or=20aws=20neptune=20cluster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/aws/resources/aws.lr | 2 ++ providers/aws/resources/aws.lr.go | 12 ++++++++++++ providers/aws/resources/aws.lr.manifest.yaml | 1 + providers/aws/resources/aws_neptune.go | 1 + 4 files changed, 16 insertions(+) diff --git a/providers/aws/resources/aws.lr b/providers/aws/resources/aws.lr index 1daf7eab46..b779bd9e8c 100644 --- a/providers/aws/resources/aws.lr +++ b/providers/aws/resources/aws.lr @@ -3374,6 +3374,8 @@ private aws.neptune.cluster @defaults("arn name status") { deletionProtection bool // Earliest time to which a database can be restored earliestRestorableTime time + // List of log types that this cluster is configured to export to CloudWatch logs + enabledCloudwatchLogsExports []string // Connection endpoint for the primary instance endpoint string // Whether mapping of Amazon Identity and Access Management (IAM) accounts to database accounts is enabled diff --git a/providers/aws/resources/aws.lr.go b/providers/aws/resources/aws.lr.go index d26a6a4b16..e2ca9b79b3 100644 --- a/providers/aws/resources/aws.lr.go +++ b/providers/aws/resources/aws.lr.go @@ -4762,6 +4762,9 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.neptune.cluster.earliestRestorableTime": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsNeptuneCluster).GetEarliestRestorableTime()).ToDataRes(types.Time) }, + "aws.neptune.cluster.enabledCloudwatchLogsExports": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsNeptuneCluster).GetEnabledCloudwatchLogsExports()).ToDataRes(types.Array(types.String)) + }, "aws.neptune.cluster.endpoint": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsNeptuneCluster).GetEndpoint()).ToDataRes(types.String) }, @@ -10916,6 +10919,10 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsNeptuneCluster).EarliestRestorableTime, ok = plugin.RawToTValue[*time.Time](v.Value, v.Error) return }, + "aws.neptune.cluster.enabledCloudwatchLogsExports": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsNeptuneCluster).EnabledCloudwatchLogsExports, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, "aws.neptune.cluster.endpoint": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsNeptuneCluster).Endpoint, ok = plugin.RawToTValue[string](v.Value, v.Error) return @@ -27937,6 +27944,7 @@ type mqlAwsNeptuneCluster struct { ClusterResourceId plugin.TValue[string] DeletionProtection plugin.TValue[bool] EarliestRestorableTime plugin.TValue[*time.Time] + EnabledCloudwatchLogsExports plugin.TValue[[]interface{}] Endpoint plugin.TValue[string] IamDatabaseAuthenticationEnabled plugin.TValue[bool] LatestRestorableTime plugin.TValue[*time.Time] @@ -28054,6 +28062,10 @@ func (c *mqlAwsNeptuneCluster) GetEarliestRestorableTime() *plugin.TValue[*time. return &c.EarliestRestorableTime } +func (c *mqlAwsNeptuneCluster) GetEnabledCloudwatchLogsExports() *plugin.TValue[[]interface{}] { + return &c.EnabledCloudwatchLogsExports +} + func (c *mqlAwsNeptuneCluster) GetEndpoint() *plugin.TValue[string] { return &c.Endpoint } diff --git a/providers/aws/resources/aws.lr.manifest.yaml b/providers/aws/resources/aws.lr.manifest.yaml index ca5ad2a537..13715a5e08 100755 --- a/providers/aws/resources/aws.lr.manifest.yaml +++ b/providers/aws/resources/aws.lr.manifest.yaml @@ -2288,6 +2288,7 @@ resources: crossAccountClone: {} deletionProtection: {} earliestRestorableTime: {} + enabledCloudwatchLogsExports: {} endpoint: {} engine: {} engineVersion: {} diff --git a/providers/aws/resources/aws_neptune.go b/providers/aws/resources/aws_neptune.go index 52d489d210..dec26d5440 100644 --- a/providers/aws/resources/aws_neptune.go +++ b/providers/aws/resources/aws_neptune.go @@ -122,6 +122,7 @@ func newMqlAwsNeptuneCluster(runtime *plugin.Runtime, region string, cluster nep "clusterResourceId": llx.StringDataPtr(cluster.DbClusterResourceId), "deletionProtection": llx.BoolDataPtr(cluster.DeletionProtection), "earliestRestorableTime": llx.TimeDataPtr(cluster.EarliestRestorableTime), + "enabledCloudwatchLogsExports": llx.ArrayData(convert.SliceAnyToInterface(cluster.EnabledCloudwatchLogsExports), types.String), "endpoint": llx.StringDataPtr(cluster.Endpoint), "iamDatabaseAuthenticationEnabled": llx.BoolDataPtr(cluster.IAMDatabaseAuthenticationEnabled), "latestRestorableTime": llx.TimeDataPtr(cluster.LatestRestorableTime),