Skip to content

Instantly share code, notes, and snippets.

View welsayedaly's full-sized avatar
🎯
Focusing

Walid El Sayed Aly welsayedaly

🎯
Focusing
View GitHub Profile
name: "Terraform"
on:
push:
branches:
- main
pull_request:
jobs:
terraform:
resource "aws_key_pair" "deployer" {
key_name = "ec2-deployer-key-pair"
public_key = "your public_key look like that ssh-rsa AAAAB3N…”
}
resource "aws_security_group" "main" {
egress = [
{
cidr_blocks = ["0.0.0.0/0", ]
description = ""
from_port = 0
ipv6_cidr_blocks = []
prefix_list_ids = []
protocol = "-1"
security_groups = []
resource "aws_instance" "app_server" {
count = 2
ami = "ami-047e03b8591f2d48a"
instance_type = "t2.micro"
key_name = "ec2-deployer-key-pair"
vpc_security_group_ids = [aws_security_group.main.id]
tags = {
Name = "First-Ec2-With-Terraform"
}
variable "AWS_ACCESS_KEY_ID" {
type = string
}
variable "AWS_SECRET_ACCESS_KEY" {
type = string
}
provider "aws" {
profile = "default"
region = "eu-central-1"
access_key = var.AWS_ACCESS_KEY_ID
secret_key = var.AWS_SECRET_ACCESS_KEY
}
@welsayedaly
welsayedaly / main.tf
Created November 10, 2021 10:11
main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
required_version = ">= 1.0.4"
}
@welsayedaly
welsayedaly / triggerAndMySqlFunctionProcess.jpg
Last active August 13, 2020 10:54
Modell for Write some MySQL code project
Enclosed you see the process to this request:
http http://hostname/resource
curl -i -H "Accept: application/json" -X GET http://hostname/resource