Deployment Using CloudFormation Template
Last modified by Vincent Massol on 2021/08/26
Contents
What You Will Build
Using this CloudFormation Template you'll be provisioning these resources in your AWS account.
- A virtual private cloud (VPC) that is configured across two Availability Zones. For each Availability Zone, this template provisions one public subnet and one private subnet, according to AWS best practices.
- In the public subnets, managed network address translation (NAT) gateways to provide outbound internet connectivity for instances in the private subnets.
- In the private subnets, Amazon Elastic File System(EFS), which provides simple, scalable file storage for XWiki files, Amazon Aurora database instances running MySQL and Elastic Container Service(ECS) fargate service.
- An AWS Loadbalancer, which you will connect to using the DNS provided at the end of the installation.
- An AWS Identity and Access Management (IAM) role to enable AWS resources created through the template to access other AWS resources when required.
Deployment Options
The CloudFormation Template and CDK will install XWiki with MySQL. You can choose which of the following versions to deploy of XWiki.
- Long-term support: This version is the latest stable version from the last XWiki cycle. This is the most stable version and is recommended to use in production.
- Stable: This version is the latest stable version from the current XWiki cycle. This is the version recommended if you wish to try out the new features from the cycle.
Note: you can also choose a specific version other than mentioned above. But it is not recommended.
Prepare AWS Account
- One of the obvious requirements is having an AWS account, So if you don’t have one already, you can create one by following the on-screen instructions. When you create an AWS account, AWS automatically sign-up for all the services including the ones we are gonna use for XWiki. You are charged only for the services that you use and only for the time period you use them.
IMPORTANT: make sure you are using root user otherwise you can get errors related to permissions regarding resource creation. - We will be creating a virtual private cloud (VPC) for deploying the XWiki in. The default quota for the number of max VPCs in a region is 5. But you can extend them up to 100. So, if there are already 5 VPCs in the region you are deploying the instance, request for a quota increase. It can take a few days for the new service quota to become effective.
- Now, Select the region (on the top right) you want to deploy XWiki in from the navigation bar.Consider choosing a region closest to your data center or corporate network to reduce network latency between systems running on AWS and the systems and users on your corporate network
Launching The CloudFormation Template
- Download the CloudFormation Template file to use.
- After logging in to your AWS account, click on this link https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/template
- Select “Template is ready”, for the prepare template option.
- For, Specify template, Select the "Upload a template file" and upload the template file you just downloaded
- Type the name you want to give your stack. For example XWiki.
- For the Parameters, you need to give the docker name for the XWiki version you want to install. If you want to install a Stable version type xwiki:stable-mysql-tomcat or else if you want long-term-support (LTS) version, type xwiki:lts-mysql-tomcat. For more information on what stable and LTS is, refer to deployment option section. The click on NEXT
- Add tags if you want to, Will make it easier to manage, search for, and filter resources
- Leave other options on the page as default (or you can configure specifics if you want) and click NEXT
- Make sure to select the check-box for acknowledging that AWS CloudFormation might create IAM resources. And click on CREATE STACK
- Monitor the status of the stack. When the status is CREATE_COMPLETE, Check the "OUTPUT" tab for the loadbalancer DNS. Connect to the DNS to configure your newly hosted XWiki. For more information about XWiki and how to configure it, refer to official documentation
Github Repository
You can visit the GitHub repository to download the CloudFormation Template code for this deployment, to modify it for your needs and to post your comments.
Troubleshooting
- If during stack creation your stack is getting rollbacked, check the EVENT tab, there you can the reason due to which some of the resources couldn’t get provisioned. One of the possible errors that you can get is ‘ResourceLimitExceeded’. You get this error when ther resource you are trying to create already reached it quota limit. But you can request to increase the quota in your AWS account. It can take a few days for the new service quota to become effective. For more details on how to request quota increase, refer to, https://aws.amazon.com/premiumsupport/knowledge-center/resourcelimitexceeded-sagemaker/
- When after filling the details you click on CREATE STACK, On the top of the screen an error might flash saying any “Unrecognised Resources”. You are getting this error because you are creating the stack in a region where not all the resources needed are available. To solve this change the region to some other nearest region to your center.