Terraform GitHub Enterprise plan
- Requires:
- AWS (duh!)
- AWS subnet id
- AWS VPC id
- GitHub Enterprise license
- GitHub Enterprise JSON configuration dump file
- Terraform >= 0.6.14
- Chef Server >= 12.x
- Uses a public IP and public DNS
- Creates default security group as follows:
- 22/tcp: SSH
- 122/tcp: Git via SSH
- 443/tcp: HTTPS
- 8443/tcp: HTTPS
- 80/tcp: HTTP
- 8080/tcp: HTTP
- 9418/tcp: GIT
- 1194/udp: VPN
- 123/udp: NTP
- 161/udp: SNMP
- 25/tcp: SMTP
- Understand Terraform and ability to read the source
In your terraform plan:
module "module_name_here" {
source = "github.com/mengesb/tf_ghe_server"
aws_access_key = "<key>"
...
}
- Clone this repo:
git clone https://github.com/mengesb/tf_ghe_server.git - Get dependencies:
terraform get - Generate and poulate a local
terraform.tfvarsto not be prompted for all inputs - Test the plan:
terraform plan - Apply the plan:
terraform apply
GitHub Enterprise deploys on custom Ubuntu images.
These resources will incur charges on your AWS bill. It is your responsibility to delete the resources.
aws_access_key: Your AWS key, usually referred to asAWS_ACCESS_KEY_IDaws_flavor: The AWS instance type. Default:c3.xlargeaws_key_name: The private key pair name on AWS to use (String)aws_private_key_file: The full path to the private kye matchingaws_key_namepublic key on AWSaws_region: AWS region you want to deploy to. Default:us-west-1aws_secret_key: Your secret for your AWS key, usually referred to asAWS_SECRET_ACCESS_KEYaws_subnet_id: The AWS id of the subnet to use. Example:subnet-ffffffffaws_vpc_id: The AWS id of the VPC to use. Example:vpc-ffffffff
allowed_cidrs: The comma seperated list of addresses in CIDR format to allow SSH access. Default:0.0.0.0/0allowed_commit_cidrs: The comma seperated list of addresses in CIDR format to allow GIT over 22/tcp access. Default:0.0.0.0/0chef_env: Chef environment to join upon provisioning. Default:_defaultchef_fqdn: Fully qualified domain name of the Chef Serverchef_org: Short name of the Chef organizationchef_org_validator: Orginazation validator file for Chef organziationchef_orgclient_version: Chef client version. Default:12.8.1domain: Server's basename. Default:localhostghe_license: File for GitHub Enterprise license fileghe_settings: File for GitHub Entperise settingshostname: Server's basename. Default:localdomainlog_to_file: Log chef-client to file. Default:truepublic_ip: Associate public IP to instance. Defaulttrueroot_delete_termination: Delete root device on VM termination. Default:trueroot_volume_size: Size of the root volume in GB. Default:20root_volume_type: Type of root volume. Supportsgp2andstandard. Defaultstandardserver_count: Server count. Default:1; DO NOT CHANGE!sgrule_ntp: Boolean to create security group rule allowing NTP. Default:0sgrule_smtp: Boolean to create security group rule allowing SMTP. Default:0sgrule_snmp: Boolean to create security group rule allowing SNMP. Default:0tag_description: Text field tag 'Description'
The below mapping variables construct selection criteria
ami_map: AMI selection map comprised ofaws_regionandghe_versionami_user: Default username for GHE isadmin
ami_map.<aws_region>-<ghe_version> = "value"
Variable ghe_version should be one of the following:
- 2.6.x (default; 2.6.0 - current)
- 2.5.x (2.5.0 - 2.5.8)
Please refer to the GitHub Enterprise Releases page for a list of current releases
Variable aws_region should be one of the following:
- us-east-1
- us-west-2
- us-west-1 (default)
- eu-central-1
- eu-west-1
- ap-southeast-1
- ap-southeast-2
- ap-northeast-1
- ap-northeast-2
- sa-east-1
- Custom (must be an AWS region, requires setting
ami_mapand setting AMI value)
Map ami_usermap uses ami_os to look the default username for interracting with the instance. To override this pre-declared user, define
ami_usermap.<ami_os> = "value"
credentials: Formatted text output with details about this instancefqdn: The fully qualified domain name of the serverprivate_ip: The private IP address of the instancepublic_ip: The public IP address of the instancesecurity_group_id: The AWS security group id for this instance
Example runtime not yet available
Please understand that this is a work in progress and is subject to change rapidly. Please be sure to keep up to date with the repo should you fork, and feel free to contact me regarding development and suggested direction
Please refer to the CHANGELOG.md
This is licensed under the Apache 2.0 license.