Skip to content
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

tetris_game #339

Open
aldulaimi83 opened this issue Nov 3, 2023 · 1 comment
Open

tetris_game #339

aldulaimi83 opened this issue Nov 3, 2023 · 1 comment

Comments

@aldulaimi83
Copy link

Define security group, VPC, and other necessary resources here

resource "aws_security_group" "tetris_game_sg" {
name = "tetris-game-sg"
description = "Security group for the Tetris game"

vpc_id = "vpc-" # Replace with your VPC ID

ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"] # Allow traffic from anywhere (0.0.0.0/0). You can restrict this to specific IPs if needed.
}
}

resource "aws_instance" "tetris_game_instance" {
ami = "ami-0fa399d9c130ec923" # Replace with the desired AMI ID
instance_type = "t2.micro" # Choose an appropriate instance type

tags = {
Name = "tetris-game-instance"
}

security_groups = [aws_security_group.tetris_game_sg.name]

user_data = <<-EOF
#!/bin/bash
yum update -y
yum install -y httpd

          # Configure and start the Apache web server
          systemctl start httpd
          systemctl enable httpd

          # Download and deploy the Tetris game code
          git clone https://github.com/yourusername/tetris-game.git /var/www/html

          # Additional configuration for your game (e.g., database setup, environment variables, etc.)
          # ...

          # Restart Apache to apply changes
          systemctl restart httpd
          EOF

}

Define other necessary resources and configuration as needed

@aldulaimi83
Copy link
Author

I can't configure the sg to allow http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant