0% found this document useful (0 votes)
21 views6 pages

DeveloperMachineSetup Updated

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

DeveloperMachineSetup Updated

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Developer machine setup

AWS code commit access Setup

Software Setup on Mac/Linux/Window


1. Install Git - https://www.atlassian.com/git/tutorials/install-git
a. Note(For Windows) : When installing git, do not try to install git from your user, always ask IT team to install git from admin
account because when you will install it from your user, git will not have admin privileges and firewall will block git requests.
b. · After that create and open .gitconfig file in the root directory and paste the following code into it and save it

[credential]

helper = "!aws --profile $AWS_GIT_PROFILE codecommit credential-helper $@"

UseHttpPath = true
2. AWS Switcher extension for switch role (For Browsers)
a. Chrome https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl
3. Python
a. For Windows, any version above 3.7.0 https://www.python.org/downloads/
4. Text editor
a. Visual Studio Code
5. Duo Mobile App in mobile for MFA setup from Play Store / App Store
6. AWS CLI Setup (AWS CLI v2 is recommended)- https://docs.aws.amazon.com/cli/latest/userguide/install-cliv1.html

Prerequisite
· MFA device

· Physical device (Mobile App – (DUO mobile)

DevOps
Raise request for following item to Dev-ops to create user.

· AWS account Credential

· Repo access

· SonarQube (Red-only user details is username: pentair-read-only and password: Pentair@01)

https://sq.pentair.cloud

Setup AWS Account


· Go to https://aws.amazon.com/console/

· Select My Account --> AWS Management Console

· On the Sign in page, Select IAM user option.

· Use this as "Root user email address": "pentairiotiam" and click on the next button

· Now enter your username and use "Mywater@1#23" as your password and press on login.

· After login you will be redirected to reset password screen.

· Choose your new password in the same format as "Mywater@123"


Setup AWS MFA
· Go to IAM -> Users section

· Search your user name and select it. It will open user summary section.

· Go to Security credentials tab

· In that Sign-in credentials section you will find Assigned MFA device section. Click on the Manage link.

· Select Virtual MFA device option from the popup and click on continue button

In Device name section, Please enter your AWS username( which you have received on email i.e. pentair domain
email id. ) only.
· In setup Virtual MFA device section click on the Show QR code button.

· Now scan the QR code from the Duo application.

· It will show 6-digit code enter that code into MFA code 1 and after 30 seconds it will give you another 6-digit code, enter that code into MFA
code 2

· Now Press Assign MFA button. It will assign virtual MFA with your account.

· Then go to Access Keys tab, delete any existing key (if there is any) and click on create access key button.

· Download accessKeys.csv file in your system

· Now logout from your account and again login using your credentials

· When you again sign in it will ask for MFA and enter code from the Duo application.

Setup AWS Extend Switch Roles


· Add AWS Extend Switch Roles extension in your Google Chrome

· Click on the AWS switch role extension, then click on Configuration option

· Paste the following content and save it as an example of mobapp developer.

https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?hl=en

Example:-

[profile repo]

role_arn = WILL BE PROVIDED WITH ACCESS

region = us-east-1

color = ff2600
· Now go to your AWS account and refresh it and click on your user name, in that you will find your repo account that you just created under
Role History and click on it

· Now got to Services -> Developer Tools -> CodeCommit.

· Check that your region is us-east-1 only if not than change to us-east-1

· Now you are able to see the list of repositories. Now search for mobapp

· It will list out all the mobapp repositories

· Clone repo in your local [repo]

Setup Project in local


· Install AWS cli version 1 ( Example for MAC)

https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html

o curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

o unzip awscli-bundle.zip

o sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

o aws --version

· After installing AWS cli run the "aws configure" command.

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

· It will ask for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Get this value from the accessKeys.csv that we have downloaded
from

Once you setup the AWS, Check its credentials file created in the root directory under .aws folder and paste the following code ( ~/.aws
/credentials)

[iam]

aws_access_key_id = ……………………………………………

aws_secret_access_key = …………………………………….

region = us-east-1

mfa_serial = arn:aws:iam::980613611081:mfa/ your IAM username

[repo]

role_arn = arn:aws:iam::665395196021:role/ role name


source_profile = iam

region = us-east-1

mfa_serial = arn:aws:iam::980613611081:mfa/your IAM username


· After that create and open .gitconfig file in the root directory and paste the following code into it and save it

[credential]

helper = "!aws --profile $AWS_GIT_PROFILE codecommit credential-helper $@"

UseHttpPath = true

[user]

name = [your IAM username]

email = [your email id]

https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html

· Now open the .bash_profile file (this file maybe different in you system so just check where you android sdk path are saved, it code into it and
save it

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

MAC and Linux

export AWS_PROFILE=repo

export AWS_GIT_PROFILE=repo

export AWS_DEFAULT_REGION=us-east-1

Window Machine

setx AWS_PROFILE repo

setx AWS_GIT_PROFILE repo

setx AWS_DEFAULT_REGION us-east-1

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

Note :- Every time you need to run above command, if you restarting your terminal.

· For reloading the .bash_profile file run this command

o source ~/.bash_profile

· Follow the same steps as .bash_profile for setting the .zprofile.

· To check the list of repositories run the aws codecommit list-repositories on terminal and pass the six digit MFA code.

· Now start cloning the repositories in local in the following order

· Utility repo: (example)

o git clone https://git-codecommit.us-east 1.amazonaws.com/v1/repos/mywater-mobapp-utility-lib

o For first time clone of git repo it will ask for MFA token for that follow below steps:-
Go to Duo Mobile App
Click on your profile have “pentairiotiam” as subscript
Enter the code provided

· Repositories Naming

o mywater-backennd-* ( for backend developers)

o mywater-webapp-* ( for webapp developers)

o mywater-mobapp-* ( for mobapp developers)

o mywater-foundation-* ( for DevOps)

· Team Lead will guide you for repositories structure based on the development team (webapp/mobapp/backend/foundation)

Possible errors in Setup:


For Windows :
After installation of Python, AWS CLI may stop working in Windows PCs. Airlock may be reason behind this. So, contact to IT team and
ask them to clear Airlock file and update policy.
Getting 403 error while cloning or asking for credentials :
In case after git clone command a dialog box is appearing that is asking for username and password just click cancel then the terminal
should ask for the mfa if this does not happen then go to this link https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-
https-windows.html scroll down till red caution box appears and follow the last 2 steps as shown below:-

Contact Person
In case you face any issue please contact dev-ops

· [email protected]

· [email protected]

You might also like