Wiki source code of Deployment Using CDK Code
Version 1.1 by Sanchita Singh on 2021/08/10
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Overview = | ||
2 | |||
3 | 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. | ||
4 | |||
5 | = Deployment Steps Using CDK Code = | ||
6 | |||
7 | == Deployment Options == | ||
8 | |||
9 | 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. | ||
10 | |||
11 | * 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. | ||
12 | * 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 | ||
13 | |||
14 | {{warning}} | ||
15 | **Prerequisite**: You should have AWS Command Line Interface (CLI) installed and configured. you can refer to [[this>>url:https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html]], in case you don't have CLI installed | ||
16 | {{/warning}} | ||
17 | |||
18 | {{warning}} | ||
19 | **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. | ||
20 | {{/warning}} | ||
21 | |||
22 | == Demo Installation == | ||
23 | |||
24 | === What You Will Build === | ||
25 | |||
26 | 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. | ||
27 | |||
28 | {{warning}} | ||
29 | This installation is not to use in production. This is only for Demo purposes | ||
30 | {{/warning}} | ||
31 | |||
32 | === Deploying Demo XWiki === | ||
33 | |||
34 | * First step would be to make a key in the AWS console with a name test. to do so, follow [[this>>url:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#having-ec2-create-your-key-pair]] guide. make sure to keep the name of your key-pair "test". | ||
35 | * Clone the repo [[https:~~/~~/github.com/xwiki-contrib/aw>>url:https://github.com/xwiki-contrib/aws]]s | ||
36 | * ~{~{code language="bash"}}git clone https:~/~/github.com/xwiki-contrib/aws.git~{~{/code}} | ||
37 | * Navigate into the clone Diretory | ||
38 | cd aws | ||
39 | * Navigate into the Demo Diretory | ||
40 | cd xwiki-demo-cdk | ||
41 | * Install all needed packages locally | ||
42 | npm install | ||
43 | * Execute the deployment, and wait for the process to get complete. | ||
44 | cdk deploy | ||
45 | * You have an EC2 instance with XWiki demo installed. Now to start the server, SSH into the newly created instance | ||
46 | and start xwiki. | ||
47 | * For starting XWiki, go into the folder | ||
48 | cd xwikihome && cd xwiki-platform-distribution-flavor-jetty-hsqldb-13.1 | ||
49 | * run start_xwiki.sh | ||
50 | chmod +x ./start_xwiki.sh && ./start_xwiki.sh | ||
51 | * Now, to connect to XWiki you need to go to port 8080 of public Ip address. |