This set of Templates provide all the components to deploy a single Gerrit master in ECS
Two templates are provided in this example:
cf-cluster
: define the ECS cluster and the networking stackcf-service
: defined the service stack running Gerriterror_log
is exported in a Log Group in CloudWatchaws ec2 create-key-pair --key-name gerrit-cluster-keys
NOTE: the EC2 key pair are useful when you need to connect to the EC2 instances for troubleshooting purposes. Store them in a pem
file to use when ssh-ing into your instances as follow: ssh -i yourKeyPairs.pem <ec2_instance_ip>
aws cloudformation create-stack \ --stack-name gerrit-cluster \ --capabilities CAPABILITY_IAM \ --template-body file://<full_path_to_the_template>/aws-gerrit/single-master/cf-cluster.yml
aws cloudformation create-stack \ --stack-name gerrit-service \ --capabilities CAPABILITY_NAMED_IAM \ --template-body file://<full_path_to_the_template>/aws-gerrit/single-master/cf-service.yml \ --parameters ParameterKey=ClusterStackName,ParameterValue=gerrit-cluster
NOTE: the ClusterStackName
value has to be name of the cluster stack created in the previous step (i.e.: gerrit-cluster
in this case)
aws cloudformation delete-stack --stack-name gerrit-cluster ### Wait for the "gerrit-cluster" stack to be deleted aws cloudformation delete-stack --stack-name gerrit-service
You can find the Gerrit public URL by running the following command:
aws cloudformation describe-stacks --stack-name gerrit-service
In the Outputs
section the URL is set in the PublicLoadBalancerUrl
key:
"Outputs": [ { "OutputKey": "PublicLoadBalancerUrl", "OutputValue": "http://gerri-LoadB-1CDG276QVT8K8-e28c5bca2e024135.elb.us-east-2.amazonaws.com", "Description": "The url of the external load balancer", "ExportName": "gerrit-ponch-service:PublicLoadBalancerUrl" } ],
The available ports are 8080
for HTTP and 29418
for SSH