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

rds modify-db-snapshot-attribute won't accept actual snapshot identifier #8296

Closed
darianjd opened this issue Nov 3, 2023 · 4 comments
Closed
Assignees
Labels
rds response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@darianjd
Copy link

darianjd commented Nov 3, 2023

Describe the bug

rds modify-db-snapshot-attribute is rejecting an actual snapshot identifier as invalid

Expected Behavior

The same snapshot identifier should be accepted just as it is accepted by decribe-db-snapshot:

{
    "DBSnapshotAttributesResult": {
        "DBSnapshotIdentifier": "rds:xxxx-xxxx-xxxx-xxxx-1234-12-12-12-12",
        "DBSnapshotAttributes": [
            {
                "AttributeName": "restore",
                "AttributeValues": []
            }
        ]
    }
}```

### Current Behavior

`aws rds modify-db-snapshot-attribute --db-snapshot-identifier` will not accept an actual snapshot identifier, citing the name as invalid. ```# aws rds modify-db-snapshot-attribute --db-snapshot-identifier rds:xxxx-xxxx-xxxx-xxxx-1234-12-12-12-12 --attribute-name restore --values-to-add ########

An error occurred (InvalidParameterValue) when calling the ModifyDBSnapshotAttribute operation: The parameter DBSnapshotIdentifier is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.

Reproduction Steps

Attempt to modify an attribute of a db snapshot with a colon in its name.

e.g.: aws rds modify-db-snapshot-attribute --db-snapshot-identifier rds:xxxx-xxxx-xxxx-xxxx-1234-12-12-12-12 --attribute-name restore --values-to-add ########

In the case. the value being added would be another AWS account.

Possible Solution

Change the string validation being used for modify-db-snapshot-attribute to match the validation used for describe-db-snapshot-attributes

Additional Information/Context

No response

CLI version used

2.13.30

Environment details (OS name and version, etc.)

RHEL 8.8

@darianjd darianjd added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 3, 2023
@tim-finnigan tim-finnigan self-assigned this Nov 6, 2023
@tim-finnigan
Copy link
Contributor

Hi @darianjd thanks for reaching out.

The CLI modify-db-snapshot-attribute command corresponds to the RDS ModifyDBSnapshotAttribute API. The InvalidParameterValue error is returned by the RDS API (for reference, it is documented here.)

I was not able to reproduce this issue. When I tried to assign a DB snapshot identifier in that format, I received the following error

> aws rds create-db-snapshot --db-snapshot-identifier rds:my-snapshot --db-instance-identifier mydbinstance
> 
> An error occurred (InvalidParameterValue) when calling the CreateDBSnapshot operation: The parameter DBSnapshotIdentifier is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.

I could not modify it that way either:

image

So I'm not sure why you saw an identifier returned rds:... prefix. When I ran describe-db-snapshots and describe-db-snapshot-attributes after assigning an identifer my-snapshot, it does not prepend that value with rds* in the response:


image

Did you assign your DB snapshot identifer in the console with the rds:* prefix? Or do you have any code modifications or third-party software that could be adding that? If you could share your debug logs (with any sensitive info redacted) by adding --debug to the command, that might help provide more insight.

@tim-finnigan tim-finnigan added rds response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. service-api This issue is due to a problem in a service API, not the SDK implementation. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2023
@darianjd
Copy link
Author

darianjd commented Nov 8, 2023 via email

@darianjd
Copy link
Author

darianjd commented Nov 8, 2023 via email

@darianjd darianjd closed this as completed Nov 8, 2023
Copy link

github-actions bot commented Nov 8, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rds response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants