aws-cloudformation / cloudformation-resource-schema

The CloudFormation Resource Schema defines the shape and semantic for resources provisioned by CloudFormation. It is used by provider developers using the CloudFormation RPDK.
Apache License 2.0
95 stars 38 forks source link

Add support for links to resources #62

Open tobywf opened 5 years ago

tobywf commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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:

johnttompkins commented 4 years ago

going to move this to the schema repo for better tracking