Skip to content

Instantly share code, notes, and snippets.

View arun9theja's full-sized avatar
:octocat:
arun9theja

arun9theja arun9theja

:octocat:
arun9theja
View GitHub Profile
@devops-school
devops-school / aws.tf
Created April 3, 2023 04:23
write a terraform code which would create Security Group and new Key and create Ec2 instance and use newly created Security Group and Key.The security group should allow incoming traffic on port 22 (SSH) and port 80 (HTTP).
# Create a security group
resource "aws_security_group" "web" {
name_prefix = "web-sg"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
@devops-school
devops-school / aws.tf
Created April 3, 2023 04:22
write a terraform code which would create Ec2 instance and use Existing Security Group and Key
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
key_name = "existing-key-name"
vpc_security_group_ids = ["existing-security-group-id"]
tags = {
@devops-school
devops-school / terraform-path-cwd.tf
Created March 31, 2023 05:16
Terraform Tutorials: Named Values – Filesystem and workspace info
locals {
# Define the path to the current working directory
current_dir = path.cwd
}
resource "aws_s3_bucket" "example_bucket" {
bucket = "example-bucket-${local.current_dir}"
acl = "private"
}
@devops-school
devops-school / terraform-path-root.tf
Created March 31, 2023 05:14
Terraform Tutorials: Named Values – Filesystem and workspace info
provider "aws" {
region = "us-east-1"
}
locals {
# Define the path to the directory containing your Terraform files
base_dir = path.root
}
resource "aws_s3_bucket" "example_bucket" {
@devops-school
devops-school / Named-filesystems.tf
Created March 31, 2023 05:11
Terraform Tutorials: Named Values – Filesystem and workspace info
provider "aws" {
region = "us-west-2"
}
resource "aws_s3_bucket" "example_bucket" {
bucket = "example-bucket"
acl = "private"
tags = {
Name = "Example Bucket"
@devops-school
devops-school / main.tf
Created February 13, 2023 05:57
Example of terraform Map variable using aws provider
variable "instance_tags" {
type = map(string)
default = {
Name = "my-instance"
}
}
provider "aws" {
region = "us-west-2"
}
@devops-school
devops-school / main.tf
Created February 13, 2023 05:53
Example of terraform list variable using aws provider
variable "security_groups" {
type = list(string)
default = ["default"]
}
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "example" {
variable "instance_name" {
type = string
default = "my-instance"
}
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "example" {
@devops-school
devops-school / main.tf
Created February 13, 2023 05:48
Example of terraform Number variable using aws provider
variable "instance_count" {
type = number
default = 1
}
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "example" {
@dmancloud
dmancloud / How to Install SonarQube in Ubuntu Linux.md
Last active August 16, 2025 09:06
How to Install SonarQube in Linux

How to Install Sonarqube in Ubuntu Linux

Prerequsites

Virtual Machine running Ubuntu 22.04 or newer

Install Postgresql 15

sudo apt update
sudo apt upgrade

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'