Deployment Using CDK Code

Version 1.1 by Sanchita Singh on 2021/08/10

Overview

Another method you can use to deploy XWiki in your AWS account is by using the CDK code. AWS CDK or Cloud Development Kit is used in order to provision resources inside an AWS Account without the hassle of creating them manually and helps to lock down on configurations required for provisioning those resources so as to maintain consistency across various stages and installs. With CDK we can write infrastructure as code in languages like typescript, python, java, .NET. If you prefer to install your XWiki instance in a couple of clicks from the console we recommend you to use Cloudformation template given above. But if you are a fan of AWS CLI and/or want to tweak the configuration according to your needs you can use the CDK code. You'll need basic programming knowledge if you want to tweak configuration according to you. But you can do it in CDK code in a much easier way as compared to cloudformation template.

Deployment Steps Using CDK Code

Deployment Options

Here, we provide two different types of installation one demo/test installation and another one the production installation. Demo installation Provides a built-in XWiki, with a portable database (HSQLDB) and a lightweight Java container (Jetty). This standalone distribution is not recommended in a production environment. If you need to use it on a production basis, you may look at the other option. With that there is an obvious choice of version of XWiki, we recommend these two options though you can install a specific version of your choice.

  • 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
Warning

Prerequisite: You should have AWS Command Line Interface (CLI) installed and configured. you can refer to this, in case you don't have CLI installed

Warning

Prerequisite: you should be using a root account or atleast an IAM user with root privileges. Otherwise, you might get errors regarding permissions to create resources.

Demo Installation

What You Will Build

Here, you will have an EC2 instance and inside it a built-in XWiki, with a portable database (HSQLDB) and a lightweight Java container (Jetty). You need to simply SSH into the EC2 instance and start XWiki. Follow the step-by-step instruction to do so.

Warning

This installation is not to use in production. This is only for Demo purposes 

Deploying Demo XWiki

  • First step would be to make a key in the AWS console with a name test. to do so, follow this guide. make sure to keep the name of your key-pair "test".
  • Clone the repo https://github.com/xwiki-contrib/aws
  • {{code language="bash"}}git clone https://github.com/xwiki-contrib/aws.git{{/code}}
  • Navigate into the clone Diretory
    cd aws
  • Navigate into the Demo Diretory
    cd xwiki-demo-cdk
  • Install all needed packages locally
    npm install
  • Execute the deployment, and wait for the process to get complete.
    cdk deploy
  • You have an EC2 instance with XWiki demo installed. Now to start the server, SSH into the newly created instance
    and start xwiki.
  • For starting XWiki, go into the folder
    cd xwikihome && cd xwiki-platform-distribution-flavor-jetty-hsqldb-13.1 
  • run start_xwiki.sh
    chmod +x ./start_xwiki.sh && ./start_xwiki.sh
  • Now, to connect to XWiki you need to go to port 8080 of public Ip address. 

Get Connected