2 ms·
> I hate the fact that there are way too many code samples floating around on the internet that have you explicitly put your access key and secret key in the in
by michaelt 4y ago
> I hate the fact that there are way too many code samples floating around on the internet that have you explicitly put your access key and secret key in the initialization code for the AWS SDK.
See, I thought that was a big strength of a lot of the AWS documentation over Google Cloud.
An AWS example for, say, S3 would show you where to insert the secrets, and it would work.
The Google Cloud Storage examples, though? It didn't seem to have occurred to them that someone reading "how to create bucket example" might not have their credentials set up.
And when the example didn't work - well, it was like the auth documentation was written by a completely different team, and they'd never considered a developer might simply want to access their own account. Instead the documentation was a mess of complicated-ass use cases like your users granting your application access to their google account; sign-in-with-google for your mobile app; and so on.
Google's documentation is better than it once was - but I've always wondered how much of the dominance of AWS arose from the fact their example code actually worked.
- scarface74 4y ago> See, I thought that was a big strength of a lot of the AWS documentation over Google Cloud. Just to clarify, I’ve never seen a code sample published by AWS that has you explicitly specifying your credentials. (Now I await 15 replies showing me samples hosted on Amazon)
- michaelt 4y agoFor Java they used to demonstrate putting a .properties file in among your source code [1] although admittedly not literally hardcoding a string. The PHP examples suggested putting your code into a config php include [2] (although they did also suggest putting them in your home directory). But I can't understate how important it was that the AWS getting started guides said "Go to this URL, copy these values into this file" while Google's examples and getting started guides... didn't. [1] https://web.archive.org/web/20120521060506/http://aws.amazon.com/articles/3586?_encoding=UTF8&jiveRedirect=1 https://web.archive.org/web/20120521060506/http://aws.amazon... [2] https://github.com/amazonwebservices/aws-sdk-for-php/blob/master/config-sample.inc.php https://github.com/amazonwebservices/aws-sdk-for-php/blob/ma...
- scarface74 4y agoWow, that’s some old code :). But here is the newest documentation for PHP https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples.html https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s...