Skip to content

Commit 2da8fa8

Browse files
committed
updating structure and documentation
1 parent aeb03b3 commit 2da8fa8

22 files changed

Lines changed: 219 additions & 140 deletions

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# Ignore variables files
5+
*.auto.tfvars
6+
7+
# Ignore override files
8+
*.tfoverride
9+
10+
11+
12+
# Ignore environment-specific files
13+
.envrc
14+
15+
# Ignore CLI configuration files
16+
.terraformrc
17+
terraform.rc

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Local Development/Installation instructions
2+
3+
1. Create personal AWS account
4+
2. Set up Terraform backend state storage in AWS
5+
- create bucket
6+
- create DynamoDB table
7+
2. Fork this repo
8+
- clone the fork
9+
3. Install Terraform
10+
4. Install Terraform Docs
11+
5. Change Terraform backend
12+
13+
Step-by-step instructions help new contributors get a development environment up and running quickly.
14+
2. You'll want to find the balance between being specific enough for novices to follow, without being so specific that you reinvent the wheel by providing overly-basic instructions that can be found elsewhere.
15+
3. Feel free to adapt this section and its sub-sections to your own processes.
16+
4. Alternatively, you can move everything from *Installation instructions* through *Testing* to a separate **Contributing.md** file to keep your **ReadMe.md** more succinct.
17+
18+
19+
### Working with issues
20+
21+
- Explain how to contribute to an existing issue.
22+
23+
### Working with forks and branches
24+
25+
- Explain your guidelines here.
26+
27+
28+
### Working with pull requests and reviews
29+
30+
- Explain your process.

README.md

Lines changed: 8 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,26 @@
1-
Terraform directory structure
1+
# DevOps Security | AWS IAM Resources
22

3-
- 📁 [terraform](https://github.com/hackforla/ops-security/tree/cb/example/terraform)
4-
- 📁 [aws-custom-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies) - JSON configurations for customer-managed policies (AWS-managed policies are referenced by ARN and not needed here)
5-
- 📁 [existing-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies/existing-policies) - a few of our current policy configurations for reference
6-
- 📁 [modules](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules) - reusable Terraform configurations
7-
- 📄 [aws-custom-policies.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain custom policies here
8-
- 📄 [aws-groups.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain groups here
9-
- 📄 [aws-users.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-users) - maintain users here
10-
11-
---
12-
# Project title and description
13-
14-
Include a project description that explains **what** your project is and **why** it exists. Aim for no more than 3-5 concise sentences. For example, you might say:
15-
16-
{Project Name} is a project of Hack for LA. Hack for LA is a brigade of a Code for America that exists to {your mission}. {Project Name} helps {target users} accomplish {goal of project}. The {app/site/thing you're building}'s main features include {very brief feature descriptions}.
17-
18-
### Project context
19-
20-
Civic projects often exist within a larger context that may include multiple stakeholders, historic relationships, associated research, or other details that are relevant but not *required* for direct contributions. Gathering these details in one place is useful, but the ReadMe isn't that place. Use this section to [link to a Google Doc](#) or other documentation repository where contributors can dig in if they so choose. This is also a good place to link to your Code of Conduct.
3+
DevOps Security is a code repository used to maintain Hack for L.A.'s AWS Identity Access Management (IAM) resources as code. This includes users, groups, policies, and roles.
214

225
### Technology used
236

24-
- Each platform or framework should get its own bullet.
25-
- Each platform should include an [active link](#) to the official documentation.
26-
27-
7+
- [Terraform]()
8+
- [Terraform Docs]()
9+
- [AWS CLI]()
2810

2911
# How to contribute
3012

3113
Explain the different ways people can contribute. For example:
3214

33-
- Join the team {on Slack/at our weekly hack night/etc}.
34-
- To help with user research, {do ABC}.
35-
- To provide design support, {do XYZ}.
36-
- To contribute to the code, follow the instructions below.
15+
- Join the team on Slack or at our weekly CoP meetings.
16+
- To contribute to the codebase, follow the instructions below.
3717

3818
Remember to provide direct links to each channel.
3919

4020

41-
42-
## Installation instructions
43-
44-
1. Step-by-step instructions help new contributors get a development environment up and running quickly.
45-
2. You'll want to find the balance between being specific enough for novices to follow, without being so specific that you reinvent the wheel by providing overly-basic instructions that can be found elsewhere.
46-
3. Feel free to adapt this section and its sub-sections to your own processes.
47-
4. Alternatively, you can move everything from *Installation instructions* through *Testing* to a separate **Contributing.md** file to keep your **ReadMe.md** more succinct.
48-
49-
50-
### Working with issues
51-
52-
- Explain how to submit a bug.
53-
- Explain how to submit a feature request.
54-
- Explain how to contribute to an existing issue.
55-
56-
To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link.
57-
58-
59-
### Working with forks and branches
60-
61-
- Explain your guidelines here.
62-
63-
64-
### Working with pull requests and reviews
65-
66-
- Explain your process.
67-
68-
69-
### Testing
70-
71-
- Provide instructions.
72-
73-
74-
7521
# Contact info
7622

77-
Include at least one way (or more, if possible) to reach your team with questions or comments.
23+
This repo is maintained by the Ops team. Reach out to our [CoP leads](https://github.com/hackforla/ops/wiki/Community#ops-community-of-practice-cop-leads) on Slack with questions or attend a [community meeting](https://github.com/hackforla/ops/wiki/CoP-Meetings)
7824

7925

8026
### Licensing

terraform/.terraform.lock.hcl

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Terraform directory structure
2+
3+
- 📁 [terraform](https://github.com/hackforla/ops-security/tree/cb/example/terraform)
4+
- 📁 [aws-custom-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies) - JSON configurations for customer-managed policies (AWS-managed policies are referenced by ARN and not needed here)
5+
- 📁 [existing-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies/existing-policies) - a few of our current policy configurations for reference
6+
- 📁 [modules](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules) - reusable Terraform configurations
7+
- 📄 [aws-custom-policies.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain custom policies here
8+
- 📄 [aws-groups.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain groups here
9+
- 📄 [aws-users.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-users) - maintain users here

terraform/aws-custom-policies.tf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
module "aws_iam_policies" {
2-
source = "./modules/policies"
3-
policies = {
4-
"ManageAccessKeys" = {
5-
description = "Policy for creating, listing, and updating Access Keys"
6-
filename = "manage-access-keys-policy.json"
7-
},
8-
"FullAccessPolicy" = {
9-
description = "Full access to specific resources"
10-
filename = "full-access-policy.json"
11-
}
12-
}
13-
}
1+
# module "aws_iam_policies" {
2+
# source = "./modules/policies"
3+
# policies = {
4+
# "ManageAccessKeys" = {
5+
# description = "Policy for creating, listing, and updating Access Keys"
6+
# filename = "manage-access-keys-policy.json"
7+
# },
8+
# "FullAccessPolicy" = {
9+
# description = "Full access to specific resources"
10+
# filename = "full-access-policy.json"
11+
# }
12+
# }
13+
# }

terraform/aws-groups.tf

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
// Create groups and attach policies
1+
// Create read only group
22
module "iam_read_only_group" {
3-
source = "./modules/groups"
3+
source = "./modules/aws-groups"
44

55
group_name = "read-only-group"
6-
policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
6+
policy_arn = ["arn:aws:iam::aws:policy/ReadOnlyAccess"]
77
}
88

9-
module "iam_project_admin_group" {
10-
source = "./modules/groups"
11-
12-
group_name = "project-admin-group"
13-
policy_arn = [ # here we can pass a list of policies that are aws managed or customer managed
14-
"arn:aws:iam::aws:policy/SomeAWSPolicy",
15-
module.iam_policies.policy_arns["ManageAccessKeys"]
16-
]
17-
}
18-
19-
module "iam_ops_mentor_group" {
20-
source = "./modules/groups"
21-
22-
group_name = "project-admin-group"
23-
policy_arn = [ # here we can pass a list of policies that are aws managed or customer managed
24-
"arn:aws:iam::aws:policy/SomeAWSPolicy",
25-
"arn:aws:iam::aws:policy/SomeAWSPolicy",
26-
"arn:aws:iam::aws:policy/SomeAWSPolicy",
27-
"arn:aws:iam::aws:policy/SomeAWSPolicy",
28-
]
29-
}
30-
31-
// Assign users to groups
32-
resource "aws_iam_group_membership" "project_admin_group_membership" {
33-
name = "project_admin_group_membership" # A unique name for the group membership
34-
35-
users = [
36-
module.iam_user_gwenstacy.user_name,
37-
module.iam_user_miles_morales.user_name,
38-
"chelseybeck"
39-
]
40-
41-
group = module.iam_project_admin_group.group_name
42-
}
9+
// Create project admin group - this group is dependent on tagging resources
10+
# module "iam_project_admin_group" {
11+
# source = "./modules/groups"
12+
13+
# group_name = "project-admin-group"
14+
# policy_arn = [ # here we can pass a list of policies that are aws managed or customer managed
15+
# "arn:aws:iam::aws:policy/SomeAWSPolicy",
16+
# module.iam_policies.policy_arns["ManageAccessKeys"]
17+
# ]
18+
# }
19+
20+
// Create mentor group - need to discuss these permissions
21+
# module "iam_ops_mentor_group" {
22+
# source = "./modules/groups"
23+
24+
# group_name = "ops-mentor-group"
25+
# policy_arn = [ # here we can pass a list of policies that are aws managed or customer managed
26+
# "arn:aws:iam::aws:policy/AdministratorAccess",
27+
# "arn:aws:iam::035866691871:policy/ManageAccessKeys",
28+
# ]
29+
# }
30+
31+
// Create IAM management group --
32+
# module "iam_services_supervisor_group" {
33+
# source = "./modules/groups"
34+
35+
# group_name = "iam-services-supervisor-group"
36+
# policy_arn = [ # here we can pass a list of policies that are aws managed or customer managed
37+
# "arn:aws:iam::aws:policy/AdministratorAccess",
38+
# "arn:aws:iam::035866691871:policy/ManageAccessKeys",
39+
# ]
40+
# }
41+
42+
// Cost management group = "Cost-Management"

terraform/aws-roles.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# module "iam_role_example" {
2+
# source = "./modules/roles"
3+
# role_name = "example_role"
4+
# assume_role_principal = "ec2.amazonaws.com"
5+
# policy_arn = "arn:aws:iam::aws:policy/ExamplePolicy"
6+
# }

terraform/aws-users.tf

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
module "iam_user_gwenstacy" {
2-
source = "./modules/users"
2+
source = "./modules/aws-users"
33

44
user_name = "gwenstacy"
55
user_tags = {
66
"Environment" = "Development"
77
"Project" = "spiderverse"
88
}
9-
pgp_key = "user_provided_public_key_here"
9+
user_groups = ["read-only-group"]
10+
# pgp_key = "keybase:chelseybeck"
1011
}
11-
12-
module "iam_user_milesmorales" {
13-
source = "./modules/users"
14-
15-
user_name = "miles_morales"
16-
user_tags = {
17-
"Environment" = "Production"
18-
"Project" = "spiderverse"
19-
}
20-
pgp_key = "user_provided_public_key_here"
21-
}

terraform/backend.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
terraform {
22
backend "s3" {
3-
bucket = "my-terraform-state-bucket" # Replace with S3 bucket name
4-
key = "path/to/terraform.tfstate" # Path to the state file within the bucket
5-
region = "us-west-2" # AWS region of the S3 bucket
6-
dynamodb_table = "my-terraform-state-lock" # DynamoDB table name for state locking
3+
bucket = "hfla-ops-terraform-state" # Replace with S3 bucket name
4+
key = "devops-security/terraform.tfstate" # Path to the state file within the bucket
5+
region = "us-west-2" # AWS region of the S3 bucket
6+
dynamodb_table = "hfla_ops_terraform_table" # DynamoDB table name for state locking
77
encrypt = true
88
}
99
}

0 commit comments

Comments
 (0)