-
Notifications
You must be signed in to change notification settings - Fork 29
Description
I tried to deploy example blueprint for provisioning of Lambda resource with Invoke object on AWS:
as well as some custom blueprint using similar features. I used plugin v.3.0.6. In general support for Invoke object does not work. I discovered few issues:
1. botocore.exceptions.NoRegionError: You must specify a region. on cloudify_aws.lambda_serverless.resources.invoke.configure
For me it seems that it is caused by the usage of decorator here:
Logic encapsulated in decorator code tries to instantiate and inject Boto3 client into the operation method. It fails due to lack of client_config as a property in cloudify.nodes.aws.lambda.Invoke type. Additionally, it seems that in this case decorating operation method is not required, because it only sets runtime_property without any interaction with AWS API.
2. cloudify.exceptions.NonRecoverableError: Missing resource ID! Node=lambda_function_invocation, Instance=lambda_function_invocation_f2agfn on cloudify_aws.lambda_serverless.resources.invoke.attach_to
Occurred after commenting out decorator usage described in 1.
Here:
aws_relationship(LambdaFunction decorator is used for operation executed on attach on relationship cloudify.relationships.aws.lambda.invoke.connected_to. So the relationship is: cloudify.nodes.aws.lambda.Invoke -> cloudify.nodes.aws.lambda.Function. It the decorator code I can see invocation of get_resource_id function:
In this invocation node and instance objects both are taken from the source of relationship. For mentioned relationship source is cloudify.nodes.aws.lambda.Invoke which has no AWS ID. IMHO in this case node / instance should be taken from the target of relationship. Also other usages of aws_relationship decorator may be checked.
This may be relevant of unlink too.
3. Issue in example - plain text unsupported as returned value from lambda
Occurred after introduction of a temporary fix (new decorator) for 2.
Installation of deployment fails here:
It is due to fact that example lambda function here:
returns str instead of JSON. It works after changing value returned by lambda to JSON. But question is about support of other types than JSON.
I am opening a ticket instead of pushing fix because for me it seems that (mainly) 2. may be a broader issue.