updated git ignore

This commit is contained in:
Pratik Das
2021-04-16 16:01:29 +04:00
parent c358d28ca6
commit 23cd4e4da7
19 changed files with 231 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
**/.idea/
**/*.iml
**/.DS_Store
**/.terraform

View File

@@ -0,0 +1,41 @@
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "pratikorg"
token = "pj7p59JFwSC4jQ.atlasv1.qfmTxLjTfaM5zKyaQrcGzuTojv6oCyLIoIAO7DkA2ieQY7OyINjINGGMiTczt62p1bs"
workspaces {
name = "my-tf-workspace"
}
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.36"
}
}
}
provider "aws" {
profile = "default"
region = "us-west-2"
}
module "app_server" {
source = "./modules/application"
ec2_instance_type = "t2.micro"
ami = "ami-830c94e3"
tags = {
Name = "server for web"
Env = "dev"
}
}
module "app_storage" {
source = "./modules/storage/"
bucket_name = "io.pratik.tf-example-bucket"
env = "dev"
}

View File

@@ -0,0 +1,5 @@
resource "aws_instance" "vm-web" {
ami = var.ami
instance_type = var.ec2_instance_type
tags = var.tags
}

View File

@@ -0,0 +1,4 @@
output "instanceID" {
description = "ID of ec2 instance"
value = aws_instance.vm-web.id
}

View File

@@ -0,0 +1,16 @@
variable "ec2_instance_type" {
description = "Instance type"
type = string
}
variable "ami" {
description = "ami id"
type = string
}
variable "tags" {
description = "Tags to set on the bucket."
type = map(string)
default = {Name = "server for web"
Env = "dev"}
}

View File

@@ -0,0 +1,9 @@
resource "aws_s3_bucket" "s3_bucket" {
bucket = format("%s-%s",var.bucket_name,var.env)
acl = "private"
tags = {
Name = var.bucket_name
Environment = var.env
}
}

View File

@@ -0,0 +1,4 @@
output "arn" {
description = "ARN of the bucket"
value = aws_s3_bucket.s3_bucket.arn
}

View File

@@ -0,0 +1,13 @@
# Input variable definitions
variable "bucket_name" {
description = "Name of bucket"
type = string
}
variable "env" {
description = "Environment like dev, prod"
type = string
}

View File

@@ -0,0 +1,24 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
}
provider "aws" {
profile = "default"
region = "us-west-2"
}
resource "aws_instance" "vm-web" {
ami = "ami-830c94e3"
instance_type = var.ec2_instance_type
tags = {
Name = "server for web"
Env = "dev"
}
}

View File

@@ -0,0 +1 @@
ec2_instance_type = "t2.micro"

View File

@@ -0,0 +1,4 @@
variable "ec2_instance_type" {
description = "AWS EC2 instance type."
type = string
}

View File

@@ -0,0 +1,33 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.36"
}
}
}
provider "aws" {
profile = "default"
region = "us-west-2"
}
module "app_server" {
source = "./modules/application"
ec2_instance_type = "t2.micro"
ami = "ami-830c94e3"
tags = {
Name = "server for web"
Env = "dev"
}
}
module "app_storage" {
source = "./modules/storage/"
bucket_name = "io.pratik.tf-example-bucket"
env = "dev"
}

View File

@@ -0,0 +1,5 @@
resource "aws_instance" "vm-web" {
ami = var.ami
instance_type = var.ec2_instance_type
tags = var.tags
}

View File

@@ -0,0 +1,4 @@
output "instanceID" {
description = "ID of ec2 instance"
value = aws_instance.vm-web.id
}

View File

@@ -0,0 +1,16 @@
variable "ec2_instance_type" {
description = "Instance type"
type = string
}
variable "ami" {
description = "ami id"
type = string
}
variable "tags" {
description = "Tags to set on the bucket."
type = map(string)
default = {Name = "server for web"
Env = "dev"}
}

View File

@@ -0,0 +1,9 @@
resource "aws_s3_bucket" "s3_bucket" {
bucket = format("%s-%s",var.bucket_name,var.env)
acl = "private"
tags = {
Name = var.bucket_name
Environment = var.env
}
}

View File

@@ -0,0 +1,4 @@
output "arn" {
description = "ARN of the bucket"
value = aws_s3_bucket.s3_bucket.arn
}

View File

@@ -0,0 +1,13 @@
# Input variable definitions
variable "bucket_name" {
description = "Name of bucket"
type = string
}
variable "env" {
description = "Environment like dev, prod"
type = string
}

View File

@@ -0,0 +1,24 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
}
provider "aws" {
profile = "default"
region = "us-west-2"
}
resource "aws_instance" "vm-web" {
ami = "ami-830c94e3"
instance_type = "t2.micro"
tags = {
Name = "server for web"
Env = "dev"
}
}