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
From centos:latest | |
run yum install wget -y | |
run yum install net-tools -y | |
run wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo | |
run rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key | |
run yum upgrade -y | |
run yum install java -y | |
run yum install jenkins -y |
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
provider "aws" { | |
region = "ap-south-1" | |
profile = "EKS" | |
} | |
resource "aws_iam_role" "eks_cluster" { | |
name = "ViRocluster" | |
assume_role_policy = <<POLICY |
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
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig | |
metadata: | |
name: ViRocluster | |
region: ap-south-1 | |
nodeGroups: | |
- name: ng1 | |
desiredCapacity: 2 | |
instanceType: t2.micro | |
ssh: |
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
#Github gist by Rohit Ghumare to augment and create replicas of images | |
[ | |
{ | |
"dst": "$data", | |
"src": [ | |
"Dataset/*" | |
], | |
"action": "data", | |
"settings": { | |
"classes_mapping": "default" |
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
//Describing Provider | |
provider "aws" { | |
region = "ap-south-1" | |
profile = "rg" | |
} | |
//Creating Variable for AMI_ID | |
variable "ami_id" { | |
type = string | |
default = "ami-0447a12f28fddb066" |
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
//Creating EBS Snapshot | |
resource "aws_ebs_snapshot" "ebs_snapshot" { | |
volume_id = "${aws_ebs_volume.web-vol.id}" | |
description = "Snapshot of our EBS volume" | |
tags = { | |
env = "Production" | |
} | |
depends_on = [ | |
aws_volume_attachment.ebs_att |
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
resource "null_resource" "remote1" { | |
depends_on = [ aws_instance.web, ] | |
//Executing Commands to initiate WebServer in Instance Over SSH | |
provisioner "remote-exec" { | |
connection { | |
agent = "false" | |
type = "ssh" | |
user = "ec2-user" | |
private_key = "${tls_private_key.tls_key.private_key_pem}" |
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
//Launching EC2 Instance | |
resource "aws_instance" "web" { | |
ami = "${var.ami_id}" | |
instance_type = "${var.ami_type}" | |
key_name = "${aws_key_pair.generated_key.key_name}" | |
security_groups = ["${aws_security_group.web-SG.name}","default"] | |
//Labelling the Instance | |
tags = { | |
Name = "Web-Env" |
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
//Creating CloutFront with S3 Bucket Origin | |
resource "aws_cloudfront_distribution" "s3-web-distribution" { | |
origin { | |
domain_name = "${aws_s3_bucket.rg-bucket.bucket_regional_domain_name}" | |
origin_id = "${aws_s3_bucket.rg-bucket.id}" | |
} | |
enabled = true | |
is_ipv6_enabled = true |
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
//Creating a S3 Bucket for Terraform Integration | |
resource "aws_s3_bucket" "rg-bucket" { | |
bucket = "rg-static-data-bucket" | |
acl = "public-read" | |
} | |
//Putting Objects in S3 Bucket | |
resource "aws_s3_bucket_object" "web-object1" { | |
bucket = "${aws_s3_bucket.rg-bucket.bucket}" | |
key = "rg.jpg" |
NewerOlder