Skip to content

Instantly share code, notes, and snippets.

View amaurybsouza's full-sized avatar
:octocat:
Automating everything!

Amaury Borges Souza amaurybsouza

:octocat:
Automating everything!
View GitHub Profile
@amaurybsouza
amaurybsouza / terraform_variables
Created March 8, 2022 11:31
terraform_variables
variable "app_region" {
description = "what instance type I can use"
type = string
}
variable "ami" {
description = "what subnet_id I can use"
type = string
}
@amaurybsouza
amaurybsouza / variables.tf
Created March 8, 2022 11:32
variables.tf
variable "app_region" {
description = "what instance type I can use"
type = string
}
variable "ami" {
description = "what subnet_id I can use"
type = string
}
@amaurybsouza
amaurybsouza / variables.tf
Created March 8, 2022 11:36
variables.tf
variable "app_region" {
description = "what instance type I can use"
type = string
}
variable "ami" {
description = "what subnet_id I can use"
type = string
}
locals {
vpc_id = var.vpc_id
subnet_id = var.subnet_id
ssh_user = var.ssh_user
key_name = var.key_name
private_key_path = var.private_key_path
}
resource "aws_instance" "gitlab" {
ami = "ami-04505e74c0741db5a"
@amaurybsouza
amaurybsouza / versions.tf
Created March 8, 2022 11:42
versions.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
@amaurybsouza
amaurybsouza / security_group.tf
Created March 8, 2022 11:43
security_group.tf
resource "aws_security_group" "server" {
name = "server_access"
vpc_id = local.vpc_id
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
@amaurybsouza
amaurybsouza / terraform_architecture
Created March 8, 2022 11:57
terraform_architecture
# tree projects/
projects/
├── modules
│   └── gitLab_app
│   ├── ec2.tf
│   ├── output.tf
│   ├── security_group.tf
│   ├── variables.tf
│   └── versions.tf
├── sa_gitLab_app
output "server_ip" {
value = aws_instance.server.public_ip
}
@amaurybsouza
amaurybsouza / provisioning_gitLab.yml
Created March 8, 2022 12:52
provisioning_gitLab.yml
---
- name: my playbook
hosts: all
become: true
remote_user: ubuntu
gather_facts: false
tasks:
- name: Update all packages to their latest version
apt:
upgrade: yes
@amaurybsouza
amaurybsouza / provisioning_gitLab.yml
Created March 8, 2022 12:53
provisioning_gitLab.yml
---
- name: my playbook
hosts: all
become: true
remote_user: ubuntu
gather_facts: false
tasks:
- name: Update all packages to their latest version
apt:
upgrade: yes