Skip to content

Commit

Permalink
[FIX] error
Browse files Browse the repository at this point in the history
  • Loading branch information
ohksj77 committed Mar 16, 2024
1 parent b0ab961 commit 59a8e72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ jobs:
terraform init
terraform apply -auto-approve
env:
TF_VAR_vpc_cidr_block: ${{ secrets.TF_VAR_vpc_cidr_block }}
TF_VAR_public_subnet_cidr: ${{ secrets.TF_VAR_public_subnet_cidr }}
TF_VAR_private_subnet_cidr: ${{ secrets.TF_VAR_private_subnet_cidr }}
TF_VAR_ami: ${{ secrets.TF_VAR_ami }}
TF_VAR_db_password: ${{ secrets.TF_VAR_db_password }}
TF_VAR_tags: ${{ secrets.TF_VAR_tags }}
Expand Down
15 changes: 8 additions & 7 deletions terraform/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resource "aws_default_vpc" "vpc_network" {
tags = merge(var.tags, {})
cidr_block = "10.0.0.0/24"
enable_dns_support = true
enable_dns_hostnames = true
}
Expand All @@ -12,21 +13,21 @@ resource "aws_internet_gateway" "internet_gw" {
resource "aws_subnet" "private-subnet-a" {
vpc_id = aws_default_vpc.vpc_network.id
tags = merge(var.tags, {})
cidr_block = var.private_subnet_cidr[0]
cidr_block = "10.0.2.0/24"
availability_zone = "ap-northeast-2a"
}

resource "aws_subnet" "private-subnet-c" {
vpc_id = aws_default_vpc.vpc_network.id
tags = merge(var.tags, {})
cidr_block = var.private_subnet_cidr[1]
cidr_block = "10.0.3.0/24"
availability_zone = "ap-northeast-2c"
}

resource "aws_subnet" "public-subnet-c" {
vpc_id = aws_default_vpc.vpc_network.id
tags = merge(var.tags, {})
cidr_block = var.public_subnet_cidr
cidr_block = "10.0.1.0/24"
availability_zone = "ap-northeast-2b"
}

Expand Down Expand Up @@ -109,23 +110,23 @@ resource "aws_security_group" "security-group-a" {
protocol = "tcp"
from_port = 80
cidr_blocks = [
var.public_subnet_cidr,
"10.0.1.0/24",
]
}
ingress {
to_port = 61613
protocol = "tcp"
from_port = 61613
cidr_blocks = [
var.public_subnet_cidr,
"10.0.1.0/24",
]
}
ingress {
to_port = 5672
protocol = "tcp"
from_port = 5672
cidr_blocks = [
var.public_subnet_cidr,
"10.0.1.0/24",
]
}
}
Expand All @@ -148,7 +149,7 @@ resource "aws_security_group" "security-group-c" {
protocol = "tcp"
from_port = 80
cidr_blocks = [
var.public_subnet_cidr,
"10.0.1.0/24",
]
}
}
Expand Down

0 comments on commit 59a8e72

Please sign in to comment.