-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Link #67
Resource Link #67
Conversation
src/main/resources/examples/resource/initech.tps.report.v1.json
Outdated
Show resolved
Hide resolved
"serviceLink": { | ||
"$comment": "This is an example of a relative, AWS-internal service link. For external links, use an absolute URI.", | ||
"templateUri": "/tps/v2/home?region=${awsRegion}#Report:tpsCode=${TPSCode}", | ||
"mappings": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this section? We can only pre-fill fields from the schema anyway, could the tokens in the URL just be the json-pointers directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we did consider this, but this way it might be possible to use existing templating engines, or simple regex replace. might be good for the console team to create a PoC to see how difficult/easy both would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS::DAX::ParameterGroup
is a good candidate for a proof-of-concept:
/dynamodb/home#cache-parameter-group:selected=${lowercasedResourceId}
Does this support other partitions, like China? Additionally, what if there is more than one kind of link that a provider wants to define? |
Yes, partitions are not an issue for AWS links as they have to be relative. For external links, they can go off the region. If there's really a need for the partition, we can add that as a global variable later. 1:1 seems to make sense to keep things simple. I don't think we're keen on displaying multiple links in the stack resources tab either, could lead to a confusing UX. I'm also not aware of any use-cases for multiple links. And while that's a somewhat weak argument as people do build cool stuff with extensible systems, predicting use-cases is hard and I'm leaning towards simplicity. |
Happy with the state of this and think it's ready for inclusion! |
only concerns are the discoverability of how |
Issue #, if available: #62
Description of changes: Allow resource authors to attach template links to the schema that consumers of the schema/resources can use to generate links directly to the resource. An example might be EC2. The console link is:
In this case, the service link might look like this:
Where
awsRegion
is a "global" variable (so far, the only one), andinstanceId
is a variable defined via a JSON pointer to a property in a resource blob (returned by e.g. READ) and not in the schema. The relative URI is debatable, but works well for the console currently. Other users outside of the console would have to maintain a mapping of console endpoints by region. The other benefit is that it lets us clearly figure out which links are AWS-internal.For non-AWS services, an absolute, HTTPS URI can be used.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.