Skip to content

Commit

Permalink
Feat: Updated the terraform code & removed the unused tf variables an…
Browse files Browse the repository at this point in the history
…d files.
  • Loading branch information
anmolnagpal committed Aug 28, 2023
1 parent d54e8ea commit 2f2c982
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 135 deletions.
29 changes: 0 additions & 29 deletions _example/main.tf

This file was deleted.

9 changes: 0 additions & 9 deletions _example/outputs.tf

This file was deleted.

91 changes: 0 additions & 91 deletions _example/public/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,6 @@ provider "aws" {
region = "eu-west-1"
}

################################################################################
# VPC
################################################################################

module "vpc" {
source = "clouddrove/vpc/aws"
version = "2.0.0"
name = "vpc"
environment = "test"
cidr_block = "10.0.0.0/16"
enable_flow_log = true # Flow logs will be stored in cloudwatch log group. Variables passed in default.
create_flow_log_cloudwatch_iam_role = true
additional_cidr_block = ["172.3.0.0/16", "172.2.0.0/16"]
dhcp_options_domain_name = "service.consul"
dhcp_options_domain_name_servers = ["127.0.0.1", "10.10.0.2"]
}

################################################################################
# Subnets
################################################################################

module "subnets" {
source = "clouddrove/subnet/aws"
version = "1.0.1"

name = "subnets"
environment = "test"
label_order = ["environment", "name"]
# tags = local.tags
enabled = true

nat_gateway_enabled = true
single_nat_gateway = true
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
vpc_id = module.vpc.vpc_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
type = "public-private"
assign_ipv6_address_on_creation = false
}

################################################################################
# AWS SFTP SECURITY GROUP
################################################################################

module "security_group-sftp" {
source = "clouddrove/security-group/aws"
version = "2.0.0"
name = "sftp-sg"
environment = "test"
label_order = ["environment", "name"]
vpc_id = module.vpc.vpc_id
## INGRESS Rules
new_sg_ingress_rules_with_cidr_blocks = [{
rule_count = 1
from_port = 22
protocol = "tcp"
to_port = 22
cidr_blocks = [module.vpc.vpc_cidr_block, "172.16.0.0/16"]
description = "Allow ssh traffic."
},
{
rule_count = 2
from_port = 27017
protocol = "tcp"
to_port = 27017
cidr_blocks = ["172.16.0.0/16"]
description = "Allow SFTP traffic."
}
]

## EGRESS Rules
new_sg_egress_rules_with_cidr_blocks = [{
rule_count = 1
from_port = 22
protocol = "tcp"
to_port = 22
cidr_blocks = [module.vpc.vpc_cidr_block, "172.16.0.0/16"]
description = "Allow ssh outbound traffic."
},
{
rule_count = 2
from_port = 27017
protocol = "tcp"
to_port = 27017
cidr_blocks = ["172.16.0.0/16"]
description = "Allow SFTP outbound traffic."
}]
}


################################################################################
# AWS S3
################################################################################
Expand Down
4 changes: 4 additions & 0 deletions _example/vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "id" {
description = "ID of the created example"
value = module.sftp.id
}
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ variable "enable_sftp" {
}


variable "public_key" {
type = string
default = ""
description = "Name (e.g. `ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQ`)."
}

variable "identity_provider_type" {
type = string
default = "SERVICE_MANAGED"
Expand Down

0 comments on commit 2f2c982

Please sign in to comment.