-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
output "instance_id" { | ||
value = aws_instance.main.id | ||
} | ||
|
||
output "instance_public_ip" { | ||
value = aws_instance.main.public_ip | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
output "instance_id" { | ||
value = module.ec2.instance_id | ||
} | ||
output "instance_public_ip" { | ||
value = module.ec2.instance_public_ip | ||
} |
26 changes: 26 additions & 0 deletions
26
tf-ec2-with-modules/terraform-project/scripts/install-jenkins.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Update the package index | ||
sudo yum update -y | ||
|
||
# Install Java 11 (required for Jenkins) | ||
sudo amazon-linux-extras install java-openjdk11 -y | ||
|
||
# Enable the Jenkins repository | ||
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo | ||
|
||
# Import the Jenkins package signing key | ||
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key | ||
|
||
# Install Jenkins | ||
sudo yum install jenkins -y | ||
|
||
# Start the Jenkins service | ||
sudo systemctl start jenkins | ||
|
||
# Enable Jenkins to start on system boot | ||
sudo systemctl enable jenkins | ||
|
||
# Print the Jenkins initial admin password | ||
echo "Jenkins initial admin password:" | ||
sudo cat /var/lib/jenkins/secrets/initialAdminPassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters