Skip to content
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

Data source aws_db_snapshot: Shared and public snapshot fix (issue #3907) #5767

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dougneal
Copy link
Contributor

@dougneal dougneal commented Sep 4, 2018

Fixes #3907

Changes proposed in this pull request:

  • If snapshot_type is set to shared or public;
    • Don't include DBInstanceIdentifier in the query parameters, even if db_instance_identifier is given in the resource declaration
    • If db_instance_identifier is given in the resource declaration, filter the query results client side before returning them.

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSDbSnapshotDataSource_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSDbSnapshotDataSource_basic -timeout 120m
=== RUN   TestAccAWSDbSnapshotDataSource_basic
--- PASS: TestAccAWSDbSnapshotDataSource_basic (838.56s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	838.603s

A combination of `snapshot_type = "shared"` and `db_instance_identifier`
would always return an empty result set due to the server side filtering
against the DB Instance Identifier only considering instance identifiers
from the local account, as opposed to from the source account.

It is still possible to filter the results client-side, so do that
instead.
@dougneal dougneal changed the title Data source aws_db_snapshot: Shared and public snapshot fix Data source aws_db_snapshot: Shared and public snapshot fix (issue #3907) Sep 4, 2018
@bflad bflad added the service/rds Issues and PRs that pertain to the rds service. label Sep 4, 2018
@anthonyd-cd
Copy link

any update on this merge? I'm having an issue where I want to build an RDS Instance of a shared snapshot but can't. This would solve the issue.

@Wibles
Copy link

Wibles commented Apr 30, 2019

This issue is also blocking us. Any update?

@aeschright aeschright requested a review from a team June 25, 2019 21:27
Base automatically changed from master to main January 23, 2021 00:55
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:55
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@CEikermann
Copy link

@dougneal would if be possible that you can rebase this branch?

@Gregy
Copy link

Gregy commented Mar 15, 2022

I have rebased this PR onto the current code here: https://github.com/Gregy/terraform-provider-aws/tree/fix-shared-aws_db_snapshot

If you have time you can take it and update this PR with it. I will not create a competing PR.

I have also pushed a version of the provider with this functionality integrated into the registry

@janzelc-trifecta
Copy link

I have rebased this PR onto the current code here: https://github.com/Gregy/terraform-provider-aws/tree/fix-shared-aws_db_snapshot

If you have time you can take it and update this PR with it. I will not create a competing PR.

I have also pushed a version of the provider with this functionality integrated into the registry

This PR seems dead. Any way to revive it? Seems like @Gregy has a resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data source aws_db_snapshot doesn't find a shared snapshot
8 participants