Skip to content

Instantly share code, notes, and snippets.

View anilchalissery's full-sized avatar

anilchalissery anilchalissery

  • Innovation Incubator ltd
  • thrissur
View GitHub Profile
@anilchalissery
anilchalissery / main.tf
Last active April 19, 2022 12:41
s3-private/main.tf
resource "aws_s3_bucket" "s3-bucket" {
bucket = "${var.environment}-${var.name}"
}
@anilchalissery
anilchalissery / variables.tf
Created April 22, 2022 12:43
s3-private/variables.tf
variable "name" {}
variable "environment" {}
@anilchalissery
anilchalissery / outputs.tf
Created April 22, 2022 12:46
s3-private/outputs.tf
output "s3_arn" {
value = aws_s3_bucket.s3-bucket.arn
description = "The id of S3"
}
@anilchalissery
anilchalissery / main.tf
Created April 22, 2022 12:48
env/dev/main.tf
module "s3-private-bucket"{
source = "../../s3-private"
name = "private-terraform-module"
environment = "dev"
}
@anilchalissery
anilchalissery / main.tf
Created April 22, 2022 12:51
env/prod/main.tf
module "s3-private-bucket"{
source = "../../s3-private"
name = "private-terraform-module"
environment = "prod"
}
module "prod"{
source = "./env/prod"
}
module "dev"{
source = "./env/dev"
}
provider "aws"{
profile = "profilename"
region = "us-east-1"
}
@anilchalissery
anilchalissery / main.tf
Created May 1, 2022 05:41
s3-cloudfront/main.tf
#creating s3 bucket
resource "aws_s3_bucket" "s3-bucket" {
bucket = "${var.environment}-${var.name}"
acl = "private"
tags = {
Name = "${var.environment}-${var.name}"
Environment = var.environment
}
}
@anilchalissery
anilchalissery / variables.tf
Created May 1, 2022 05:46
s3-cloudfront/variable.tf
variable "environment" {}
variable "name" {}
variable "acm" {}
variable "domain" {}
variable "root_object" {}
@anilchalissery
anilchalissery / main.tf
Created May 5, 2022 09:19
env/prod/main.tf
##S3-Cloudfront
module "sampleapp-prod-frontend-s3cloud" {
source = "../../s3-cloudfront"
environment = "sampleweb-prod"
name = "frontend"
root_object = "index.html"
acm = "arn:aws:acm:us-east-1:123456789101:certificate/4cb08723-6052-4853-8d1f-5674ac80d092"
domain = "app.example.com"
}