How do i create aws config and credential in windows system.? - amazon-web-services

I have accidentally deleted aws credential and config file from the location c:\user\admin.aws.
Now when i use the aws cli through powershell its throwing an error saying profile not found ,i am unable to create or get those two files. How do i do it?
I tried creating these files using notepad which did not work for me.

I think the path for the files would be "c:\users\admin\.aws\", right?
Once the files are added there, with the right settings, just try
aws sts get-caller-identity
to check if the profile's configuration files are accessible by the command line.

Related

Profile file cannot be null error using DBeaver under Windows10 AWS Athena IAM profile

I checked this question and this thread in GitHub. It works for Mac but doesn't work for Windows.
And I still getting the error.
Looks like dbeaver doesn't have access to the credentials file.
Any ideas?
Below you may see my settings:
Try adding a file called config in the same .aws directory with the following structure:
[your_DataAccess_profile_name]
your-aws-region
Pay attention to file extensions, it should be:
config and
credentials
not
config.txt and credentials.txt

GCP copy files in from VM to local

I'm trying to copy files from my VM to my local computer.
I can do this with the standard command
sudo gcloud compute scp --recurse orca-1:/opt/test.txt .
However in downloading the log files they transfer but they're empty? (empty files are created with the same name)
I'm also unable to use the Cloud Shell 'Download' UI button because it gives No such file despite the absolute file path being correct (cat /path returns the data).
I understand it's a permissions thing somehow with log files?
Thanks for the replies to my thread above I figured out it was a permissions issue on my files.
Interestingly the first time I ran the commands it did not throw any errors or permission errors -- it downloaded all the expected files however they were empty. In testing again, now it threw permission errors. I then modified the files in question to have public read permissions, and it downloaded successfully.

Unable to locate credentials aws cli

I am using AWS CLI version 2. I am using centos > Nginx > php 7.1, Following command works fine when I directly run on command line.
aws s3 cp files/abc.pdf s3://bucketname/
but when I run same command from index.php file using following code
echo exec("aws s3 cp files/abc.pdf s3://bucketname/ 2>&1");
then it gives error
upload failed: Unable to locate credentials
#Jass Add your credentials in "~/.aws/credentials" or "~/.aws/config" and make it [default] or else use profile_name incase you have multiple accounts.
Also verify, if you are using keys as Environment variables by export, then it will work for that terminal only. So try to execute the php from same terminal where you exported the keys or add it in ~/.aws/credentials.
I tried this and it worked for me and I believe should work for you as well. In your PHP code (index.php), try exporting the credential file location like below
echo exec("export AWS_SHARED_CREDENTIALS_FILE=/<path_to_aws_folder>/.credentials; aws s3 cp files/abc.pdf s3://bucketname/ 2>&1");
When you run from your command-line the AWS CLI picks up the credentials from your home directory i.e. ~/.aws/credentials (this is default). When the index.php is being executed it is looking for the above file in its home directory which appears is not the same as your home directory and hence cannot find the credentials. With the above change you are explicitly pointing it to your AWS credentials.

Errno 13: Permission denied: 'C:\\Users\\myname\\.aws' when running command: AWS Configure

I have AWS_CONFIG_FILE set to C:\Users\myname\.aws
When I run command aws configure and pass in the correct details I get the below error:
[Errno 13] Permission denied: 'C:\Users\myname.aws'
And a credentials file has appeared in folder C:\Users\myname\.aws
But, when I run the command aws configure again, the AWS Access Key ID and AWS Secret Access Key are already set, but the Default Region Name and Default Output Format are [None].
Question 1:: Why hasn't the config file been created?
Then, when I run command aws s3 ls I get error:
An error occurred (SignatureDoesNotMatch) when calling the ListBuckets operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Question 2: Why am I getting this error and how do I fix it?
It worked with me after deleting the credentials inside .aws and trying again. As per the recommendation here.
I tried the other solutions to no avail. The only way to get it to work was to manually create the 2 files required - config with content like this:
[default]
region=ap-southeast-2
output=json
and credentials like this:
[default]
aws_access_key_id=YOURKEY
aws_secret_access_key=YOURSECRETKEY
On Windows the files go into C:\Users\Username\.aws and neither file has an extension. Afterwards you can confirm it with
aws configure list
on the commandline. Hopes this helps someone!

AWS deployment failed - jhipster app - EBS

I have tried deploying my jhipster application in AWS Elastic BeanStalk by uploading the war directly. When the environment is created, i am getting this error.
[Instance: i-08f7c9efd8b2c5476] Command failed on instance. Return code: 1
Output: (TRUNCATED).../util/SystemPropertyUtils.class Failed to execute
'/usr/bin/unzip -o -d /var/app/staging
/opt/elasticbeanstalk/deploy/appsource/source_bundle' Failed to execute
'/usr/bin/unzip -o -d /var/app/staging
/opt/elasticbeanstalk/deploy/appsource/source_bundle'. Hook
/opt/elasticbeanstalk/hooks/restartappserver/pre/01_configure_application.sh
failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
Please suggest me what to do next.
enter image description here
I have also tried using yo jhipster:aws command as per the documentation in the jhipster page.
What i am getting is Missing credentails Config .
my question is i have added credentials.properties file in the given loaction
~/.aws/credentials...
Means .aws/credentials/credentials.properties (file). is the file extension right and the folder structure right,.
Create S3 bucket
Error jhipster:aws
Missing credentials in config
I'm not sure about your first error as you are trying to set the environment up manually and we would need information to reproduce.
In regards to yo jhipster:aws failing, the AWS credentials file should be located at ~/.aws/credentials, not ~/.aws/credentials/credentials.properties
After that create a credentials file at ~/.aws/credentials on Mac/Linux or C:\Users\USERNAME.aws\credentials on Windows.
From the docs: https://jhipster.github.io/aws/
For further clarification, use vi and create a file named "credentials" under the "~/.aws" folder.