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

feat: Ssm paramater policy fix #2693

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

aaythapa
Copy link
Contributor

@aaythapa aaythapa commented Dec 1, 2022

Issue #, if available

#1112

Description of changes

The SSM parameter name can have a leading slash and not have one (as per the docs). Right now the SSMParamaeterReadPolicy doesn't account for names that have a leading slash. The resource arn is arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${parameterName} which adds an extra slash if the ${parameterName} has a leading slash. Can't change the policy directly as that would break compatibility. Added a new policy that customers can use when their parameter name has a leading slash.

Description of how you validated changes

Checklist

  • Adheres to the development guidelines
  • Add/update unit tests using:
  • Add/update integration tests
  • Update documentation
  • Verify transformed template deploys and application functions as expected
  • Do these changes include any template validations?
    • Did the newly validated properties support intrinsics prior to adding the validations? (If unsure, please review Intrinsic Functions before proceeding).
      • Does the pull request ensure that intrinsics remain functional with the new validations?

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aaythapa
Copy link
Contributor Author

Opened security consultation, waiting for approval

@aaythapa
Copy link
Contributor Author

aaythapa commented Feb 2, 2023

Got security approval

@aaythapa aaythapa marked this pull request as ready for review February 2, 2023 22:46
@aaythapa aaythapa requested a review from a team as a code owner February 2, 2023 22:46
@aaythapa aaythapa enabled auto-merge (squash) February 2, 2023 22:47
@aaythapa aaythapa changed the title Ssm paramater policy fix feat: Ssm paramater policy fix Feb 2, 2023
@aaythapa aaythapa merged commit 7655aad into aws:develop Feb 2, 2023
@xazhao
Copy link
Contributor

xazhao commented Feb 2, 2023

Can we remove the extra slash if it is invalid?

@aaythapa
Copy link
Contributor Author

aaythapa commented Feb 2, 2023

Can we remove the extra slash if it is invalid?

Having a name with a slash and and without a slash are both valid so we need both policies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants