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

Commit

Permalink
feat: Added lightsail instances relations (#1266)
Browse files Browse the repository at this point in the history
* feat: Added lightsail instance snapshots

* feat: Added lightsail instances relations

* fix

* linter
  • Loading branch information
amanenk committed Jul 22, 2022
1 parent 4738faa commit d6ecaae
Show file tree
Hide file tree
Showing 17 changed files with 741 additions and 100 deletions.
60 changes: 60 additions & 0 deletions client/mocks/mock_lightsail.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions client/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ type LightsailClient interface {
GetRelationalDatabaseEvents(ctx context.Context, params *lightsail.GetRelationalDatabaseEventsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabaseEventsOutput, error)
GetRelationalDatabaseLogEvents(ctx context.Context, params *lightsail.GetRelationalDatabaseLogEventsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabaseLogEventsOutput, error)
GetRelationalDatabaseLogStreams(ctx context.Context, params *lightsail.GetRelationalDatabaseLogStreamsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabaseLogStreamsOutput, error)
GetInstanceSnapshots(ctx context.Context, params *lightsail.GetInstanceSnapshotsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetInstanceSnapshotsOutput, error)
GetInstancePortStates(ctx context.Context, params *lightsail.GetInstancePortStatesInput, optFns ...func(*lightsail.Options)) (*lightsail.GetInstancePortStatesOutput, error)
GetInstanceAccessDetails(ctx context.Context, params *lightsail.GetInstanceAccessDetailsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetInstanceAccessDetailsOutput, error)
}

//go:generate mockgen -package=mocks -destination=./mocks/mock_mq.go . MQClient
Expand Down
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_instance_add_ons.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

# Table: aws_lightsail_instance_add_ons
Describes an add-on that is enabled for an Amazon Lightsail resource.
Describes an add-on that is enabled for an Amazon Lightsail resource
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instances table (FK)|
|name|text|The name of the add-on.|
|name|text|The name of the add-on|
|next_snapshot_time_of_day|text|The next daily time an automatic snapshot will be created|
|snapshot_time_of_day|text|The daily time when an automatic snapshot is created|
|status|text|The status of the add-on.|
|status|text|The status of the add-on|
6 changes: 3 additions & 3 deletions docs/tables/aws_lightsail_instance_hardware_disk_add_ons.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

# Table: aws_lightsail_instance_hardware_disk_add_ons
Describes an add-on that is enabled for an Amazon Lightsail resource.
Describes an add-on that is enabled for an Amazon Lightsail resource
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_hardware_disk_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instance_hardware_disks table (FK)|
|name|text|The name of the add-on.|
|name|text|The name of the add-on|
|next_snapshot_time_of_day|text|The next daily time an automatic snapshot will be created|
|snapshot_time_of_day|text|The daily time when an automatic snapshot is created|
|status|text|The status of the add-on.|
|status|text|The status of the add-on|
27 changes: 14 additions & 13 deletions docs/tables/aws_lightsail_instance_hardware_disks.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@

# Table: aws_lightsail_instance_hardware_disks
Describes a block storage disk.
Describes a block storage disk
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instances table (FK)|
|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.|
|iops|integer|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).|
|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|
|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 (e.g., Disk).|
|size_in_gb|integer|The size of the disk in GB.|
|state|text|Describes the status of the disk.|
|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|
|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_networking_ports.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

# Table: aws_lightsail_instance_networking_ports
Describes information about ports for an Amazon Lightsail instance.
Describes information about ports for an Amazon Lightsail instance
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instances table (FK)|
|access_direction|text|The access direction (inbound or outbound)|
|access_from|text|The location from which access is allowed|
|access_type|text|The type of access (Public or Private).|
|access_type|text|The type of access (Public or Private)|
|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.|
|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|
|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|
Expand Down
14 changes: 14 additions & 0 deletions docs/tables/aws_lightsail_instance_port_states.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Table: aws_lightsail_instance_port_states
Describes open ports on an instance, the IP addresses allowed to connect to the instance through the ports, and the protocol
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|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|
|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|
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Table: aws_lightsail_instance_snapshot_from_attached_disk_add_ons
Describes an add-on that is enabled for an Amazon Lightsail resource
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_snapshot_from_attached_disk_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instance_snapshot_from_attached_disks table (FK)|
|name|text|The name of the add-on|
|next_snapshot_time_of_day|text|The next daily time an automatic snapshot will be created|
|snapshot_time_of_day|text|The daily time when an automatic snapshot is created|
|status|text|The status of the add-on|
24 changes: 24 additions & 0 deletions docs/tables/aws_lightsail_instance_snapshot_from_attached_disks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Table: aws_lightsail_instance_snapshot_from_attached_disks
Describes a block storage disk
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|instance_snapshot_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_instance_snapshots table (FK)|
|arn|text|The Amazon Resource Name (ARN) of the 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|
|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|
|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|
23 changes: 23 additions & 0 deletions docs/tables/aws_lightsail_instance_snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Table: aws_lightsail_instance_snapshots
Describes an instance snapshot
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|arn|text|The Amazon Resource Name (ARN) of the snapshot (eg, arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot/d23b5706-3322-4d83-81e5-12345EXAMPLE)|
|created_at|timestamp without time zone|The timestamp when the snapshot was created (eg, 1479907467024)|
|from_blueprint_id|text|The blueprint ID from which you created the snapshot (eg, os_debian_8_3)|
|from_bundle_id|text|The bundle ID from which you created the snapshot (eg, micro_1_0)|
|from_instance_arn|text|The Amazon Resource Name (ARN) of the instance from which the snapshot was created (eg, arn:aws:lightsail:us-east-2:123456789101:Instance/64b8404c-ccb1-430b-8daf-12345EXAMPLE)|
|from_instance_name|text|The instance from which the snapshot was created|
|is_from_auto_snapshot|boolean|A Boolean value indicating whether the snapshot was created from an automatic snapshot|
|availability_zone|text|The Availability Zone|
|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|
|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|
41 changes: 21 additions & 20 deletions docs/tables/aws_lightsail_instances.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@

# Table: aws_lightsail_instances
Describes an instance (a virtual private server).
Describes an instance (a virtual private server)
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|arn|text|The Amazon Resource Name (ARN) of the instance (e.g., arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE).|
|blueprint_id|text|The blueprint ID (e.g., os_amlinux_2016_03).|
|blueprint_name|text|The friendly name of the blueprint (e.g., Amazon Linux).|
|bundle_id|text|The bundle for the instance (e.g., micro_1_0).|
|created_at|timestamp without time zone|The timestamp when the instance was created (e.g., 1479734909.17) in Unix time format.|
|hardware_cpu_count|integer|The number of vCPUs the instance has.|
|hardware_ram_size_in_gb|float|The amount of RAM in GB on the instance (e.g., 1.0).|
|access_details|jsonb||
|arn|text|The Amazon Resource Name (ARN) of the instance (eg, arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE)|
|blueprint_id|text|The blueprint ID (eg, os_amlinux_2016_03)|
|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_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.|
|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 (e.g., Amazon_Linux-1GB-Ohio-1).|
|networking_monthly_transfer_gb_per_month_allocated|integer|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 (e.g., LightsailDefaultKeyPair).|
|state_code|integer|The status code for the instance.|
|state_name|text|The state of the instance (e.g., running or pending).|
|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)|
|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_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|
|username|text|The user name for connecting to the instance (e.g., ec2-user).|
|username|text|The user name for connecting to the instance (eg, ec2-user)|
1 change: 1 addition & 0 deletions resources/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func Provider() *provider.Provider {
"lightsail.databases": lightsail.Databases(),
"lightsail.disks": lightsail.Disks(),
"lightsail.instances": lightsail.Instances(),
"lightsail.instance_snapshots": lightsail.InstanceSnapshots(),
"lightsail.load_balancers": lightsail.LoadBalancers(),
"lightsail.static_ips": lightsail.StaticIps(),
"mq.brokers": mq.Brokers(),
Expand Down
Loading

0 comments on commit d6ecaae

Please sign in to comment.