diff --git a/Devops/Docker/Docker_compose_jenkins.yml b/Devops/Docker/Docker_compose_jenkins.yml new file mode 100644 index 0000000..fd58b99 --- /dev/null +++ b/Devops/Docker/Docker_compose_jenkins.yml @@ -0,0 +1,14 @@ +# docker-compose.yml +version: '3.7' +services: + jenkins: + image: jenkins/jenkins:lts + privileged: true + user: root + ports: + - 8083:8080 + - 50003:50000 + container_name: my-jenkins-3 + volumes: + - ~/jenkins_data:/var/jenkins_home + - /var/run/docker.sock:/var/run/docker.sock diff --git a/Devops/Terraform/Ec2_creation.tf b/Devops/Terraform/Ec2_creation.tf new file mode 100644 index 0000000..b6d80b8 --- /dev/null +++ b/Devops/Terraform/Ec2_creation.tf @@ -0,0 +1,83 @@ +variable "awsprops" { + type = "map" + default = { + region = "us-east-1" + vpc = "vpc-5234832d" + ami = "ami-0c1bea58988a989155" + itype = "t2.micro" + subnet = "subnet-81896c8e" + publicip = true + keyname = "myseckey" + secgroupname = "IAC-Sec-Group" + } +} + +provider "aws" { + region = lookup(var.awsprops, "region") +} + +resource "aws_security_group" "project-iac-sg" { + name = lookup(var.awsprops, "secgroupname") + description = lookup(var.awsprops, "secgroupname") + vpc_id = lookup(var.awsprops, "vpc") + + // To Allow SSH Transport + ingress { + from_port = 22 + protocol = "tcp" + to_port = 22 + cidr_blocks = ["0.0.0.0/0"] + } + + // To Allow Port 80 Transport + ingress { + from_port = 80 + protocol = "" + to_port = 80 + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + lifecycle { + create_before_destroy = true + } +} + + +resource "aws_instance" "project-iac" { + ami = lookup(var.awsprops, "ami") + instance_type = lookup(var.awsprops, "itype") + subnet_id = lookup(var.awsprops, "subnet") #FFXsubnet2 + associate_public_ip_address = lookup(var.awsprops, "publicip") + key_name = lookup(var.awsprops, "keyname") + + + vpc_security_group_ids = [ + aws_security_group.project-iac-sg.id + ] + root_block_device { + delete_on_termination = true + iops = 150 + volume_size = 50 + volume_type = "gp2" + } + tags = { + Name ="SERVER01" + Environment = "DEV" + OS = "UBUNTU" + Managed = "IAC" + } + + depends_on = [ aws_security_group.project-iac-sg ] +} + + +output "ec2instance" { + value = aws_instance.project-iac.public_ip +} diff --git a/Devops/devops.pdf b/Devops/devops.pdf new file mode 100644 index 0000000..81c44cf Binary files /dev/null and b/Devops/devops.pdf differ