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

Commit

Permalink
feat: More Resource Simplification (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbernays committed Aug 8, 2022
1 parent 7f8025a commit 902c8e0
Show file tree
Hide file tree
Showing 45 changed files with 146 additions and 575 deletions.
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_alarms.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Describes an alarm
|comparison_operator|text|The arithmetic operation used when comparing the specified statistic and threshold|
|contact_protocols|text[]|The contact protocols for the alarm, such as Email, SMS (text messaging), or both|
|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|
|datapoints_to_alarm|bigint|The number of data points that must not within the specified threshold to trigger the alarm|
|evaluation_periods|bigint|The number of periods over which data is compared to the specified threshold|
|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|
Expand All @@ -20,7 +20,7 @@ Describes an alarm
|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|
|period|integer|The period, in seconds, over which the statistic is applied|
|period|bigint|The period, in seconds, over which the statistic is applied|
|resource_type|text|The Lightsail resource type (eg, Alarm)|
|state|text|The current state of the alarm|
|statistic|text|The statistic for the metric associated with the alarm|
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/aws_lightsail_certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describes the full details of an Amazon Lightsail SSL/TLS certificate
|created_at|timestamp without time zone|The timestamp when the certificate was created|
|domain_name|text|The domain name of the certificate|
|eligible_to_renew|text|The renewal eligibility of the certificate|
|in_use_resource_count|integer|The number of Lightsail resources that the certificate is attached to|
|in_use_resource_count|bigint|The number of Lightsail resources that the certificate is attached to|
|issued_at|timestamp without time zone|The timestamp when the certificate was issued|
|issuer_ca|text|The certificate authority that issued the certificate|
|key_algorithm|text|The algorithm used to generate the key pair (the public and private key) of the certificate|
Expand Down
4 changes: 2 additions & 2 deletions docs/tables/aws_lightsail_container_service_deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Describes a container deployment configuration of an Amazon Lightsail container
|containers|jsonb|An object that describes the configuration for the containers of the deployment|
|created_at|timestamp without time zone|The timestamp when the deployment was created|
|public_endpoint_container_name|text|The name of the container entry of the deployment that the endpoint configuration applies to|
|public_endpoint_container_port|integer|The port of the specified container to which traffic is forwarded to|
|public_endpoint_container_port|bigint|The port of the specified container to which traffic is forwarded to|
|public_endpoint_health_check|jsonb|An object that describes the health check configuration of the container|
|state|text|The state of the deployment|
|version|integer|The version number of the deployment|
|version|bigint|The version number of the deployment|
10 changes: 5 additions & 5 deletions docs/tables/aws_lightsail_container_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Describes an Amazon Lightsail container service
|current_deployment_containers|jsonb|An object that describes the configuration for the containers of the deployment|
|current_deployment_created_at|timestamp without time zone|The timestamp when the deployment was created|
|current_deployment_public_endpoint_container_name|text|The name of the container entry of the deployment that the endpoint configuration applies to|
|current_deployment_public_endpoint_container_port|integer|The port of the specified container to which traffic is forwarded to|
|current_deployment_public_endpoint_container_port|bigint|The port of the specified container to which traffic is forwarded to|
|current_deployment_public_endpoint_health_check|jsonb|An object that describes the health check configuration of the container|
|current_deployment_state|text|The state of the deployment|
|current_deployment_version|integer|The version number of the deployment|
|current_deployment_version|bigint|The version number of the deployment|
|is_disabled|boolean|A Boolean value indicating whether the container service is disabled|
|availability_zone|text|The Availability Zone|
|next_deployment_containers|jsonb|An object that describes the configuration for the containers of the deployment|
|next_deployment_created_at|timestamp without time zone|The timestamp when the deployment was created|
|next_deployment_public_endpoint_container_name|text|The name of the container entry of the deployment that the endpoint configuration applies to|
|next_deployment_public_endpoint_container_port|integer|The port of the specified container to which traffic is forwarded to|
|next_deployment_public_endpoint_container_port|bigint|The port of the specified container to which traffic is forwarded to|
|next_deployment_public_endpoint_health_check|jsonb|An object that describes the health check configuration of the container|
|next_deployment_state|text|The state of the deployment|
|next_deployment_version|integer|The version number of the deployment|
|next_deployment_version|bigint|The version number of the deployment|
|power|text|The power specification of the container service|
|power_id|text|The ID of the power of the container service|
|principal_arn|text|The principal ARN of the container service|
Expand All @@ -33,7 +33,7 @@ Describes an Amazon Lightsail container service
|private_registry_access_ecr_image_puller_role_principal_arn|text|The Amazon Resource Name (ARN) of the role, if it is activated|
|public_domain_names|jsonb|The public domain name of the container service, such as examplecom and wwwexamplecom|
|resource_type|text|The Lightsail resource type of the container service (ie, ContainerService)|
|scale|integer|The scale specification of the container service|
|scale|bigint|The scale specification of the container service|
|state|text|The current state of the container service|
|state_detail_code|text|The state code of the container service|
|state_detail_message|text|A message that provides more information for the state code|
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/aws_lightsail_database_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Describes a database snapshot
|availability_zone|text|The Availability Zone|
|name|text|The name of the database snapshot|
|resource_type|text|The Lightsail resource type|
|size_in_gb|integer|The size of the disk in GB (for example, 32) for the database snapshot|
|size_in_gb|bigint|The size of the disk in GB (for example, 32) for the database snapshot|
|state|text|The state of the database snapshot|
|support_code|text|The support code for the database snapshot|
|tags|jsonb|The tag keys and optional values for the resource|
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Describes a database
|created_at|timestamp without time zone|The timestamp when the database was created|
|engine|text|The database software (for example, MySQL)|
|engine_version|text|The database engine version (for example, 5723)|
|hardware_cpu_count|integer|The number of vCPUs for the database|
|hardware_disk_size_in_gb|integer|The size of the disk for the database|
|hardware_cpu_count|bigint|The number of vCPUs for the database|
|hardware_disk_size_in_gb|bigint|The size of the disk for the database|
|hardware_ram_size_in_gb|float|The amount of RAM in GB for the database|
|latest_restorable_time|timestamp without time zone|The latest point in time to which the database can be restored|
|availability_zone|text|The Availability Zone|
|master_database_name|text|The name of the master database created when the Lightsail database resource is created|
|master_endpoint_address|text|Specifies the DNS address of the database|
|master_endpoint_port|integer|Specifies the port that the database is listening on|
|master_endpoint_port|bigint|Specifies the port that the database is listening on|
|master_username|text|The master user name of the database|
|name|text|The unique name of the database resource in Lightsail|
|parameter_apply_status|text|The status of parameter updates for the database|
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/aws_lightsail_disk_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Describes a block storage disk snapshot
|name|text|The name of the disk snapshot (eg, my-disk-snapshot)|
|progress|text|The progress of the snapshot|
|resource_type|text|The Lightsail resource type (eg, DiskSnapshot)|
|size_in_gb|integer|The size of the disk in GB|
|size_in_gb|bigint|The size of the disk in GB|
|state|text|The status of the disk snapshot operation|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Describes a block storage disk
|attached_to|text|The resources to which the disk is attached|
|attachment_state|text|(Deprecated) The attachment state of the disk|
|created_at|timestamp without time zone|The date when the disk was created|
|gb_in_use|integer|(Deprecated) The number of GB in use by the disk|
|iops|integer|The input/output operations per second (IOPS) of the disk|
|gb_in_use|bigint|(Deprecated) The number of GB in use by the disk|
|iops|bigint|The input/output operations per second (IOPS) of the disk|
|is_attached|boolean|A Boolean value indicating whether the disk is attached|
|is_system_disk|boolean|A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it)|
|location_availability_zone|text|The Availability Zone|
|location_region_name|text|The AWS Region name|
|name|text|The unique name of the disk|
|path|text|The disk path|
|resource_type|text|The Lightsail resource type (eg, Disk)|
|size_in_gb|integer|The size of the disk in GB|
|size_in_gb|bigint|The size of the disk in GB|
|state|text|Describes the status of the disk|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_instance_hardware_disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Describes a block storage disk
|arn|text|The Amazon Resource Name (ARN) of the disk|
|attached_to|text|The resources to which the disk is attached|
|created_at|timestamp without time zone|The date when the disk was created|
|gb_in_use|integer|(Deprecated) The number of GB in use by the disk|
|iops|integer|The input/output operations per second (IOPS) of the disk|
|gb_in_use|bigint|(Deprecated) The number of GB in use by the disk|
|iops|bigint|The input/output operations per second (IOPS) of the disk|
|is_attached|boolean|A Boolean value indicating whether the disk is attached|
|is_system_disk|boolean|A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it)|
|location_availability_zone|text|The Availability Zone|
|location_region_name|text|The AWS Region name|
|name|text|The unique name of the disk|
|path|text|The disk path|
|resource_type|text|The Lightsail resource type (eg, Disk)|
|size_in_gb|integer|The size of the disk in GB|
|size_in_gb|bigint|The size of the disk in GB|
|state|text|Describes the status of the disk|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
4 changes: 2 additions & 2 deletions docs/tables/aws_lightsail_instance_networking_ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describes information about ports for an Amazon Lightsail instance
|cidr_list_aliases|text[]|An alias that defines access for a preconfigured range of IP addresses|
|cidrs|text[]|The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol|
|common_name|text|The common name of the port information|
|from_port|integer|The first port in a range of open ports on an instance|
|from_port|bigint|The first port in a range of open ports on an instance|
|ipv6_cidrs|text[]|The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol|
|protocol|text|The IP protocol name|
|to_port|integer|The last port in a range of open ports on an instance|
|to_port|bigint|The last port in a range of open ports on an instance|
4 changes: 2 additions & 2 deletions docs/tables/aws_lightsail_instance_port_states.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Describes open ports on an instance, the IP addresses allowed to connect to the
|instance_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instances table (FK)|
|cidr_list_aliases|text[]|An alias that defines access for a preconfigured range of IP addresses|
|cidrs|text[]|The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol|
|from_port|integer|The first port in a range of open ports on an instance|
|from_port|bigint|The first port in a range of open ports on an instance|
|ipv6_cidrs|text[]|The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol|
|protocol|text|The IP protocol name|
|state|text|Specifies whether the instance port is open or closed|
|to_port|integer|The last port in a range of open ports on an instance|
|to_port|bigint|The last port in a range of open ports on an instance|
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Describes a block storage disk
|attached_to|text|The resources to which the disk is attached|
|attachment_state|text|(Deprecated) The attachment state of the disk|
|created_at|timestamp without time zone|The date when the disk was created|
|gb_in_use|integer|(Deprecated) The number of GB in use by the disk|
|iops|integer|The input/output operations per second (IOPS) of the disk|
|gb_in_use|bigint|(Deprecated) The number of GB in use by the disk|
|iops|bigint|The input/output operations per second (IOPS) of the disk|
|is_attached|boolean|A Boolean value indicating whether the disk is attached|
|is_system_disk|boolean|A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it)|
|location_availability_zone|text|The Availability Zone|
|location_region_name|text|The AWS Region name|
|name|text|The unique name of the disk|
|path|text|The disk path|
|resource_type|text|The Lightsail resource type (eg, Disk)|
|size_in_gb|integer|The size of the disk in GB|
|size_in_gb|bigint|The size of the disk in GB|
|state|text|Describes the status of the disk|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
2 changes: 1 addition & 1 deletion docs/tables/aws_lightsail_instance_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Describes an instance snapshot
|name|text|The name of the snapshot|
|progress|text|The progress of the snapshot|
|resource_type|text|The type of resource (usually InstanceSnapshot)|
|size_in_gb|integer|The size in GB of the SSD|
|size_in_gb|bigint|The size in GB of the SSD|
|state|text|The state the snapshot is in|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ Describes an instance (a virtual private server)
|blueprint_name|text|The friendly name of the blueprint (eg, Amazon Linux)|
|bundle_id|text|The bundle for the instance (eg, micro_1_0)|
|created_at|timestamp without time zone|The timestamp when the instance was created (eg, 147973490917) in Unix time format|
|hardware_cpu_count|integer|The number of vCPUs the instance has|
|hardware_cpu_count|bigint|The number of vCPUs the instance has|
|hardware_ram_size_in_gb|float|The amount of RAM in GB on the instance (eg, 10)|
|ip_address_type|text|The IP address type of the instance|
|ipv6_addresses|text[]|The IPv6 addresses of the instance|
|is_static_ip|boolean|A Boolean value indicating whether this instance has a static IP assigned to it|
|location_availability_zone|text|The Availability Zone|
|location_region_name|text|The AWS Region name|
|name|text|The name the user gave the instance (eg, Amazon_Linux-1GB-Ohio-1)|
|networking_monthly_transfer_gb_per_month_allocated|integer|The amount allocated per month (in GB)|
|networking_monthly_transfer_gb_per_month_allocated|bigint|The amount allocated per month (in GB)|
|private_ip_address|text|The private IP address of the instance|
|public_ip_address|text|The public IP address of the instance|
|resource_type|text|The type of resource (usually Instance)|
|ssh_key_name|text|The name of the SSH key being used to connect to the instance (eg, LightsailDefaultKeyPair)|
|state_code|integer|The status code for the instance|
|state_code|bigint|The status code for the instance|
|state_name|text|The state of the instance (eg, running or pending)|
|support_code|text|The support code|
|tags|jsonb|The tag keys and optional values for the resource|
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/aws_lightsail_load_balancers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describes a load balancer
|dns_name|text|The DNS name of your Lightsail load balancer|
|health_check_path|text|The path you specified to perform your health checks|
|https_redirection_enabled|boolean|A Boolean value that indicates whether HTTPS redirection is enabled for the load balancer|
|instance_port|integer|The port where the load balancer will direct traffic to your Lightsail instances|
|instance_port|bigint|The port where the load balancer will direct traffic to your Lightsail instances|
|ip_address_type|text|The IP address type of the load balancer|
|availability_zone|text|The Availability Zone|
|name|text|The name of the load balancer (eg, my-load-balancer)|
Expand Down
26 changes: 9 additions & 17 deletions resources/services/accessanalyzer/analyzers.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,9 @@ func Analyzers() *schema.Table {
Type: schema.TypeStringArray,
},
{
Name: "error",
Description: "The error that resulted in an Error finding",
Type: schema.TypeString,
IgnoreInTests: true,
Name: "error",
Description: "The error that resulted in an Error finding",
Type: schema.TypeString,
},
{
Name: "is_public",
Expand All @@ -164,10 +163,9 @@ func Analyzers() *schema.Table {
},
Relations: []*schema.Table{
{
Name: "aws_access_analyzer_analyzer_finding_sources",
Description: "The source of the finding",
Resolver: fetchAccessAnalyzerAnalyzerFindingSources,
IgnoreInTests: true,
Name: "aws_access_analyzer_analyzer_finding_sources",
Description: "The source of the finding",
Resolver: schema.PathTableResolver("Sources"),
Columns: []schema.Column{
{
Name: "analyzer_finding_cq_id",
Expand All @@ -191,10 +189,9 @@ func Analyzers() *schema.Table {
},
},
{
Name: "aws_access_analyzer_analyzer_archive_rules",
Description: "Contains information about an archive rule",
Resolver: fetchAccessAnalyzerAnalyzerArchiveRules,
IgnoreInTests: true,
Name: "aws_access_analyzer_analyzer_archive_rules",
Description: "Contains information about an archive rule",
Resolver: fetchAccessAnalyzerAnalyzerArchiveRules,
Columns: []schema.Column{
{
Name: "analyzer_cq_id",
Expand Down Expand Up @@ -283,11 +280,6 @@ func fetchAccessAnalyzerAnalyzerFindings(ctx context.Context, meta schema.Client
}
return nil
}
func fetchAccessAnalyzerAnalyzerFindingSources(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
finding := parent.Item.(types.FindingSummary)
res <- finding.Sources
return nil
}
func fetchAccessAnalyzerAnalyzerArchiveRules(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
analyzer := parent.Item.(types.AnalyzerSummary)
c := meta.(*client.Client)
Expand Down
7 changes: 1 addition & 6 deletions resources/services/accessanalyzer/gen.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description_modifier "remove_read_only" {
resource "aws" "access_analyzer" "analyzers" {
path = "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types.AnalyzerSummary"
ignoreError "IgnoreAccessDenied" {
path = "github.com/cloudquery/cq-provider-aws/client.IgnoreAccessDeniedServiceDisabled"
path = "github.com/cloudquery/cq-provider-aws/client.IgnoreCommonErrors"
}
multiplex "AwsAccount" {
path = "github.com/cloudquery/cq-provider-aws/client.ServiceAccountRegionMultiplexer"
Expand Down Expand Up @@ -43,11 +43,6 @@ resource "aws" "access_analyzer" "analyzers" {
}

user_relation "aws" "access_analyzer" "findings" {
options {
primary_keys = [
"analyzer_cq_id", "id"
]
}
path = "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types.FindingSummary"
}

Expand Down
Loading

0 comments on commit 902c8e0

Please sign in to comment.