Showing posts with label Cloud. Show all posts
Showing posts with label Cloud. Show all posts

Thursday, August 11, 2022

Migrate EC2-Classic Instance to VPC



AWS retire the EC2-Classic environment on 15th August 2022 and you will need to migrate your AWS resources from EC2-Classic to Amazon VPC before this date. 

What is classic and VPC network in AWS?

i) Classic network is where your instance run in a single flat network that is shared with other customers.

ii) VPC network is logically isolated to only your AWS account. Ec2 VPC instance run in a virtual private cloud.


Migration Process.

First create VPC network if not created or you can use default VPC network if it is already there.

1. Create AMI of which server you want to migrate.
2. Create new (SG) security group or copy existing security group under VPC network.
3. Create Elastic public IP under VPC scope.

Now you are ready to launch instance under VPC.

4. Click launch instance and select your AMI which you have created.
5. Fill all the required details. while you select the network select VPC network and subnets.
6. If all goes good your instance will be ready under VPC network.

To verify the instance created under VPC network or not.

From console select instance verify VPC ID.

From AWS CLI run below command to verify.

aws ec2 describe-instances
--region us-east-1
--output table
--query 'Reservations[*].Instances[*].InstanceId'

Done..!!☝










Wednesday, June 29, 2022

Jenkins, Backup server setup. If master crash.

 

In this blog we will restore Jenkins backup in a new Jenkins server. where you can restore you previous or existing Jenkins backup in to a new Jenkins server. 

To complete this process you should have Jenkins backup with you.


>> Let's start.<< 

First we need to setup a new server and install Jenkins on it.


Now restore the old Jenkins backup to the new server under /$JENKINS_HOME folder /var/lib/Jenkins.

Create SSH secret file in Jenkins home directory with command ssh-keygen

Put SSH public key “id_rsa.pub” key into GitLab ssh-key-access settings.

And also put the public key “id_rsa.pub” key into the deployment server for communication between the Jenkins server to the deployment server.

Note: White list the new Jenkins server public IP for Gitlab server and deployment servers on AWS or respective cloud.



Terraform vs Pulumi

This article is all about terraform vs pulumi difference.


There are many (IaC) infrastructure as code tools are available. but today we are going to understand the two most popular IaC tool currently in the market. 

1. Terraform

2. Pulumi

What is Terraform?

It is an open-source laC solution that helps you maintain and provision cloud infrastructures. You use a custom declarative language to describe Terraforms required components. Then, Terraform generates a plan to achieve your desired outcome.

Terraform a domain-specific language (DSL) called HashiCorp Configuration Language (HCL). HCL provides arguments, expressions, and blocks to simplify the Terraform configuration.

Below is the terraform example code.

provider "aws" {
  profile    = "default"
  region     = "us-east-1"
}

resource "aws_instance" "example" {
  ami           = "ami-2757f001"
  instance_type = "t2.micro"
}

What is Pulumi?

It is fast-growing IaC solution. You can use it to maintain, deploy, and configure resources on your cloud infrastructure, as well as improve its efficiency.

It supports multiple private, hybrid, and public cloud providers such as OpenStack, Kubernetes, Google Cloud, Azure, Amazon Web Services (AWS), and phoenixNAP Bare Metal Cloud.

Pulumi is a multi-language infrastructure as code tool. Pulumi supports all major language.

The following language runtimes are currently supported by Pulumi.

  • Node.js
  • Python
  • Go
  • C#
  • Java
  • YAML
You can chose any language to write your Infra. Below is example python code.

import pulumi
from pulumi_aws import s3

# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket('test-bucket')

# Export the name of the bucket
pulumi.export('bucket_name',  bucket.id)
Cop


What is DevOps? DevOps Kya hai?

DevOps is not a tool or a software. DevOps simply is a hassle free process to implement, develop and deliver the product to client. It'...