Skip to content

Commit ff11d17

Browse files
authored
Merge pull request #1 from oracle-devrel/develop
Develop
2 parents 5b4fb68 + 609ca99 commit ff11d17

29 files changed

+2495
-14
lines changed

README.md

Lines changed: 85 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,96 @@
11
# terraform-oci-arch-joomla
22

3-
[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green) [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=oracle-devrel_terraform-oci-arch-joomla)](https://sonarcloud.io/dashboard?id=oracle-devrel_terraform-oci-arch-joomla)
3+
This is Terraform module that deploys [Joomla](https://www.joomla.org/) on [Oracle Cloud Infrastructure (OCI)](https://cloud.oracle.com/en_US/cloud-infrastructure).
44

5-
## THIS IS A NEW, BLANK REPO THAT IS NOT READY FOR USE YET. PLEASE CHECK BACK SOON!
5+
## About
6+
Deploy Joomla on Oracle Cloud Intrastructure (OCI) and MySQL Database Service (MDS) using this Terraform module.
67

7-
## Introduction
8-
MISSING
8+
## Prerequisites
9+
1. Download and install Terraform (v1.0 or later)
10+
2. Download and install the OCI Terraform Provider (v4.4.0 or later)
11+
3. Export OCI credentials. (this refer to the https://github.com/oracle/terraform-provider-oci )
912

10-
## Getting Started
11-
MISSING
1213

13-
### Prerequisites
14-
MISSING
14+
## What's a Module?
15+
A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such as a database or server cluster. Each Module is created using Terraform, and includes automated tests, examples, and documentation. It is maintained both by the open source community and companies that provide commercial support.
16+
Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself, you can leverage the work of the Module community to pick up infrastructure improvements through a version number bump.
1517

16-
## Notes/Issues
17-
MISSING
18+
## How to use this Module
19+
This Module has the following folder structure:
20+
* [root](): This folder contains a root module.
21+
* [examples](examples): This folder contains examples of how to use the module:
22+
- [Joomla single-node + custom network injected into module](examples/joomla-single-mds-use-existing-network): This is an example of how to use the oci-arch-joomla module to deploy Joomla (single-node) with MDS and network cloud infrastrucutre elements injected into the module.
23+
- [Joomla multi-node + custom network injected into module](examples/joomla-ha-mds-use-existing-network): This is an example of how to use the oci-arch-joomla module to deploy Joomla HA (multi-node) with MDS and network cloud infrastrucutre elements injected into the module.
24+
25+
To deploy Joomla using this Module with minimal effort use this:
1826

19-
## URLs
20-
* Nothing at this time
27+
```hcl
28+
module "oci-arch-joomla" {
29+
source = "github.com/oracle-devrel/terraform-oci-arch-joomla"
30+
tenancy_ocid = "<tenancy_ocid>"
31+
vcn_id = "<vcn_id>"
32+
numberOfNodes = 1
33+
availability_domain_name = "<availability_domain_name>"
34+
compartment_ocid = "<compartment_ocid>""
35+
image_id = "<image_id>"
36+
shape = "<shape>"
37+
flex_shape_ocpus = "<flex_shape_ocpus>"
38+
flex_shape_memory = "<flex_shape_memory>"
39+
label_prefix = "<label_prefix>""
40+
ssh_authorized_keys = "<ssh_public_key>"
41+
mds_ip = "<mysql_server_ip_address>"
42+
joomla_subnet_id = "<joomla_subnet_id>"
43+
admin_password = "<admin_password>"
44+
admin_username = "<admin_username>"
45+
joomla_schema = "<joomla_schema>"
46+
joomla_name = "<joomla_name>"
47+
joomla_password = "<joomla_password>"
48+
joomla_console_user = "<joomla_console_user>"
49+
joomla_console_password = "<joomla_console_password>"
50+
joomla_console_email = "<joomla_console_email>"
51+
display_name = "<joomla_instance_name>"
52+
}
53+
```
54+
55+
Argument | Description
56+
--- | ---
57+
compartment_ocid | Compartment's OCID where joomla will be created
58+
use_existing_vcn | If you want to inject already exisitng VCN then you need to set the value to TRUE.
59+
vcn_cidr | If use_existing_vcn is set to FALSE then you can define VCN CIDR block and then it will used to create VCN within the module.
60+
vcn_id | If use_existing_vcn is set to TRUE then you can pass VCN OCID and module will use it to create joomla installation.
61+
numberOfNodes | If you need HA configuration with LB and FSS then set the value to 2 or more.
62+
joomla_subnet_id | The OCID of the joomla public (single node) and private (multi node) subnet access.
63+
lb_subnet_id | If numberOfNodes set to 2 or more then you can provide OCID of the Load Balancer subnet.
64+
bastion_subnet_id | If numberOfNodes set to 2 or more then you can use OCID of the Bastion subnet.
65+
fss_subnet_id | If numberOfNodes set to 2 or more then you can use OCID of the File Storage Service subnet.
66+
availability_domain_name | The Availability Domain for deployment.
67+
display_name | The name of the joomla instance.
68+
shape | Instance shape to use for joomla node.
69+
flex_shape_ocpus | If shape is set to Flex shape then you can define Flex Shape OCPUs.
70+
flex_shape_memory | If shape is set to Flex shape then you can define Flex Shape Memory (GB).
71+
lb_shape | If numberOfNodes set to 2 or more then you can define Load Balancer shape
72+
flex_lb_min_shape | If numberOfNodes set to 2 or more and lb_shape=flexible then you can define Load Balancer minimum shape.
73+
flex_lb_max_shape | If numberOfNodes set to 2 or more and lb_shape=flexible then you can define Load Balancer maximum shape.
74+
use_bastion_service | If you want to use OCI Bastion Service then you need to set the value to TRUE.
75+
bastion_service_region | If use_bastion_service is set to TRUE then you can define bastion service region.
76+
bastion_image_id | If use_bastion_service is set to FALSE then you can define Bastion VM image id.
77+
bastion_shape | If use_bastion_service is set to FALSE then you can define Bastion VM shape.
78+
bastion_flex_shape_ocpus | If use_bastion_service is set to FALSE and bastion_shape is using Flex shapes then you can define Flex Shape OCPUs.
79+
bastion_flex_shape_memory | If use_bastion_service is set to FALSE and bastion_shape is using Flex shapes then you can define Flex Shape Memory (GB).
80+
use_shared_storage | If numberOfNodes set to 2 or more then you can use shared NFS on OCI FSS (value TRUE). If you want to replicate joomla by yourself (for example with rsync) then you can you can set the value to FALSE.
81+
joomla_shared_working_dir | If numberOfNodes set to 2 or more then you can define shared mountpoint name.
82+
label_prefix | To create unique identifier for multiple clusters in a compartment.
83+
joomla_name | Joomla Database User Name for MySQL Server.
84+
joomla_schema | Joomla Database User Schema for MySQL Server.
85+
joomla_password | Joomla Database User Password for MySQL Server.
86+
joomla_prefix | Joomla MySQL Prefix for tables (for example joomla_).
87+
joomla_console_user | Joomla Console User.
88+
joomla_console_password | Joomla Console Password.
89+
joomla_console_email | Joomla Console E-mail.
90+
admin_username | Admin User Name for MySQL Server.
91+
admin_password | Admin User Password for MySQL Server.
92+
mds_ip | Private IP of the MySQL Server.
93+
defined_tags | Defined tags to be added to compute instances.
2194

2295
## Contributing
2396
This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.
@@ -28,5 +101,3 @@ Copyright (c) 2022 Oracle and/or its affiliates.
28101
Licensed under the Universal Permissive License (UPL), Version 1.0.
29102

30103
See [LICENSE](LICENSE) for more details.
31-
32-
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2022 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Create Joomla multi-node + custom network injected into module
2+
This is an example of how to use the oci-arch-joomla module to deploy Joomla HA (multi-node) with MDS and network cloud infrastrucutre elements injected into the module..
3+
4+
### Using this example
5+
Update terraform.tfvars with the required information.
6+
7+
### Deploy the Joomla
8+
Initialize Terraform:
9+
```
10+
$ terraform init
11+
```
12+
View what Terraform plans do before actually doing it:
13+
```
14+
$ terraform plan
15+
```
16+
Use Terraform to Provision resources:
17+
```
18+
$ terraform apply
19+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
## Copyright (c) 2022 Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
data "oci_core_images" "InstanceImageOCID" {
5+
compartment_id = var.compartment_ocid
6+
operating_system = var.instance_os
7+
operating_system_version = var.linux_os_version
8+
shape = var.node_shape
9+
10+
filter {
11+
name = "display_name"
12+
values = ["^.*Oracle[^G]*$"]
13+
regex = true
14+
}
15+
}
16+
17+
data "oci_core_images" "InstanceImageOCID2" {
18+
compartment_id = var.compartment_ocid
19+
operating_system = var.instance_os
20+
operating_system_version = var.linux_os_version
21+
shape = var.bastion_shape
22+
23+
filter {
24+
name = "display_name"
25+
values = ["^.*Oracle[^G]*$"]
26+
regex = true
27+
}
28+
}
29+
30+
data "oci_mysql_mysql_configurations" "shape" {
31+
compartment_id = var.compartment_ocid
32+
type = ["DEFAULT"]
33+
shape_name = var.mysql_shape
34+
}
35+
36+
data "oci_identity_region_subscriptions" "home_region_subscriptions" {
37+
tenancy_id = var.tenancy_ocid
38+
39+
filter {
40+
name = "is_home_region"
41+
values = [true]
42+
}
43+
}
44+
45+
data "oci_identity_availability_domains" "ADs" {
46+
compartment_id = var.tenancy_ocid
47+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Copyright (c) 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
module "joomla" {
5+
#source = "github.com/oracle-devrel/terraform-oci-arch-joomla"
6+
source = "../../"
7+
tenancy_ocid = var.tenancy_ocid
8+
vcn_id = oci_core_virtual_network.joomla_mds_vcn.id
9+
numberOfNodes = 2
10+
availability_domain_name = var.availability_domain_name == "" ? lookup(data.oci_identity_availability_domains.ADs.availability_domains[0], "name") : var.availability_domain_name
11+
compartment_ocid = var.compartment_ocid
12+
image_id = lookup(data.oci_core_images.InstanceImageOCID.images[0], "id")
13+
shape = var.node_shape
14+
label_prefix = var.label_prefix
15+
ssh_authorized_keys = var.ssh_public_key
16+
mds_ip = module.mds-instance.mysql_db_system.ip_address
17+
joomla_subnet_id = oci_core_subnet.joomla_subnet.id
18+
lb_subnet_id = oci_core_subnet.lb_subnet_public.id
19+
bastion_subnet_id = oci_core_subnet.bastion_subnet_public.id
20+
fss_subnet_id = oci_core_subnet.fss_subnet_private.id
21+
admin_password = var.admin_password
22+
admin_username = var.admin_username
23+
joomla_schema = var.joomla_schema
24+
joomla_name = var.joomla_name
25+
joomla_password = var.joomla_password
26+
display_name = var.joomla_instance_name
27+
joomla_console_user = var.joomla_console_user
28+
joomla_console_password = var.joomla_console_password
29+
joomla_console_email = var.joomla_console_email
30+
flex_shape_ocpus = var.node_flex_shape_ocpus
31+
flex_shape_memory = var.node_flex_shape_memory
32+
lb_shape = var.lb_shape
33+
flex_lb_min_shape = var.flex_lb_min_shape
34+
flex_lb_max_shape = var.flex_lb_max_shape
35+
use_bastion_service = var.use_bastion_service
36+
bastion_image_id = lookup(data.oci_core_images.InstanceImageOCID2.images[0], "id")
37+
bastion_shape = var.bastion_shape
38+
bastion_flex_shape_ocpus = var.bastion_flex_shape_ocpus
39+
bastion_flex_shape_memory = var.bastion_flex_shape_memory
40+
bastion_service_region = var.region
41+
}
42+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Copyright (c) 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
module "mds-instance" {
5+
source = "github.com/oracle-devrel/terraform-oci-cloudbricks-mysql-database?ref=v1.0.4.1"
6+
tenancy_ocid = var.tenancy_ocid
7+
region = var.region
8+
mysql_instance_compartment_ocid = var.compartment_ocid
9+
mysql_network_compartment_ocid = var.compartment_ocid
10+
subnet_id = oci_core_subnet.mds_subnet_private.id
11+
mysql_db_system_admin_username = var.admin_username
12+
mysql_db_system_admin_password = var.admin_password
13+
mysql_db_system_availability_domain = var.availability_domain_name == "" ? lookup(data.oci_identity_availability_domains.ADs.availability_domains[0], "name") : var.availability_domain_name
14+
mysql_shape_name = var.mysql_shape
15+
mysql_db_system_data_storage_size_in_gb = var.mysql_db_system_data_storage_size_in_gb
16+
mysql_db_system_description = var.mysql_db_system_description
17+
mysql_db_system_display_name = var.mysql_db_system_display_name
18+
mysql_db_system_fault_domain = var.mysql_db_system_fault_domain
19+
mysql_db_system_hostname_label = var.mysql_db_system_hostname_label
20+
mysql_db_system_is_highly_available = var.mysql_is_highly_available
21+
mysql_db_system_maintenance_window_start_time = var.mysql_db_system_maintenance_window_start_time
22+
}

0 commit comments

Comments
 (0)