First, think to keep in mind this method only work when you have installed a custom ec2 instance of aws with Amazon Linux ami.
1) First Create an IAM User. (Give him Ec2FullAcess or S3FullAccess )
2) Open your server through ssh or any other tool.
Try to run the following command
1) aws configure
It will ask 4 thinks like showing this images
1) AWS Access Key Id : (It is given at the time of creating IAM User)
2) AWS Secret Access Key (It will also be given at the time of creating IAM User)
3) Default Region Name (It would depend on the region you are but by default give it as "us-east-2")
4) Default output format: table [You can also give it as JSON that totally depends on you]
after completing all these steps you have to check your list AWS bucket present in your AWS s3 account.
Run the following command : aws s3 ls
like as shown in below image.
If you want to create some bucket from AWS CLI command then we have to run the following commands.
If you want to remove an object from AWS bucket then you can run the following command. But this command will delete only if you have an empty bucket.
If you want to delete an object from AWS that contains sub-folders and files then you can run the following command.
Now if you want to copy your webapplication (project images or files ) from EC2 instance to s3 bucket then you can use the following command.
1) First Create an IAM User. (Give him Ec2FullAcess or S3FullAccess )
2) Open your server through ssh or any other tool.
Try to run the following command
1) aws configure
It will ask 4 thinks like showing this images
1) AWS Access Key Id : (It is given at the time of creating IAM User)
2) AWS Secret Access Key (It will also be given at the time of creating IAM User)
3) Default Region Name (It would depend on the region you are but by default give it as "us-east-2")
4) Default output format: table [You can also give it as JSON that totally depends on you]
after completing all these steps you have to check your list AWS bucket present in your AWS s3 account.
Run the following command : aws s3 ls
like as shown in below image.
If you want to create some bucket from AWS CLI command then we have to run the following commands.
If you want to remove an object from AWS bucket then you can run the following command. But this command will delete only if you have an empty bucket.
If you want to delete an object from AWS that contains sub-folders and files then you can run the following command.
Now if you want to copy your webapplication (project images or files ) from EC2 instance to s3 bucket then you can use the following command.
Comments
Post a Comment