Skip to content

Commit f5c2f9f

Browse files
authored
Merge pull request #179 from prgrms-web-devcourse-final-project/chore/33-infra
chore[deploy]: 인스턴스 id 변경 및 elastic ip 설정
2 parents eed6b56 + c2a2524 commit f5c2f9f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/CI-CD_Pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ jobs:
239239
aws-region: ${{ secrets.AWS_REGION }}
240240
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
241241
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
242-
instance-ids: "i-0528c585d9578d329"
242+
instance-ids: "i-0ce4cb989d837170e"
243243
working-directory: /
244244
comment: Deploy
245245
command: |

infra/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,4 +416,20 @@ resource "aws_instance" "ec2_1" {
416416
user_data = <<-EOF
417417
${local.ec2_user_data_base}
418418
EOF
419+
}
420+
421+
# Elastic IP 생성
422+
resource "aws_eip" "eip_1" {
423+
domain = "vpc"
424+
425+
tags = {
426+
Name = "${var.prefix}-eip-1"
427+
}
428+
429+
}
430+
431+
# Elastic IP와 EC2 인스턴스 연결
432+
resource "aws_eip_association" "eip_assoc" {
433+
instance_id = aws_instance.ec2_1.id
434+
allocation_id = aws_eip.eip_1.id
419435
}

0 commit comments

Comments
 (0)