Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,30 @@ def _get_lambda_code_param(
return code


def _transform_function_to_model(function):
model_properties = [
"MemorySize",
"Description",
"TracingConfig",
"Timeout",
"Handler",
"SnapStartResponse",
"Role",
"FileSystemConfigs",
"FunctionName",
"Runtime",
"PackageType",
"LoggingConfig",
"Environment",
"Arn",
"EphemeralStorage",
"Architectures",
]
response_model = util.select_attributes(function, model_properties)
response_model["Arn"] = function["FunctionArn"]
return response_model


class LambdaFunctionProvider(ResourceProvider[LambdaFunctionProperties]):
TYPE = "AWS::Lambda::Function" # Autogenerated. Don't change
SCHEMA = util.get_schema_path(Path(__file__)) # Autogenerated. Don't change
Expand Down Expand Up @@ -407,7 +431,14 @@ def read(
- lambda:GetFunction
- lambda:GetFunctionCodeSigningConfig
"""
raise NotImplementedError
function_name = request.desired_state["FunctionName"]
lambda_client = request.aws_client_factory.lambda_
get_fn_response = lambda_client.get_function(FunctionName=function_name)

return ProgressEvent(
status=OperationStatus.SUCCESS,
resource_model=_transform_function_to_model(get_fn_response["Configuration"]),
)

def delete(
self,
Expand Down Expand Up @@ -521,5 +552,5 @@ def list(
functions = request.aws_client_factory.lambda_.list_functions()
return ProgressEvent(
status=OperationStatus.SUCCESS,
resource_models=[LambdaFunctionProperties(**fn) for fn in functions["Functions"]],
resource_models=[_transform_function_to_model(fn) for fn in functions["Functions"]],
)
1 change: 1 addition & 0 deletions tests/aws/services/s3/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7488,6 +7488,7 @@ def test_presigned_url_signature_authentication_multi_part(
assert response.content == data

@pytest.mark.skipif(condition=TEST_S3_IMAGE, reason="Lambda not enabled in S3 image")
@pytest.mark.skip(reason="flaky")
@markers.aws.validated
def test_presigned_url_v4_x_amz_in_qs(
self,
Expand Down
Loading