Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

fix: Lightsail alarms adjusted #1260

Merged
merged 5 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/tables/aws_lightsail_alarms.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ Describes an alarm
|created_at|timestamp without time zone|The timestamp when the alarm was created|
|datapoints_to_alarm|integer|The number of data points that must not within the specified threshold to trigger the alarm|
|evaluation_periods|integer|The number of periods over which data is compared to the specified threshold|
|location_availability_zone|text|The Availability Zone|
|location_region_name|text|The AWS Region name|
|availability_zone|text|The Availability Zone|
|metric_name|text|The name of the metric associated with the alarm|
|monitored_resource_info_arn|text|The Amazon Resource Name (ARN) of the resource being monitored|
|monitored_resource_info_name|text|The name of the Lightsail resource being monitored|
|monitored_resource_info_resource_type|text|The Lightsail resource type of the resource being monitored|
|monitored_resource_name|text|The name of the Lightsail resource being monitored|
|monitored_resource_resource_type|text|The Lightsail resource type of the resource being monitored|
|name|text|The name of the alarm|
|notification_enabled|boolean|Indicates whether the alarm is enabled|
|notification_triggers|text[]|The alarm states that trigger a notification|
Expand Down
12 changes: 3 additions & 9 deletions resources/services/lightsail/alarms.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,11 @@ func Alarms() *schema.Table {
Type: schema.TypeInt,
},
{
Name: "location_availability_zone",
Name: "availability_zone",
Description: "The Availability Zone",
Type: schema.TypeString,
Resolver: schema.PathResolver("Location.AvailabilityZone"),
},
{
Name: "location_region_name",
Description: "The AWS Region name",
Type: schema.TypeString,
Resolver: schema.PathResolver("Location.RegionName"),
},
{
Name: "metric_name",
Description: "The name of the metric associated with the alarm",
Expand All @@ -88,13 +82,13 @@ func Alarms() *schema.Table {
Resolver: schema.PathResolver("MonitoredResourceInfo.Arn"),
},
{
Name: "monitored_resource_info_name",
Name: "monitored_resource_name",
Description: "The name of the Lightsail resource being monitored",
Type: schema.TypeString,
Resolver: schema.PathResolver("MonitoredResourceInfo.Name"),
},
{
Name: "monitored_resource_info_resource_type",
Name: "monitored_resource_resource_type",
Description: "The Lightsail resource type of the resource being monitored",
Type: schema.TypeString,
Resolver: schema.PathResolver("MonitoredResourceInfo.ResourceType"),
Expand Down
13 changes: 13 additions & 0 deletions resources/services/lightsail/gen.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,17 @@ resource "aws" "lightsail" "alarms" {
path = "github.com/cloudquery/cq-provider-aws/client.ResolveAWSRegion"
}
}

column "location" {
skip_prefix = true
}
column "region_name" {
skip = true
}
column "monitored_resource_info_name" {
rename = "monitored_resource_name"
}
column "monitored_resource_info_resource_type" {
rename = "monitored_resource_resource_type"
}
}