Skip to content

Infra features #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
terraform plan -out=tfplan.out \
-var="ami_id=ami-005fc0f236362e99f" \
-var="instance_type=t2.large" \
-var="volume_size=16"
-var="volume_size=20"
working-directory: ./terraform

- name: Save Plan JSON
Expand Down Expand Up @@ -88,14 +88,14 @@ jobs:
infracost breakdown --path=./terraform --format=table --out-file=/tmp/infracost-new.txt \
--terraform-var "ami_id=ami-005fc0f236362e99f" \
--terraform-var "instance_type=t2.large" \
--terraform-var "volume_size=16"
--terraform-var "volume_size=20"
infracost diff --path=./terraform \
--format=json \
--compare-to=/tmp/infracost-base.json \
--out-file=/tmp/infracost.json \
--terraform-var "ami_id=ami-005fc0f236362e99f" \
--terraform-var "instance_type=t2.large" \
--terraform-var "volume_size=16"
--terraform-var "volume_size=20"

- name: Post Infracost Comment
run: |
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/docker_compose/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
- name: Run main Docker Compose
shell: |
sleep 80
docker compose -f compose.monitoring.yml down
docker compose -f compose.monitoring.yml up -d --force-recreate
docker compose -f compose.monitoring.yml up -d
args:
chdir: /home/ubuntu
1 change: 1 addition & 0 deletions terraform/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resource "aws_instance" "ec2" {
key_name = var.key_pair_name
subnet_id = aws_subnet.public_subnet.id
vpc_security_group_ids = [aws_security_group.sg.id]
availability_zone = var.availability_zone # Set the AZ dynamically
tags = {
Name = var.ec2_name
}
Expand Down
6 changes: 6 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ variable "volume_size" {
default = 15 # Default to 30 GB
}

variable "availability_zone" {
description = "The availability zone where the EC2 instance will be deployed."
type = string
default = "us-east-1a" # Default value, can be overridden
}

variable "key_pair_name" {
description = "Key pair name for SSH access"
type = string
Expand Down
Loading