Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Devops/Docker/Docker_compose_jenkins.yml
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions Devops/Terraform/Ec2_creation.tf
Original file line number Diff line number Diff line change
@@ -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
}
Binary file added Devops/devops.pdf
Binary file not shown.