diff --git a/day-14/simple-python-app/app.py b/day-14/simple-python-app/app.py index ed673745b..908e3b87f 100644 --- a/day-14/simple-python-app/app.py +++ b/day-14/simple-python-app/app.py @@ -9,3 +9,4 @@ def hello(): if __name__ == '__main__': app.run() + diff --git a/day-14/simple-python-app/buildspec.yml b/day-14/simple-python-app/buildspec.yml index 8cccdf869..9cbaa8598 100644 --- a/day-14/simple-python-app/buildspec.yml +++ b/day-14/simple-python-app/buildspec.yml @@ -12,11 +12,11 @@ phases: pre_build: commands: - echo "Installing dependencies..." - - pip install -r day-13/simple-python-app/requirements.txt + - pip install -r day-14/simple-python-app/requirements.txt build: commands: - echo "Running tests..." - - cd day-13/simple-python-app/ + - cd day-14/simple-python-app/ - echo "Building Docker image..." - echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USERNAME" --password-stdin "$DOCKER_REGISTRY_URL" - docker build -t "$DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/simple-python-flask-app:latest" . @@ -26,6 +26,8 @@ phases: - echo "Build completed successfully!" artifacts: files: + - ../../appspec.yml + - ../../scripts/**/* - '**/*' - base-directory: ../simple-python-app + base-directory: . diff --git a/day-24/main.tf b/day-24/main.tf index 2a466c1ca..e470c78f2 100644 --- a/day-24/main.tf +++ b/day-24/main.tf @@ -71,24 +71,24 @@ resource "aws_security_group" "webSg" { } resource "aws_s3_bucket" "example" { - bucket = "abhisheksterraform2023project" + bucket = "dineshudaysterraform2025project" } resource "aws_instance" "webserver1" { - ami = "ami-0261755bbcb8c4a84" + ami = "ami-0360c520857e3138f" instance_type = "t2.micro" vpc_security_group_ids = [aws_security_group.webSg.id] subnet_id = aws_subnet.sub1.id - user_data = base64encode(file("userdata.sh")) + user_data_base64 = base64encode(file("userdata.sh")) } resource "aws_instance" "webserver2" { - ami = "ami-0261755bbcb8c4a84" + ami = "ami-0360c520857e3138f" instance_type = "t2.micro" vpc_security_group_ids = [aws_security_group.webSg.id] subnet_id = aws_subnet.sub2.id - user_data = base64encode(file("userdata1.sh")) + user_data_base64 = base64encode(file("userdata1.sh")) } #create alb @@ -138,8 +138,4 @@ resource "aws_lb_listener" "listener" { target_group_arn = aws_lb_target_group.tg.arn type = "forward" } -} - -output "loadbalancerdns" { - value = aws_lb.myalb.dns_name } \ No newline at end of file diff --git a/day-24/outputs.tf b/day-24/outputs.tf new file mode 100644 index 000000000..ed645e076 --- /dev/null +++ b/day-24/outputs.tf @@ -0,0 +1,4 @@ +output "loadbalancerdns" { + description = "DNS of Load Balancer" + value = aws_lb.myalb.dns_name +} \ No newline at end of file diff --git a/day-24/provider.tf b/day-24/provider.tf index ce9a20ca8..5b99ab481 100644 --- a/day-24/provider.tf +++ b/day-24/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "5.11.0" + version = "6.18.0" } } } diff --git a/scripts/start_container.sh b/scripts/start_container.sh index c7617d846..c25e07a52 100644 --- a/scripts/start_container.sh +++ b/scripts/start_container.sh @@ -2,7 +2,8 @@ set -e # Pull the Docker image from Docker Hub -docker pull abhishekf5/simple-python-flask-app +docker pull dineshuday/simple-python-flask-app # Run the Docker image as a container -docker run -d -p 5000:5000 abhishekf5/simple-python-flask-app +docker run -d -p 5000:5000 dineshuday/simple-python-flask-app +