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

Add RDS Cluster and DB snapshots and attributes #287

Merged
merged 6 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
80 changes: 80 additions & 0 deletions client/mocks/mock_rds.go

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

8 changes: 6 additions & 2 deletions client/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,14 @@ type OrganizationsClient interface {

//go:generate mockgen -package=mocks -destination=./mocks/mock_rds.go . RdsClient
type RdsClient interface {
DescribeDBInstances(ctx context.Context, params *rds.DescribeDBInstancesInput, optFns ...func(*rds.Options)) (*rds.DescribeDBInstancesOutput, error)
DescribeCertificates(ctx context.Context, params *rds.DescribeCertificatesInput, optFns ...func(*rds.Options)) (*rds.DescribeCertificatesOutput, error)
DescribeDBClusters(ctx context.Context, params *rds.DescribeDBClustersInput, optFns ...func(*rds.Options)) (*rds.DescribeDBClustersOutput, error)
DescribeDBClusterSnapshotAttributes(ctx context.Context, params *rds.DescribeDBClusterSnapshotAttributesInput, optFns ...func(*rds.Options)) (*rds.DescribeDBClusterSnapshotAttributesOutput, error)
DescribeDBClusterSnapshots(ctx context.Context, params *rds.DescribeDBClusterSnapshotsInput, optFns ...func(*rds.Options)) (*rds.DescribeDBClusterSnapshotsOutput, error)
DescribeDBInstances(ctx context.Context, params *rds.DescribeDBInstancesInput, optFns ...func(*rds.Options)) (*rds.DescribeDBInstancesOutput, error)
DescribeDBSnapshotAttributes(ctx context.Context, params *rds.DescribeDBSnapshotAttributesInput, optFns ...func(*rds.Options)) (*rds.DescribeDBSnapshotAttributesOutput, error)
DescribeDBSnapshots(ctx context.Context, params *rds.DescribeDBSnapshotsInput, optFns ...func(*rds.Options)) (*rds.DescribeDBSnapshotsOutput, error)
DescribeDBSubnetGroups(ctx context.Context, params *rds.DescribeDBSubnetGroupsInput, optFns ...func(*rds.Options)) (*rds.DescribeDBSubnetGroupsOutput, error)
DescribeCertificates(ctx context.Context, params *rds.DescribeCertificatesInput, optFns ...func(*rds.Options)) (*rds.DescribeCertificatesOutput, error)
}

//go:generate mockgen -package=mocks -destination=./mocks/mock_s3.go . S3Client
Expand Down
31 changes: 31 additions & 0 deletions docs/tables/aws_rds_cluster_snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Table: aws_rds_cluster_snapshots
Contains the details for an Amazon RDS DB cluster snapshot This data type is used as a response element in the DescribeDBClusterSnapshots action.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|allocated_storage|integer|Specifies the allocated storage size in gibibytes (GiB).|
|availability_zones|text[]|Provides the list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored.|
|cluster_create_time|timestamp without time zone|Specifies the time when the DB cluster was created, in Universal Coordinated Time (UTC).|
|db_cluster_identifier|text|Specifies the DB cluster identifier of the DB cluster that this DB cluster snapshot was created from.|
|arn|text|The Amazon Resource Name (ARN) for the DB cluster snapshot.|
|db_cluster_snapshot_identifier|text|Specifies the identifier for the DB cluster snapshot.|
|engine|text|Specifies the name of the database engine for this DB cluster snapshot.|
|engine_mode|text|Provides the engine mode of the database engine for this DB cluster snapshot.|
|engine_version|text|Provides the version of the database engine for this DB cluster snapshot.|
|iam_database_authentication_enabled|boolean|True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.|
|kms_key_id|text|If StorageEncrypted is true, the AWS KMS key identifier for the encrypted DB cluster snapshot|
|license_model|text|Provides the license model information for this DB cluster snapshot.|
|master_username|text|Provides the master username for this DB cluster snapshot.|
|percent_progress|integer|Specifies the percentage of the estimated data that has been transferred.|
|port|integer|Specifies the port that the DB cluster was listening on at the time of the snapshot.|
|snapshot_create_time|timestamp without time zone|Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC).|
|snapshot_type|text|Provides the type of the DB cluster snapshot.|
|source_db_cluster_snapshot_arn|text|If the DB cluster snapshot was copied from a source DB cluster snapshot, the Amazon Resource Name (ARN) for the source DB cluster snapshot, otherwise, a null value.|
|status|text|Specifies the status of this DB cluster snapshot.|
|storage_encrypted|boolean|Specifies whether the DB cluster snapshot is encrypted.|
|vpc_id|text|Provides the VPC ID associated with the DB cluster snapshot.|
|tags|jsonb|Resource tags.|
|attributes|jsonb|Snapshot attribute names and values|
9 changes: 9 additions & 0 deletions docs/tables/aws_rds_db_snapshot_processor_features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Table: aws_rds_db_snapshot_processor_features
Contains the processor features of a DB instance class
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|db_snapshot_cq_id|uuid|Unique CloudQuery ID of aws_rds_db_snapshots table (FK)|
|name|text|The name of the processor feature|
|value|text|The value of a processor feature name.|
37 changes: 37 additions & 0 deletions docs/tables/aws_rds_db_snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Table: aws_rds_db_snapshots
Contains the details of an Amazon RDS DB snapshot
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|allocated_storage|integer|Specifies the allocated storage size in gibibytes (GiB).|
|availability_zone|text|Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.|
|db_instance_identifier|text|Specifies the DB instance identifier of the DB instance this DB snapshot was created from.|
|arn|text|The Amazon Resource Name (ARN) for the DB snapshot.|
|db_snapshot_identifier|text|Specifies the identifier for the DB snapshot.|
|dbi_resource_id|text|The identifier for the source DB instance, which can't be changed and which is unique to an AWS Region.|
|encrypted|boolean|Specifies whether the DB snapshot is encrypted.|
|engine|text|Specifies the name of the database engine.|
|engine_version|text|Specifies the version of the database engine.|
|iam_database_authentication_enabled|boolean|True if mapping of AWS Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.|
|instance_create_time|timestamp without time zone|Specifies the time in Coordinated Universal Time (UTC) when the DB instance, from which the snapshot was taken, was created.|
|iops|integer|Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.|
|kms_key_id|text|If Encrypted is true, the AWS KMS key identifier for the encrypted DB snapshot. The AWS KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS customer master key (CMK).|
|license_model|text|License model information for the restored DB instance.|
|master_username|text|Provides the master username for the DB snapshot.|
|option_group_name|text|Provides the option group name for the DB snapshot.|
|percent_progress|integer|The percentage of the estimated data that has been transferred.|
|port|integer|Specifies the port that the database engine was listening on at the time of the snapshot.|
|snapshot_create_time|timestamp without time zone|Specifies when the snapshot was taken in Coordinated Universal Time (UTC).|
|snapshot_type|text|Provides the type of the DB snapshot.|
|source_db_snapshot_identifier|text|The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied from. It only has value in case of cross-customer or cross-region copy.|
|source_region|text|The AWS Region that the DB snapshot was created in or copied from.|
|status|text|Specifies the status of this DB snapshot.|
|storage_type|text|Specifies the storage type associated with DB snapshot.|
|tde_credential_arn|text|The ARN from the key store with which to associate the instance for TDE encryption.|
|timezone|text|The time zone of the DB snapshot|
|vpc_id|text|Provides the VPC ID associated with the DB snapshot.|
|tags|jsonb|Resource tags.|
|attributes|jsonb|Snapshot attribute names and values|
2 changes: 2 additions & 0 deletions resources/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func Provider() *provider.Provider {
"organizations.accounts": OrganizationsAccounts(),
"rds.certificates": RdsCertificates(),
"rds.clusters": RdsClusters(),
"rds.cluster_snapshots": RdsClusterSnapshots(),
"rds.db_snapshots": RdsDbSnapshots(),
"rds.db_subnet_groups": RdsSubnetGroups(),
"rds.instances": RdsInstances(),
"redshift.clusters": RedshiftClusters(),
Expand Down
Loading