Skip to content

Added ARN support for get-parameter and get-parameters in SSM #11082

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wbeardall
Copy link

Fix to #11048

Motivation

Adding correct validation for ARN inputs to ssm get-parameter and ssm get-parameters

Changes

Adds an internal validation method to localstack.services.ssm.provider.SSMProvider (._normalize_name_or_arn) which validates either ARNs or parameter names, and throws errors consistent with the AWS implementation (to the best of my knowledge).

Testing

  • Added unit test TestSSM.test_get_parameter_by_arn

TODO

  • Add parity test to verify comparability responses (these should pass already, but have not implemented)
  • Partity test: incorrect ARN format, with regex pattern ^arn:aws:.+:.+:.+:.+$
    • Test designed to check parity with call aws ssm get-parameter --name arn:
  • Parity test: invalid region (either not matching a valid AWS region, or not the same region as the call context)
    • Test designed to check parity with call aws ssm get-parameter --name arn:aws:service:incorrect-region:0000000000:parameter/myparam
    • Note that the official implementation does not check that the service name is correct (i.e. there is no stipulation that service in the above is ssm; the following passes validation: aws ssm get-parameter --name arn:aws:service:us-east-1:0000000000:parameter/myparam)

@localstack-bot
Copy link
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


wbeardall seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@wbeardall
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@wbeardall
Copy link
Author

Note: Need to fix my test environment, as the provided instructions haven't worked on my machine. Will update when I have time.

@wbeardall wbeardall marked this pull request as draft June 25, 2024 11:56
@dominikschubert dominikschubert added this to the 3.7 milestone Jul 22, 2024
@dominikschubert
Copy link
Member

Hi @wbeardall !

as the provided instructions haven't worked on my machine.

Anything we can help with there? What's was the issue exactly?

@wbeardall
Copy link
Author

Hi @dominikschubert, I'm afraid I haven't had time to dig into this further; I'll try and circle back to this at some point!

@bentsku bentsku modified the milestones: 3.7, 3.8 Sep 4, 2024
@alexrashed alexrashed modified the milestones: 3.8, Playground Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants