From 91ba4ffbb00dc5923582efae8efe72de6b1e3452 Mon Sep 17 00:00:00 2001 From: Hemantha SN Date: Tue, 6 Aug 2024 11:50:37 +0530 Subject: [PATCH] Added coginto / Route53 / RDS / Security Group /EIP services with terraform Code --- cognito/main.tf | 19 +++++++++++++++++++ eip/main.tf | 19 +++++++++++++++++++ rds/main.tf | 25 +++++++++++++++++++++++++ route53/main.tf | 28 ++++++++++++++++++++++++++++ securitygroup/main.tf | 27 +++++++++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 cognito/main.tf create mode 100644 eip/main.tf create mode 100644 rds/main.tf create mode 100644 route53/main.tf create mode 100644 securitygroup/main.tf diff --git a/cognito/main.tf b/cognito/main.tf new file mode 100644 index 0000000..11e399c --- /dev/null +++ b/cognito/main.tf @@ -0,0 +1,19 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.27" + } + } + + required_version = ">= 0.14.9" +} + +provider "aws" { + profile = "default" + region = "us-west-2" +} + +resource "aws_cognito_user_pool" "example" { + name = "MyExamplePool" +} \ No newline at end of file diff --git a/eip/main.tf b/eip/main.tf new file mode 100644 index 0000000..47d635a --- /dev/null +++ b/eip/main.tf @@ -0,0 +1,19 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.27" + } + } + + required_version = ">= 0.14.9" +} + +provider "aws" { + profile = "default" + region = "us-west-2" +} + +resource "aws_eip" "eip" { + vpc = true +} \ No newline at end of file diff --git a/rds/main.tf b/rds/main.tf new file mode 100644 index 0000000..271cf8c --- /dev/null +++ b/rds/main.tf @@ -0,0 +1,25 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.27" + } + } + + required_version = ">= 0.14.9" +} + +provider "aws" { + profile = "default" + region = "us-west-2" +} + +resource "aws_db_instance" "default" { + allocated_storage = 10 + engine = "mysql" + engine_version = "8.0" + instance_class = "db.t3.micro" + username = "foo" + password = "foobarbaz" + parameter_group_name = "default.mysql8.0" +} \ No newline at end of file diff --git a/route53/main.tf b/route53/main.tf new file mode 100644 index 0000000..41f5c40 --- /dev/null +++ b/route53/main.tf @@ -0,0 +1,28 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.27" + } + } + + required_version = ">= 0.14.9" +} + +provider "aws" { + profile = "default" + region = "us-west-2" +} + +resource "aws_route53_health_check" "example" { + fqdn = "example.com" + port = 80 + type = "HTTP" + resource_path = "/" + failure_threshold = "5" + request_interval = "30" + + tags = { + Name = "tf-test-health-check" + } +} \ No newline at end of file diff --git a/securitygroup/main.tf b/securitygroup/main.tf new file mode 100644 index 0000000..013932f --- /dev/null +++ b/securitygroup/main.tf @@ -0,0 +1,27 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 3.27" + } + } + + required_version = ">= 0.14.9" +} + +provider "aws" { + profile = "default" + region = "us-west-2" +} + +resource "aws_security_group" "example" { + # ... other configuration ... + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + ipv6_cidr_blocks = ["::/0"] + } +} \ No newline at end of file