cloudformation-resource-schema icon indicating copy to clipboard operation
cloudformation-resource-schema copied to clipboard

Add support for links to resources

Open tobywf opened this issue 5 years ago • 3 comments

Add an e.g. deepLink property to the schema that allows generating links to a resource given identifiers. This is useful for the console.

tobywf avatar Oct 31 '18 19:10 tobywf

Example from EC2 in the deeplink package:

image({ region }) {
  return `/ec2/v2/home?region=${region}#Images:sort=name`
},
instance({ region, resource }) {
  return `/ec2/home?region=${region}#Instances:instanceId=${resource}`;
},

tobywf avatar Feb 11 '19 18:02 tobywf

Proposal for adding this to a schema:

{
   [...]
  "deeplink": {
    "mapping": {
      "instanceId": "#/InstanceId"
    },
    "template": "https://{region}.console.aws.amazon.com/ec2/v2/home?region={region}#Instances:instanceId=${instanceId}"
  }
}

where mapping maps a simple key to a JSON pointer (URI fragment or not?) which can be applied to a resource blob, or empty if not required. global variables like region don't need to be mapped.

Open questions:

  • [ ] relative vs absolute URL (think of partner resources)
  • [ ] HTTPS only
  • [ ] which global vars
  • [ ] template syntax
  • [ ] JSON pointers are URI fragment representation or vanilla

tobywf avatar Mar 11 '19 23:03 tobywf

going to move this to the schema repo for better tracking

johnttompkins avatar Nov 27 '19 17:11 johnttompkins