Skip to content

Commit b0019e9

Browse files
committed
docs: added section for backend state and workflow instructions
1 parent b7af2f8 commit b0019e9

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ Below are guidelines for contributing to the devops-security repository hosted o
2323
- [**Attach `AdministratorAccess` policy to IAM group**](#attach-administratoraccess-policy-to-iam-group)
2424
- [**Generating Access Keys for AWS CLI**](#generating-access-keys-for-aws-cli)
2525
- [**Installing Terraform**](#installing-terraform)
26+
- [**Creating Backend State**](#creating-backend-state)
2627
- [**Installing Terraform docs**](#installing-terraform-docs)
2728
- [**Fork the repository**](#fork-the-repository)
2829
- [**Clone (Create) a copy on your computer**](#clone-create-a-copy-on-your-computer)
2930
- [**Verify `origin` remote url**](#verify-origin-remote-url)
3031
- [**What if you accidentally cloned using the repository URL from the HackForLA Github (instead of the fork on your Github)?**](#what-if-you-accidentally-cloned-using-the-repository-url-from-the-hackforla-github-instead-of-the-fork-on-your-github)
3132
- [**i. Reset `origin` remote url**](#i-reset-origin-remote-url)
3233
- [**ii. Add an `upstream` remote**](#ii-add-an-upstream-remote)
34+
- [**Create a new branch where you will work on your issue**](#create-a-new-branch-where-you-will-work-on-your-issue)
35+
- [**Terraform Setup and Execution Instructions**](#terraform-setup-and-execution-instructions)
36+
- [**Submitting changes via git and opening a PR**](#submitting-changes-via-git-and-opening-a-pr)
3337

3438
## **Setting up the local development environment**
3539

@@ -121,10 +125,12 @@ Below are guidelines for contributing to the devops-security repository hosted o
121125
- ### **Generating Access Keys for AWS CLI**
122126
- Open CloudShell
123127
- Generate the Access Keys for AWS CLI
128+
124129
```bash
125130
aws iam create-access-key --user-name UserName > access_key.json
126131
```
127132
- Print the contents of `access_key.json` and copy the contents to a secure location (you'll need the keys when you set up AWS CLI below)
133+
128134
```bash
129135
nano access_key.json
130136
```
@@ -143,6 +149,15 @@ Use the [Official HashiCorp install instructions](https://developer.hashicorp.co
143149
<sub>[Back to Table of Contents](#table-of-contents)</sub>
144150
***
145151
152+
### **Creating Backend State**
153+
154+
To facilitate AWS IAM changes using Terraform, it's essential to establish backend state storage. Refer to and follow the instructions outlined in this [issue](https://github.com/hackforla/ops/issues/105) to create the backend state.
155+
156+
**Note:** Users will need to create their backend state exactly as specified (i.e. using the same naming conventions).
157+
158+
<sub>[Back to Table of Contents](#table-of-contents)</sub>
159+
***
160+
146161
### **Installing Terraform docs**
147162

148163
Follow the Terraform docs [installation guide](https://terraform-docs.io/user-guide/installation/)
@@ -246,3 +261,70 @@ git remote add upstream https://github.com/hackforla/devops-security.git
246261

247262
<sub>[Back to Table of Contents](#table-of-contents)</sub>
248263
***
264+
265+
### **Create a new branch where you will work on your issue**
266+
267+
Using the `-b` flag you can also use the `git checkout` command to create a new branch and immediately switch into it.
268+
269+
For example, if you create a new issue branch for [Update Contributing document to include next steps - #15](https://github.com/hackforla/devops-security/issues/15):
270+
271+
```bash
272+
git checkout -b update-contributing-guide-15
273+
```
274+
275+
The text after the `-b`, in the example `update-contributing-guide-15`, will be the name of your new branch.
276+
277+
**Note:** Choose a branch name that:
278+
* relates to the issue (No spaces!)
279+
* includes the issue number
280+
281+
**Note:** The format should look like the scheme above where the words are a brief description of the issue that will make sense at a glance to someone unfamiliar with the issue.
282+
283+
**Note:** No law of physics will break if you don't adhere to this scheme, but laws of git will break if you add spaces.
284+
285+
When you've finished working on your issue, follow the steps below to prepare your changes to push to your repository.
286+
287+
<sub>[Back to Table of Contents](#table-of-contents)</sub>
288+
***
289+
290+
### **Terraform Setup and Execution Instructions**
291+
292+
- Change into `terraform` directory with
293+
294+
```bash
295+
cd terraform
296+
```
297+
298+
- Next initilize the terraform configuration
299+
300+
```bash
301+
terraform init
302+
```
303+
304+
- Then generate and run an execution plan
305+
306+
```bash
307+
terraform plan
308+
```
309+
<sub>[Back to Table of Contents](#table-of-contents)</sub>
310+
***
311+
312+
### **Submitting changes via git and opening a PR**
313+
314+
- We urge developers to be cautious using `git add`. In general it is not advisable to use `git add -all` or `git add .`. Rather, run `git status`, examine the output carefully, and then add only those files specifically related to the current issue. This will ensure that no extraneous files are included in the subsequent commit.
315+
316+
- Then commit the changes with a descriptive message using
317+
318+
```bash
319+
git commit -m "your commit message"
320+
```
321+
322+
- Push changes to the remote repository, replace the `branch_name` with the name of the branch you are working on
323+
324+
```bash
325+
git push --set-upstream origin main branch_name
326+
```
327+
- Lastly open a PR to merge your changes into the `main` branch.
328+
329+
<sub>[Back to Table of Contents](#table-of-contents)</sub>
330+
***

0 commit comments

Comments
 (0)