-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- iam local modules - implementing iam user module - setting up codemmit module
- Loading branch information
Manuel Ortiz
committed
Sep 20, 2020
1 parent
d56c780
commit ad4d700
Showing
9 changed files
with
76 additions
and
0 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,3 @@ | ||
# CodeCommit Hands On | ||
## Objectives | ||
Have some hands on labs for DevOps Professional Certification, automating the creation of resources needed for CodeCommit Lessons. |
File renamed without changes.
Empty file.
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 @@ | ||
module "iam_user" { | ||
source = "../../99-local-modules/iam_user/" | ||
user_name = "seiya" | ||
user_policy_name = "${var.prefix_resource}_pol_iam_user_ec2_readonly" | ||
user_policy_document = <<DOC | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"ec2:Describe*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
DOC | ||
tags = local.common_tags | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
locals { | ||
common_tags = { | ||
environment = "poc", | ||
proyect = "aws-devtools" | ||
} | ||
} |
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 @@ | ||
|
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,3 @@ | ||
provider "aws" { | ||
region = "us-east-1" | ||
} |
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,4 @@ | ||
variable "prefix_resource" { | ||
description = "description" | ||
default = "jmo" | ||
} |
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,15 @@ | ||
resource "aws_iam_user" "this" { | ||
name = var.user_name | ||
path = "/system/" | ||
tags = var.tags | ||
} | ||
|
||
resource "aws_iam_access_key" "this" { | ||
user = aws_iam_user.this.name | ||
} | ||
|
||
resource "aws_iam_user_policy" "this" { | ||
name = var.user_policy_name | ||
user = aws_iam_user.this.name | ||
policy = var.user_policy_document | ||
} |
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,18 @@ | ||
variable "user_name" { | ||
description = "Username to be used on IAM user resource" | ||
default = "default" | ||
} | ||
|
||
|
||
variable "user_policy_name" { | ||
description = "Required policy name for iam user" | ||
} | ||
|
||
variable "user_policy_document" { | ||
description = "Required policy document" | ||
} | ||
variable "tags" { | ||
type = map(string) | ||
description = "map of common tags" | ||
} | ||
|