cloudformation-resource-schema
cloudformation-resource-schema copied to clipboard
Add support for links to resources
Add an e.g. deepLink
property to the schema that allows generating links to a resource given identifiers
. This is useful for the console.
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}`;
},
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
going to move this to the schema repo for better tracking