From 9afec06e0b44c916fb57fbeda1aa9662a549ae57 Mon Sep 17 00:00:00 2001 From: chibaba Date: Tue, 2 Jan 2024 15:39:40 +0100 Subject: [PATCH] first commit-setup aws-ec2 --- infras/gitops1/main.tf | 27 +++++++++++++++++++++++++++ infras/gitops1/user_data.sh | 0 2 files changed, 27 insertions(+) create mode 100644 infras/gitops1/main.tf create mode 100644 infras/gitops1/user_data.sh diff --git a/infras/gitops1/main.tf b/infras/gitops1/main.tf new file mode 100644 index 0000000..32ee2cd --- /dev/null +++ b/infras/gitops1/main.tf @@ -0,0 +1,27 @@ +terraform { + + required_providers { + + aws = { + + source ="hasicorp/aws" + version = "4.10" + } + required_version = ">=1.1.0" + + } + +} + provider "aws" { + region = "us-east-1" + } + +resource "aws_instance" "apache2_server"{ + ami = "ami-00399ec92321828f5" + instance__type ="t2.micro" + user_data = "${file("user_data.sh")}" + + tags = { + env = "dev" + } +} \ No newline at end of file diff --git a/infras/gitops1/user_data.sh b/infras/gitops1/user_data.sh new file mode 100644 index 0000000..e69de29