~/.aws/config
file with different profiles:
[default]
region = us-east-1role_arn = arn:aws:iam::XXXXX:role/engineer
source_profile = default[profile john]
role_arn = arn:aws:iam::YYYYY:role/marketingsource_profile = default
[profile james]
role_arn = arn:aws:iam::ZZZZ:role/marketingsource_profile = default
This will allow you to pass --profile john
to the CLI.
However, AWS node SDK does not support the profile option. You can always verify the "current user" by:
izyaws.sh userId sts get-caller-identity
Or, from the scripting environment:
const sts = new AWS.STS();
sts.getCallerIdentity((err, data) => {
console.log(err, data);});
To work around this problem, you can use assume role:
izyaws.sh
You can then set
export AWSACCESSKEY_ID=
export AWSSECRETACCESS_KEY=export AWSSESSIONTOKEN=
After you are done, be sure to unset the variables by
unset AWSACCESSKEYID AWSSECRETACCESSKEY AWSSESSIONTOKEN
You can use the following snippet inside aws-sdk/lib/http/node.js
.
console.log('HTTP_REQUEST', JSON.stringify(httpRequest, null, 2));
var stream = http.request(options, function (httpResp) {console.log('OK-------------------------');
var str = '';
var response = httpResp;response.on('data', function (chunk) {
str += chunk;});
response.on('end', function () {console.log({
success: true,responseText: str,
status: response.statusCode,headers: response.headers
});});
return ;You may get the following error when trying to SSH into the EC2 instance:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'private.pem' are too open.To fix this chmod to
chmod 400 private.pem
npm run codebuild.check queryObject.izyUser 86 queryObject.showLogs true queryObject.projectName myProject
Exploring codebuild setup and viewing a build projects details
npm run codebuild.projectDetails queryObject.izyUser 86 queryObject.projectName myProject
* useful for exploring codebuild setup and viewing a build projects details in AWS CodeBuild
* utilize callpretty for better output* add verbose logging
github: https://github.com/izyware/aws