1. With the terminal install the AWS CLI. It is a command line tool that is used to perform the operation on AWS by a terminal.
$ brew install awscli
2. Generate the AWS CLI credentials are as follows:
1. Click on service at the top left of Aws console and search IAM
2. Go to the IAM console as we need to create the IAM user For deployment and initiate the serverless process.
3. Now click on Add user.
4. Provide the username and click on programmatic access as we require just CLI access and
then Click on Next permission
5. Now click on existing policy and select administrator policy to perform any action
6. Now click on the Add tag below on the right side and then click on the next review.
7. Click on the create user. We have created a user with programmatic access.
8. Download the csv file as we require it later.
9. Once the AWS CLI has been installed, copy the Access Key ID and your Secret Access Key from the CSV file that we downloaded and run the command below:
$ aws configure
AWS Access Key ID [None]: asdfgh
AWS Secret Access Key [None]: asdfghnm
Default region name [None]: us-east-1
Default output format [None]: ENTER
10.Install Node/Npm and check by following command
$ brew update
$ brew install node
$ node -v
$ npm -v
11. Clone the git code
$ git clone https://www.github.com
12. Create a bucket where you want to deploy the code
13. Update the package.json file. Inside there is a block of script section. There we want to add the script name aws-deploy which we are using to deploy our code to s3 bucket.
14. Install the all required node packages
$ npm install
15. Now just run the command. Your code is deployed to your s3 bucket.
$ ng build && npm run aws-deploy
Conclusion: From this blog, our deployment on s3 becomes much easier and we don't have to use other deployment tools.
We are an ERP Development company with expertise in developing customized software solutions for our clients. Our developers use a vast technology stack to furnish clients with the best tools for their ERP. Our custom development services enable businesses to automate, plan, collaborate, and execute their operations methodically.