Skip to content

Missing required parameter in input: "FunctionName" #1741

@akefirad

Description

@akefirad

While creating a lambda using CFN, my command fails with the following message:

2019-11-08 15:52:29,358:API: Error on request:
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 304, in run_wsgi
    execute(self.server.app)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 292, in execute
    application_iter = app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/server.py", line 132, in __call__
    return backend_app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/utils.py", line 140, in __call__
    result = self.callback(request, request.url, {})
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 168, in dispatch
    return cls()._dispatch(*args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 259, in _dispatch
    return self.call_action()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 340, in call_action
    response = method()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/utils.py", line 264, in _wrapper
    response = f(*args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/responses.py", line 108, in create_change_set
    change_set_type=update_or_create,
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/models.py", line 452, in create_change_set
    cross_stack_resources=self.exports
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/models.py", line 295, in __init__
    create_change_set=True,
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/models.py", line 187, in __init__
    self.resource_map = self._create_resource_map()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/models.py", line 195, in _create_resource_map
    resource_map.create()
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/parsing.py", line 482, in create
    if isinstance(self[resource], ec2_models.TaggedEC2Resource):
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/parsing.py", line 415, in __getitem__
    resource_logical_id, resource_json, self, self._region_name)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 173, in parse_and_create_resource
    return _parse_and_create_resource(logical_id, resource_json, resources_map, region_name)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 260, in _parse_and_create_resource
    result = deploy_func(logical_id, resource_wrapped, stack_name=stack_name)
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 671, in deploy_resource
    result = deploy_resource_via_sdk_function(resource_id, resources, resource_type, func, stack_name)
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 741, in deploy_resource_via_sdk_function
    raise e
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 738, in deploy_resource_via_sdk_function
    result = function(**params)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "FunctionName"

Considering the fact that the FunctionName property is not mandatory from CFN perspective (it's even worse, since having it or not has significant implications), is it possible to create a name on the fly?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions