-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Auth.ResourcePolicy.IpRangeWhitelist is malformed when populated from a CommaDelimitedList SSM Param #1696
Comments
Hello all, any updates regarding this issue? Edit: I'd like to add that in addition to the above-mentionned bug, when providing a manual list of IP addresses, the resulting policy applies the IP Whitelist to an erroneous endpoint: Api Gateway Resource Policy result:
Expected behaviour:
Where MfaCatcherApi:
Type: AWS::Serverless::Api
Properties:
Name: !Ref ApiName
StageName: !Ref ApiStageName |
You might be able to get this to work by adding Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
See #2533 for more information. |
Closing in favor of #2533. |
I can confirm that adding the |
Description
I have a list of IPs that are allowed to execute my function stored in an SSM parameter of type
StringList
. When I pass this parameter to my SAM template as typeAWS::SSM::Parameter::Value<CommaDelimitedList>
(I also triedAWS::SSM::Parameter::Value<List<String>>
) and reference this parameter inIpRangeWhitelist
it is expanded to an array within an array.Steps to reproduce
Create an SSM Parameter of allowed IPs
aws ssm put-parameter --name /test/iplist --type StringList --value "192.168.1.1/32,192.168.1.5/32,192.168.1.100/31"
Create a new SAM project using
sam init
, selecting Node12 and hello-world templateModify
template.yml
to the following (aditional lines marked with# New
, outputs omitted):Attempt to deploy the stack with
sam build && sam deploy --guided
Observed result
Deploy fails on
AWS::ApiGateway::RestApi
, Excerpts fromsam deploy --debug
output:Inspecting the
ServerlessRestApi CREATE_FAILED
event withaws cloudformation describe-stack-events
shows the following (ResourceProperties
reformatted for readability):aws:SourceIp
in the generated ResourcePolicy contains my ip list in an array inside another arrayExpected result
I expect the generated ResourcePolicy to include the following JSON from my ip blacklist:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:1.1.0
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: