Tagging an AWS Cloud Watch Alarm
Recently tried to tag an alarm in AWS Cloud Watch. First I took a look at their REST-API documentation:
There are several things I found remarkable when trying to add a tag via the TagResource "action".
First of all there is no example included in the documentation. Not too bad because there is google with a lot of examples out there? Wrong, I couldn't find a single sample of someone doing such a REST call. After a lot of try and error I found a working solution:
The tag has to be included as a query parameter and a GET-request has to be issued in order to create a tag. (Please do not ask me why they are not implementing this as a post or put request like everyone else is doing). A key-value pair of tags has to be provided in this format as query parameters:
...&Tags.member.1.Key=myKey&Tags.member.1.Value=myValue
I am wondering how anyone is able to come up with this solution after reading the API documentation (see link above).
Since I found several other issues when implementing plain REST calls I continued with the Java SDK:
This API is well documented with a lot of examples and it is also easy to use.
Conclusion: I think Amazon doesn't really want you to use their REST API directly. It is complicated, not well documented and has a strange architecture (GET-request to create data). Unfortunately I have found no hint that you are way better off using the SDKs that are available in multiple languages (C#, Go, JavaScript, Python, PHP, etc)
Keine Kommentare:
Kommentar veröffentlichen