-
Notifications
You must be signed in to change notification settings - Fork 544
feat(aws): Support RDS Reserved Instances #8260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR has the following changes to source plugin(s) tables:
|
| rds.EngineVersions(), | ||
| rds.EventSubscriptions(), | ||
| rds.Instances(), | ||
| rds.ReservedInstances(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New resource. All other changes are ordering changes
| package rds | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/aws/aws-sdk-go-v2/aws" | ||
| "github.com/aws/aws-sdk-go-v2/service/rds" | ||
| "github.com/aws/aws-sdk-go-v2/service/rds/types" | ||
| "github.com/cloudquery/cloudquery/plugins/source/aws/client" | ||
| "github.com/cloudquery/plugin-sdk/schema" | ||
| ) | ||
|
|
||
| func fetchRdsInstances(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error { | ||
| var config rds.DescribeDBInstancesInput | ||
| c := meta.(*client.Client) | ||
| svc := c.Services().Rds | ||
| for { | ||
| response, err := svc.DescribeDBInstances(ctx, &config) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| res <- response.DBInstances | ||
| if aws.ToString(response.Marker) == "" { | ||
| break | ||
| } | ||
| config.Marker = response.Marker | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| func resolveRdsInstanceProcessorFeatures(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error { | ||
| r := resource.Item.(types.DBInstance) | ||
| processorFeatures := map[string]*string{} | ||
| for _, t := range r.ProcessorFeatures { | ||
| processorFeatures[*t.Name] = t.Value | ||
| } | ||
| return resource.Set(c.Name, processorFeatures) | ||
| } | ||
|
|
||
| func resolveRdsInstanceTags(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error { | ||
| r := resource.Item.(types.DBInstance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to instance.go file
| func fetchRdsReservedInstances(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error { | ||
| var config rds.DescribeReservedDBInstancesInput | ||
| c := meta.(*client.Client) | ||
| svc := c.Services().Rds | ||
| paginator := rds.NewDescribeReservedDBInstancesPaginator(svc, &config) | ||
| for paginator.HasMorePages() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran it against our AWS account, but no way to get actual data as we would have to pay for a year...
🤖 I have created a release *beep* *boop* --- ## [15.2.0](plugins-source-aws-v15.1.0...plugins-source-aws-v15.2.0) (2023-02-21) ### Features * **aws:** CloudFormation stack_resources to include stack id ([#8141](#8141)) ([2c6bfe2](2c6bfe2)) * **aws:** Support RDS Reserved Instances ([#8260](#8260)) ([6aef2d1](6aef2d1)) ### Bug Fixes * **deps:** Update module github.com/aws/aws-sdk-go-v2/config to v1.18.13 ([#8231](#8231)) ([1eb436d](1eb436d)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.11.53 ([#8233](#8233)) ([3bc3b86](3bc3b86)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/internal/v4a to v1.0.20 ([#8234](#8234)) ([6516f73](6516f73)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/accessanalyzer to v1.19.3 ([#8235](#8235)) ([a1d1072](a1d1072)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/acm to v1.17.3 ([#8236](#8236)) ([a5fea7d](a5fea7d)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/amp to v1.16.2 ([#8237](#8237)) ([b8040ea](b8040ea)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/amplify to v1.13.2 ([#8238](#8238)) ([4e719a8](4e719a8)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/apigateway to v1.16.3 ([#8239](#8239)) ([a3a4f79](a3a4f79)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/apigatewayv2 to v1.13.3 ([#8240](#8240)) ([63170f6](63170f6)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/applicationautoscaling to v1.17.3 ([#8241](#8241)) ([1ee38d6](1ee38d6)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/athena to v1.22.2 ([#8242](#8242)) ([bd980fa](bd980fa)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 to v1.14.2 ([#8243](#8243)) ([c849f73](c849f73)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs to v1.20.3 ([#8244](#8244)) ([5abb3d4](5abb3d4)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/codebuild to v1.20.3 ([#8245](#8245)) ([16e80e3](16e80e3)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/codepipeline to v1.14.2 ([#8246](#8246)) ([bad0617](bad0617)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cognitoidentity to v1.15.2 ([#8247](#8247)) ([bfbeee0](bfbeee0)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider to v1.22.2 ([#8248](#8248)) ([65ece07](65ece07)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/configservice to v1.29.3 ([#8249](#8249)) ([d91fcde](d91fcde)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/databasemigrationservice to v1.23.3 ([#8250](#8250)) ([762e076](762e076)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/dax to v1.12.2 ([#8251](#8251)) ([7e1a123](7e1a123)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/directconnect to v1.18.3 ([#8252](#8252)) ([23292ba](23292ba)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/dynamodb to v1.18.3 ([#8253](#8253)) ([2d767aa](2d767aa)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/ecr to v1.18.3 ([#8254](#8254)) ([fd6fb50](fd6fb50)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.38.2 ([#8156](#8156)) ([ac2d2d7](ac2d2d7)) * **deps:** Update module golang.org/x/net to v0.7.0 [SECURITY] ([#8176](#8176)) ([fc4cef8](fc4cef8)) * Update endpoints ([#8265](#8265)) ([a7cb153](a7cb153)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary