This will create all needed resources, including an S3 bucket to persist the game state. If you subsequently use terraform destroy the S3 bucket will not be destroyed as it will not be empty. You can choose to delete the bucket yourself with aws s3 rb s3://bucket-name --force or keep the game for future play. If the latter, add the bucket as bucket_name in your module call, for example:
Allow these CIDR blocks to the server - default is the Universe
0.0.0.0/0
ami
AMI to use for the instance, tested with Ubuntu and Amazon Linux 2 LTS
latest Ubuntu
associate_public_ip_address
Toggle public IP
true
bucket_name
Bucket name for persisting minecraft world
generated name
environment
Environment (for tags)
prod
instance_type
EC2 instance type/size
t2.medium (NOTE: NOT free tier!)
java_ms_mem
Java initial and minimum heap size
2G
java_mx_mem
Java maximum heap size
2G
key_name
EC2 key name for provisioning and access
generated
name
Name to use for servers, tags, etc (e.g. minecraft)
mc
namespace
Namespace, which could be your organization name or abbreviation (for tags)
games
mc_backup_freq
How often (mins) to sync to S3
5
mc_port
TCP port for minecraft. If you change this from the default, you also need to manually edit the minecraft server.properties file in S3 and/or EC2 instannce after the build. (todo: install custom server.properties)
25565
mc_root
Where to install minecraft
/home/minecraft
mc_version
Which version of minecraft to install
latest
subnet_id
VPC subnet id to place the instance
chosen from default VPC
tags
Any extra tags to assign to objects
{}
vpc_id
VPC for security group
default VPC
Outputs
Name
Description
ec2_instance_profile
EC2 instance profile
id
EC2 instance ID
private_key
The private key data in PEM format
public_ip
Instance public IP
public_key
The public key data in PEM format
public_key_openssh
The public key data in OpenSSH authorized_keys format
请发表评论