diff --git a/.gitignore b/.gitignore index f82f9b0..1349ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ bin/ ### Terraform ### .terraform +*.tfstate +*.tfstate.backup diff --git a/Compute/Demo3/terraform.tfvars b/Compute/Demo3/terraform.tfvars new file mode 100644 index 0000000..0b9ec68 --- /dev/null +++ b/Compute/Demo3/terraform.tfvars @@ -0,0 +1 @@ +cidr_block = "10.0.0.0/8" \ No newline at end of file diff --git a/Compute/Demo3/variables.tf b/Compute/Demo3/variables.tf new file mode 100644 index 0000000..0074f7f --- /dev/null +++ b/Compute/Demo3/variables.tf @@ -0,0 +1,6 @@ +variable "cidr_block" { + type = string + description = "CIDR block of VPC" + default = "10.0.0.0/16" +} + diff --git a/SecurityManagementCompliance/Exercise1/.terraform.lock.hcl b/SecurityManagementCompliance/Exercise1/.terraform.lock.hcl new file mode 100644 index 0000000..e51eea3 --- /dev/null +++ b/SecurityManagementCompliance/Exercise1/.terraform.lock.hcl @@ -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=", + ] +} diff --git a/SecurityManagementCompliance/Exercise1/main.tf b/SecurityManagementCompliance/Exercise1/main.tf new file mode 100644 index 0000000..15eaf14 --- /dev/null +++ b/SecurityManagementCompliance/Exercise1/main.tf @@ -0,0 +1,6 @@ +resource "aws_iam_group" "Group1" { + name = "Team-${random_pet.this.id}" + path = "/users/" +} + +resource "random_pet" "this" {} \ No newline at end of file diff --git a/SecurityManagementCompliance/Exercise1/outputs.tf b/SecurityManagementCompliance/Exercise1/outputs.tf new file mode 100644 index 0000000..c2042e9 --- /dev/null +++ b/SecurityManagementCompliance/Exercise1/outputs.tf @@ -0,0 +1,4 @@ +output "GroupName" { + value = aws_iam_group.Group1.name + description = "Name of IAM group" +} \ No newline at end of file diff --git a/SecurityManagementCompliance/Exercise1/provider.tf b/SecurityManagementCompliance/Exercise1/provider.tf new file mode 100644 index 0000000..b6ed192 --- /dev/null +++ b/SecurityManagementCompliance/Exercise1/provider.tf @@ -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" + } + } +} \ No newline at end of file diff --git a/SecurityManagementCompliance/Exercise1/terraform.tfvars b/SecurityManagementCompliance/Exercise1/terraform.tfvars new file mode 100644 index 0000000..e69de29 diff --git a/SecurityManagementCompliance/Exercise1/variables.tf b/SecurityManagementCompliance/Exercise1/variables.tf new file mode 100644 index 0000000..e69de29