peer-base / peer-pad

📝 Online editor providing collaborative editing in really real-time using CRDTs and IPFS.
https://peerpad.net
MIT License
678 stars 58 forks source link

tetris_game #339

Open aldulaimi83 opened 1 year ago

aldulaimi83 commented 1 year ago

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 commented 1 year ago

I can't configure the sg to allow http