UPD: Renamed layer name
This commit is contained in:
parent
988c376d37
commit
3bc64f31b8
17
SecurityIdentityCompliance/Exercise1/.terraform.lock.hcl
Normal file
17
SecurityIdentityCompliance/Exercise1/.terraform.lock.hcl
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# This file is maintained automatically by "terraform init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/aws" {
|
||||||
|
version = "5.51.1"
|
||||||
|
constraints = ">= 5.0.0"
|
||||||
|
hashes = [
|
||||||
|
"h1:ESfxP2tCO6IZldSQnepXmIm+x+VtaQt/bKgGjYE+0BY=",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/random" {
|
||||||
|
version = "3.6.2"
|
||||||
|
hashes = [
|
||||||
|
"h1:wmG0QFjQ2OfyPy6BB7mQ57WtoZZGGV07uAPQeDmIrAE=",
|
||||||
|
]
|
||||||
|
}
|
40
SecurityIdentityCompliance/Exercise1/README.md
Normal file
40
SecurityIdentityCompliance/Exercise1/README.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<!-- This readme file is generated with terraform-docs -->
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| terraform | >= 1.3.0 |
|
||||||
|
| aws | >= 5.0 |
|
||||||
|
|
||||||
|
## Providers
|
||||||
|
|
||||||
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| aws | 5.51.1 |
|
||||||
|
| random | 3.6.2 |
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
|
||||||
|
No modules.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
|------|------|
|
||||||
|
| [aws_iam_group.Group1](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_group) | resource |
|
||||||
|
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
No inputs.
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| GroupName | Name of IAM group |
|
||||||
|
| last-updated | n/a |
|
||||||
|
|
||||||
|
---
|
||||||
|
## Authorship
|
||||||
|
This module was developed by xpk.
|
6
SecurityIdentityCompliance/Exercise1/main.tf
Normal file
6
SecurityIdentityCompliance/Exercise1/main.tf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
resource "aws_iam_group" "Group1" {
|
||||||
|
name = "Team-${random_pet.this.id}"
|
||||||
|
path = "/users/"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "random_pet" "this" {}
|
4
SecurityIdentityCompliance/Exercise1/outputs.tf
Normal file
4
SecurityIdentityCompliance/Exercise1/outputs.tf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
output "GroupName" {
|
||||||
|
value = aws_iam_group.Group1.name
|
||||||
|
description = "Name of IAM group"
|
||||||
|
}
|
27
SecurityIdentityCompliance/Exercise1/provider.tf
Normal file
27
SecurityIdentityCompliance/Exercise1/provider.tf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
provider "aws" {
|
||||||
|
region = "ap-east-1"
|
||||||
|
|
||||||
|
default_tags {
|
||||||
|
tags = {
|
||||||
|
ServiceProvider = "RackspaceTechnology"
|
||||||
|
Environment = "Training"
|
||||||
|
Project = "Iac"
|
||||||
|
TerraformMode = "managed"
|
||||||
|
TerraformDir = "${reverse(split("/", path.cwd))[1]}/${reverse(split("/", path.cwd))[0]}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output "last-updated" {
|
||||||
|
value = timestamp()
|
||||||
|
}
|
||||||
|
|
||||||
|
terraform {
|
||||||
|
required_version = ">= 1.3.0"
|
||||||
|
required_providers {
|
||||||
|
aws = {
|
||||||
|
source = "hashicorp/aws"
|
||||||
|
version = ">= 5.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
0
SecurityIdentityCompliance/Exercise1/variables.tf
Normal file
0
SecurityIdentityCompliance/Exercise1/variables.tf
Normal file
17
SecurityIdentityCompliance/Exercise2/.terraform.lock.hcl
Normal file
17
SecurityIdentityCompliance/Exercise2/.terraform.lock.hcl
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# This file is maintained automatically by "terraform init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/aws" {
|
||||||
|
version = "5.51.1"
|
||||||
|
constraints = ">= 4.0.0, >= 5.0.0"
|
||||||
|
hashes = [
|
||||||
|
"h1:ESfxP2tCO6IZldSQnepXmIm+x+VtaQt/bKgGjYE+0BY=",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "registry.terraform.io/hashicorp/random" {
|
||||||
|
version = "3.6.2"
|
||||||
|
hashes = [
|
||||||
|
"h1:wmG0QFjQ2OfyPy6BB7mQ57WtoZZGGV07uAPQeDmIrAE=",
|
||||||
|
]
|
||||||
|
}
|
40
SecurityIdentityCompliance/Exercise2/README.md
Normal file
40
SecurityIdentityCompliance/Exercise2/README.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<!-- This readme file is generated with terraform-docs -->
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| terraform | >= 1.3.0 |
|
||||||
|
| aws | >= 5.0 |
|
||||||
|
|
||||||
|
## Providers
|
||||||
|
|
||||||
|
| Name | Version |
|
||||||
|
|------|---------|
|
||||||
|
| random | 3.6.2 |
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
|
||||||
|
| Name | Source | Version |
|
||||||
|
|------|--------|---------|
|
||||||
|
| iam | terraform-aws-modules/iam/aws//modules/iam-group-with-policies | 5.39.1 |
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
|------|------|
|
||||||
|
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
No inputs.
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| GroupName | Name of IAM group |
|
||||||
|
| last-updated | n/a |
|
||||||
|
|
||||||
|
---
|
||||||
|
## Authorship
|
||||||
|
This module was developed by xpk.
|
12
SecurityIdentityCompliance/Exercise2/main.tf
Normal file
12
SecurityIdentityCompliance/Exercise2/main.tf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
module "iam" {
|
||||||
|
source = "terraform-aws-modules/iam/aws//modules/iam-group-with-policies"
|
||||||
|
version = "5.39.1"
|
||||||
|
|
||||||
|
name = "Team-${random_pet.this.id}"
|
||||||
|
create_group = true
|
||||||
|
custom_group_policy_arns = [
|
||||||
|
"arn:aws:iam::aws:policy/job-function/ViewOnlyAccess"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "random_pet" "this" {}
|
4
SecurityIdentityCompliance/Exercise2/outputs.tf
Normal file
4
SecurityIdentityCompliance/Exercise2/outputs.tf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
output "GroupName" {
|
||||||
|
value = module.iam.group_name
|
||||||
|
description = "Name of IAM group"
|
||||||
|
}
|
27
SecurityIdentityCompliance/Exercise2/provider.tf
Normal file
27
SecurityIdentityCompliance/Exercise2/provider.tf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
provider "aws" {
|
||||||
|
region = "ap-east-1"
|
||||||
|
|
||||||
|
default_tags {
|
||||||
|
tags = {
|
||||||
|
ServiceProvider = "RackspaceTechnology"
|
||||||
|
Environment = "Training"
|
||||||
|
Project = "Iac"
|
||||||
|
TerraformMode = "managed"
|
||||||
|
TerraformDir = "${reverse(split("/", path.cwd))[1]}/${reverse(split("/", path.cwd))[0]}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output "last-updated" {
|
||||||
|
value = timestamp()
|
||||||
|
}
|
||||||
|
|
||||||
|
terraform {
|
||||||
|
required_version = ">= 1.3.0"
|
||||||
|
required_providers {
|
||||||
|
aws = {
|
||||||
|
source = "hashicorp/aws"
|
||||||
|
version = ">= 5.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
0
SecurityIdentityCompliance/Exercise2/variables.tf
Normal file
0
SecurityIdentityCompliance/Exercise2/variables.tf
Normal file
Loading…
Reference in New Issue
Block a user