Version your code

Version your code

Now that you created all the code necessary for your basic AWS account setup, make sure your code is versioned in Git.

Create a new Git repository

git init

Ignore the helper files of your editor in the .gitignore file, eg.

echo ".idea/" >> .gitignore
echo ".vscode/" >> .gitignore
git add .gitignore

Add all the relevant files to this repository

git add Makefile log-archive/ master/ playground/ shared-services/ ci/ app-staging/ app-prod/

Also don’t forget to create a README.md in the project.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cat <<'EOF' > README.md

# Repository for AWS infrastructure

## Setting up the AWS cli

Create a new file `~/.aws/credentials` with the following command:

```
aws configure --profile myorg-master
```

Create a file `~/.aws/config` with the following content

```
[profile myorg-master]
mfa_serial = ...

[profile myorg-playground]
role_arn = ...
mfa_serial = ...
source_profile = myorg-master

...
```

## Master account

```
AWS_PROFILE=myorg-master make master-iam-users
```

...

EOF

Enhance the README to your needs and add it to Git:

git add README.md

The make a commit in Git:

git commit -m 'Set up project for AWS infrastructure setup'

Next create a repository on your Git hosting system and push your branch:

git remote add origin ...
git push origin master