Trying to grant lake permissions via a Lambda Function. (Python 3.8) As far as I can see, I have my code as per documentation. Yet hitting a barrage of nonsense errors about parameters being incorrect. Could it be that I just need an optician ? Or is it some nuance or which way the Amazon wind blows today ?
import boto3
import json
from botocore.exceptions import ClientError
def main(event,context):
client = boto3.client('lakeformation')
response = client.grant_permissions(
Principal={
'DataLakePrincipalIdentifier': 'arn:aws:iam::123456789012:role/myRole'
},
Resource={
'Table': {
'DatabaseName': 'myDatabase',
'TableWildcard': {}
},
},
Permissions=['ALL'],
PermissionsWithGrantOption=['ALL']
)
======================================================================================
[ERROR] ParamValidationError: Parameter validation failed: Missing required parameter in Resource.Table: "Name" Unknown parameter in Resource.Table: "TableWildcard", must be one of: DatabaseName, Name Traceback (most recent call last): File "/var/task/main.py", line 10, in main response = client.grant_permissions( File "/var/runtime/botocore/client.py", line 316, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/runtime/botocore/client.py", line 607, in _make_api_call request_dict = self._convert_to_request_dict( File "/var/runtime/botocore/client.py", line 655, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/var/runtime/botocore/validate.py", line 297, in serialize_to_request raise ParamValidationError(report=report.generate_report())