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 / 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 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
}
}
provider "aws"{
profile = "profilename"
region = "us-east-1"
}
module "prod"{
source = "./env/prod"
}
module "dev"{
source = "./env/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"
}
@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 / 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 / variables.tf
Created April 22, 2022 12:43
s3-private/variables.tf
variable "name" {}
variable "environment" {}
@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}"
}