Skip to content

Commit

Permalink
move ip check on step downward
Browse files Browse the repository at this point in the history
  • Loading branch information
Oloruntobi Olurombi committed Aug 29, 2024
1 parent 3fc044e commit c1b1887
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/eks-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ jobs:
- name: Apply Terraform
run: terraform apply -auto-approve

- name: Ensure EC2 Public IP is Not Empty
if: ${{ env.EC2_PUBLIC_IP == '' }}
run: |
echo "Error: EC2 Public IP is empty. Exiting."
exit 1
- name: Get EC2 Public IP
id: get_public_ip
run: |
Expand All @@ -62,6 +56,12 @@ jobs:
echo "EC2_PUBLIC_IP=$EC2_PUBLIC_IP" >> $GITHUB_ENV
echo "Captured EC2 Public IP: $EC2_PUBLIC_IP"
- name: Ensure EC2 Public IP is Not Empty
if: ${{ env.EC2_PUBLIC_IP == '' }}
run: |
echo "Error: EC2 Public IP is empty. Exiting."
exit 1
- name: Verify EC2 Instance State
run: |
INSTANCE_STATE=$(aws ec2 describe-instances --instance-ids $(terraform output -raw ec2_instance_id) --query 'Reservations[*].Instances[*].State.Name' --output text)
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
key = "terraform.tfstate"
region = "us-east-1"
encrypt = true
#profile = "tobi"
profile = "tobi"
}
}

Expand Down
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provider "aws" {
region = var.region
access_key = var.aws_access_key_id
secret_key = var.aws_secret_access_key
#profile = "tobi"
profile = "tobi"
}

#profile = var.profile

0 comments on commit c1b1887

Please sign in to comment.