- Newest
- Most votes
- Most comments
Your logs and code are not the same. In the logs, the code is giving an error due to this block: bucket_name= ssm.get_parameter(Name= 'dragon_data_bucket_name',WithDecryption='False')['Parmaeter']['value']
While in the code section, the syntax is correct: bucket_name = ssm.get_parameter(Name= 'dragon_data_bucket_name',WithDecryption=False)['Parameter']['value']
The error is due to a syntax error in your API call. The WithDecryption parameter for ssm.get_parameter API takes a bool value while you provided a string by enclosing it in quotes. Remove the quotes on your API call and it will work fine. Below is the updated API call syntax:
bucket_name = ssm.get_parameter(Name= 'dragon_data_bucket_name',WithDecryption=False)['Parameter']['value']
Please validate that you have submitted the correct syntax for the API call and resubmit the logs if you still have errors.
Your error log still doesn't match your code, it looks like you're not running the version you think you are? The log mentions 'Parmaeter' whereas your code has 'Parameter'. I'd suggest then that although your code now has the quotes removed from 'False' that you're actually running another version.
Relevant content
- Accepted Answerasked 7 months ago
- Accepted Answerasked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
It was my fault that I pasted the old err-log. I already removed the quotes and it still refused to compile. Here is the actual one (I also edited the question and changed the log):
Traceback (most recent call last): File "app.py", line 7, in <module> bucket_name= ssm.get_parameter(Name= 'dragon_data_bucket_name',WithDecryption='False')['Parmaeter']['value'] #Systems Manager File "/home/ec2-user/.local/lib/python3.7/site-packages/botocore/client.py", line 514, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/ec2-user/.local/lib/python3.7/site-packages/botocore/client.py", line 902, in _make_api_call api_params, operation_model, context=request_context File "/home/ec2-user/.local/lib/python3.7/site-packages/botocore/client.py", line 963, in _convert_to_request_dict api_params, operation_model File "/home/ec2-user/.local/lib/python3.7/site-packages/botocore/validate.py", line 381, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter WithDecryption, value: False, type: <class 'str'>, valid types: <class 'bool'>