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 databases (#1251)
Browse files Browse the repository at this point in the history
* feat: Added lightsail databases

* e2e fix

* lintner fix

* fix

* remove semaphore

* generate mock

* generate mock
  • Loading branch information
amanenk committed Jul 22, 2022
1 parent 382bb7f commit 72c2702
Show file tree
Hide file tree
Showing 11 changed files with 833 additions and 0 deletions.
100 changes: 100 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.

5 changes: 5 additions & 0 deletions client/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ type LightsailClient interface {
GetRelationalDatabaseSnapshots(ctx context.Context, params *lightsail.GetRelationalDatabaseSnapshotsInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabaseSnapshotsOutput, error)
GetLoadBalancers(ctx context.Context, params *lightsail.GetLoadBalancersInput, optFns ...func(*lightsail.Options)) (*lightsail.GetLoadBalancersOutput, error)
GetLoadBalancerTlsCertificates(ctx context.Context, params *lightsail.GetLoadBalancerTlsCertificatesInput, optFns ...func(*lightsail.Options)) (*lightsail.GetLoadBalancerTlsCertificatesOutput, error)
GetRelationalDatabases(ctx context.Context, params *lightsail.GetRelationalDatabasesInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabasesOutput, error)
GetRelationalDatabaseParameters(ctx context.Context, params *lightsail.GetRelationalDatabaseParametersInput, optFns ...func(*lightsail.Options)) (*lightsail.GetRelationalDatabaseParametersOutput, error)
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)
}

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

# Table: aws_lightsail_database_events
Describes an event for a database
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|database_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_databases table (FK)|
|created_at|timestamp without time zone|The timestamp when the database event was created|
|event_categories|text[]|The category that the database event belongs to|
|message|text|The message of the database event|
|resource|text|The database that the database event relates to|
10 changes: 10 additions & 0 deletions docs/tables/aws_lightsail_database_log_events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Table: aws_lightsail_database_log_events

## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|database_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_databases table (FK)|
|created_at|timestamp without time zone|The timestamp when the database log event was created|
|message|text|The message of the database log event|
|log_stream_name|text|An object describing the result of your get relational database log streams request|
15 changes: 15 additions & 0 deletions docs/tables/aws_lightsail_database_parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Table: aws_lightsail_database_parameters
Describes the parameters of a database
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|database_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_databases table (FK)|
|allowed_values|text|Specifies the valid range of values for the parameter|
|apply_method|text|Indicates when parameter updates are applied|
|apply_type|text|Specifies the engine-specific parameter type|
|data_type|text|Specifies the valid data type for the parameter|
|description|text|Provides a description of the parameter|
|is_modifiable|boolean|A Boolean value indicating whether the parameter can be modified|
|name|text|Specifies the name of the parameter|
|value|text|Specifies the value of the parameter|
10 changes: 10 additions & 0 deletions docs/tables/aws_lightsail_database_pending_maintenance_actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Table: aws_lightsail_database_pending_maintenance_actions
Describes a pending database maintenance action
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|database_cq_id|uuid|Unique CloudQuery ID of aws_lightsail_databases table (FK)|
|action|text|The type of pending database maintenance action|
|current_apply_date|timestamp without time zone|The effective date of the pending database maintenance action|
|description|text|Additional detail about the pending database maintenance action|
38 changes: 38 additions & 0 deletions docs/tables/aws_lightsail_databases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# Table: aws_lightsail_databases
Describes a database
## 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 database|
|backup_retention_enabled|boolean|A Boolean value indicating whether automated backup retention is enabled for the database|
|ca_certificate_identifier|text|The certificate associated with the 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_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_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|
|pending_modified_values_backup_retention_enabled|boolean|A Boolean value indicating whether automated backup retention is enabled|
|pending_modified_values_engine_version|text|The database engine version|
|pending_modified_values_master_user_password|text|The password for the master user of the database|
|preferred_backup_window|text|The daily time range during which automated backups are created for the database (for example, 16:00-16:30)|
|preferred_maintenance_window|text|The weekly time range during which system maintenance can occur on the database In the format ddd:hh24:mi-ddd:hh24:mi|
|publicly_accessible|boolean|A Boolean value indicating whether the database is publicly accessible|
|relational_database_blueprint_id|text|The blueprint ID for the database|
|relational_database_bundle_id|text|The bundle ID for the database|
|resource_type|text|The Lightsail resource type for the database (for example, RelationalDatabase)|
|secondary_availability_zone|text|Describes the secondary Availability Zone of a high availability database|
|state|text|Describes the current state of the database|
|support_code|text|The support code for the database|
|tags|jsonb|The tag keys and optional values for the resource|
1 change: 1 addition & 0 deletions resources/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func Provider() *provider.Provider {
"lightsail.buckets": lightsail.Buckets(),
"lightsail.certificates": lightsail.Certificates(),
"lightsail.database_snapshots": lightsail.DatabaseSnapshots(),
"lightsail.databases": lightsail.Databases(),
"lightsail.disks": lightsail.Disks(),
"lightsail.instances": lightsail.Instances(),
"lightsail.load_balancers": lightsail.LoadBalancers(),
Expand Down
Loading

0 comments on commit 72c2702

Please sign in to comment.