Describe the bug
When the short hard syntax has open and closed curly braces in one of the values to the key, the CLI throws following error.
awscli.argprocess.ParamError: Error parsing parameter '--patch-operations': Expected: ',', received: '}' for input:
Expected Behavior
CLI should process the string value as it is.
Current Behavior
@
|
_FIRST_VALUE = _NamedRegex( |
at this line, regex computed only takes till the closed parenthesis.
e.g, for a key-value of
value=arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version}/invocations
value extracted by the regex is 'arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version'
Reproduction Steps
Create API Gateway REST API with a resource path and method with lambda integration.
try the following command:
newuri='arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version}/invocations'
aws apigateway update-integration --rest-api-id xxxxxx --resource-id xxxxx --http-method ANY --patch-operation op="replace",path="/uri",value="$newuri" --debug
This command gives following output:
Traceback (most recent call last):
File "/usr/local/Cellar/awscli/2.8.13/libexec/lib/python3.11/site-packages/awscli/argprocess.py", line 345, in _parse_as_shorthand
parsed = [self._parser.parse(v) for v in value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/awscli/2.8.13/libexec/lib/python3.11/site-packages/awscli/argprocess.py", line 345, in <listcomp>
parsed = [self._parser.parse(v) for v in value]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/awscli/2.8.13/libexec/lib/python3.11/site-packages/awscli/shorthand.py", line 172, in parse
return self._parameter()
^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/awscli/2.8.13/libexec/lib/python3.11/site-packages/awscli/shorthand.py", line 181, in _parameter
self._expect(',', consume_whitespace=True)
File "/usr/local/Cellar/awscli/2.8.13/libexec/lib/python3.11/site-packages/awscli/shorthand.py", line 355, in _expect
raise ShorthandParseSyntaxError(self._input_value, char,
awscli.shorthand.ShorthandParseSyntaxError: Expected: ',', received: '}' for input:
op=replace,path=/uri,value=arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxx:function:Say-hello-world:${stageVariables.version}/invocations
Possible Solution
This problem does not occur when the value is quoted.
Additional Information/Context
No response
CLI version used
aws-cli/2.8.13 Python/3.11.0 Darwin/21.6.0 source/x86_64 prompt/off
Environment details (OS name and version, etc.)
MacOS
Describe the bug
When the short hard syntax has open and closed curly braces in one of the values to the key, the CLI throws following error.
awscli.argprocess.ParamError: Error parsing parameter '--patch-operations': Expected: ',', received: '}' for input:Expected Behavior
CLI should process the string value as it is.
Current Behavior
@
aws-cli/awscli/shorthand.py
Line 136 in 9b6e981
at this line, regex computed only takes till the closed parenthesis.
e.g, for a key-value of
value=arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version}/invocationsvalue extracted by the regex is 'arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version'
Reproduction Steps
Create API Gateway REST API with a resource path and method with lambda integration.
try the following command:
newuri='arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxxxxxxxxx:function:Say-hello-world:${stageVariables.version}/invocations'aws apigateway update-integration --rest-api-id xxxxxx --resource-id xxxxx --http-method ANY --patch-operation op="replace",path="/uri",value="$newuri" --debugThis command gives following output:
Possible Solution
This problem does not occur when the value is quoted.
Additional Information/Context
No response
CLI version used
aws-cli/2.8.13 Python/3.11.0 Darwin/21.6.0 source/x86_64 prompt/off
Environment details (OS name and version, etc.)
MacOS