generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from hackforla/setup-gha-107
Setup gha 107
- Loading branch information
Showing
9 changed files
with
163 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Apply Terraform changes on merge | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # or any other branch you want to trigger the deployment | ||
|
||
jobs: | ||
terraform-apply: | ||
name: Terraform Apply | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Terraform Apply | ||
uses: dflook/terraform-apply@v1 | ||
with: | ||
path: terraform |
29 changes: 11 additions & 18 deletions
29
.github/terraform-plan.yaml → .github/workflows/terraform-plan.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
name: Deploy IAM Resources to AWS with Terraform | ||
name: Write Terraform Plan to Pull Request | ||
|
||
on: | ||
pull-request: | ||
pull_request: | ||
branches: | ||
- main # or any other branch you want to trigger the deployment | ||
|
||
jobs: | ||
terraform: | ||
name: Terraform | ||
terraform-plan: | ||
name: Terraform Plan | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: 1.0.0 # Specify the Terraform version | ||
|
||
uses: actions/checkout@v4 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 # Change to your AWS region | ||
|
||
- name: Terraform Init | ||
run: terraform init | ||
aws-region: us-west-2 | ||
|
||
- name: Terraform Plan | ||
uses: dflook/terraform-plan@v1 | ||
with: | ||
path: terraform | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module "aws_custom_policies" { | ||
source = "./modules/aws-policies" | ||
policies = { | ||
"IAMServicesAdmin" = { | ||
description = "Policy granting IAM services admins permissions to make changes to user accounts" | ||
filename = "level-4-iam-services-admin-policy.json" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,87 @@ | ||
// Create user and assign to group(s) | ||
module "iam_user_gwenstacy" { | ||
module "iam_user_JimmyJuarez10" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "gwenstacy" | ||
user_name = "JimmyJuarez10" | ||
user_tags = { | ||
"Environment" = "Development" | ||
"Project" = "spiderverse" | ||
"Project" = "civic-tech-jobs" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_brittanyms" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "brittanyms" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_freaky4wrld" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "freaky4wrld" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_shikha0428" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "shikha0428" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_shinjonathan" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "shinjonathan" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_samuelusc" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "samuelusc" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_abbyz123" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "abbyz123" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} | ||
|
||
module "iam_user_awlFCCamp" { | ||
source = "./modules/aws-users" | ||
|
||
user_name = "awlFCCamp" | ||
user_tags = { | ||
"Project" = "devops-security" | ||
"Access Level" = "1" | ||
} | ||
user_groups = ["read-only-group"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters