Link Search Menu Expand Document

Table of contents

References

All resources and parameters can be referenced by calling the ref() function.

Info on Ref from AWS can be found here

val instance = instance()
eIP { 
    instanceId(instance.ref())
}

Produces

Resources:
  Instance:
    Type: "AWS::EC2::Instance"
  EIP:
    Type: "AWS::EC2::EIP"
    Properties:
      InstanceId:
        Ref: "Instance"

You can also build an instance of Reference by passing the logical name of the resource.

val instance = instance()
eIP {
    instanceId(Reference(instance.logicalName))
}

For Pseudo Parameters References, see Pseudo Parameters