Commit 93ad6cbf authored by rajat.kulkarni's avatar rajat.kulkarni

Upload New File

parent f5e9546a
provider "aws" {
profile = "default"
region = "us-east-1"
access_key = "AKIAXH6PITZUD6E7DLNX"
secret_key = "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"
}
resource "aws_instance" "ec301" {
ami ="ami-087c17d1fe0178315"
instance_type =var.instance_type
#security_groups = var.security_group_name
key_name = "ec2instance"
tags = { ec2_create = "instance1" }
}
variable "instance_type" {
description = "Value of the Name tag for the EC2 instance"
type = string
default = "t2.micro"
sensitive = true
}
resource "aws_default_vpc" "main" {
tags = { Name = "main" }
}
resource "aws_ebs_volume" "vol" {
availability_zone = "us-east-1a"
size = 8
tags = { key_name = "ec2instance" }
}
resource "time_sleep" "wait_30_seconds" {
depends_on = [aws_instance.ec301]
create_duration = "60s"
}
variable "security_group_name" {
description = "Value of the Security group name"
type = string
default = "ExampleAppServerInstance"
}
variable "role_name" {
description = "Value of the Name tag for the IAM role"
type = string
default = "ExampleAppServerInstance"
sensitive = true
}
variable "policy_name" {
description = "Value of the Name tag for the EC2 instance"
type = string
default = "ExampleAppServerInstance"
sensitive = true
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment