code: func resolveResourceRef(expr interface{}) (*resourceRef, error) {
  
  	// Is there any chance it's just a string?
  	typedString, typedStringOk := expr.(string)
  	if typedStringOk {
  		return &resourceRef{
  			RefType:      resourceLiteral,
  			ResourceName: typedString,
  		}, nil
  	}
  	// Some type of intrinsic function?
  	marshalled, marshalledErr := json.Marshal(expr)
  	if marshalledErr != nil {
  		return nil, errors.Errorf("Failed to unmarshal dynamic resource ref %v", expr)
  	}
  	var refFunc gocf.RefFunc
  	if json.Unmarshal(marshalled, &refFunc) == nil &&
  		len(refFunc.Name) != 0 {
  		return &resourceRef{
  			RefType:      resourceRefFunc,
  			ResourceName: refFunc.Name,
  		}, nil
  	}
  
  	var getAttFunc gocf.GetAttFunc
  	if json.Unmarshal(marshalled, &getAttFunc) == nil && len(getAttFunc.Resource) != 0 {
  		return &resourceRef{
  			RefType:      resourceGetAttrFunc,
  			ResourceName: getAttFunc.Resource,
  		}, nil
  	}
  	// Any chance it's a string?
  	var stringExprFunc gocf.StringExpr
  	if json.Unmarshal(marshalled, &stringExprFunc) == nil && len(stringExprFunc.Literal) != 0 {
  		return &resourceRef{
  			RefType:      resourceStringFunc,
  			ResourceName: stringExprFunc.Literal,
  		}, nil
  	}
  
  	// Nope
  	return nil, nil
  }
docs: // resolveResourceRef takes an interface representing a dynamic ARN
  // and tries to determine the CloudFormation resource name it resolves to