Referencing Resources

Whereas resource definition nodes are to define resources, resource reference nodes are used to reference them, i.e., to allow actions to be performed on them. As with text panels, the Polly example doesn’t have any resource reference nodes, because text translation and conversion to audio are services that are accessed by calling simple endpoints at AWS, as opposed to resources like buckets and databases, that require provisioning and configuration. But if we open the example LambdaEventS3 , and select the panel LambdaAddEventSourceS3Main, we will find a resource reference node:

012

A resource reference node has one parameter (the logical identifier of the resource), an output port and a return port that both emit a string that represents the physical id of the resource, i.e., the low-level name by which the resource is known to AWS. The physical id is passed to action nodes, as well see momentarily. The port structure of a resource reference node is as follows:

parameter ports:
Name Type Description Optional

logicalID

(cfnIdLogical)

logical id of a reference, from a resource definition node

no

output ports:
Name Type Description Optional

Resource

string

physical id of the resource

yes

return ports:
Name Type Description Optional

resource

string

physical id of the resource

no

To see what becomes of the physical id output by the resource port of this node, double-click on the call to LambdaAddEventSourceS3Handler:

013

The editor will navigate to the circuit panel named LambdaAddEventSourceS3Handler, and your screen should look something like this:

014

The physical id of the S3 bucket is passed to three circuit calls in turn. Let’s click on the first one, LambdaAddEventSourceS3Create. The following circuit appears:

014 2