Skip to content

Commit

Permalink
#39: Update cloudformation templates (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada authored Sep 30, 2024
1 parent 85f7718 commit 19330f2
Show file tree
Hide file tree
Showing 16 changed files with 2,312 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install tflint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: v0.50.3
tflint_version: v0.53.0

- name: Log Terraform version
run: |
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ terraform.tfstate
*.iml
venv/
.DS_Store
.terraform.lock.hcl
# This is ignored because lock files are only relevant when the Terraform template is used
/.terraform.lock.hcl
/lambda-test
/test/simple_exasol_setup/exasol_xmlrpc_polling.log
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module "exasol" {
cluster_name = "exasol-cluster"
database_name = "exadb"
ami_image_name = "R6.2.3-PAYG"
ami_image_name = "Exasol-R7.1.26-PAYG"
sys_user_password = "eXaSol1337DB"
admin_user_password = "eXaSol1337OP"
management_server_instance_type = "m5.xlarge"
Expand Down Expand Up @@ -148,14 +148,13 @@ The following configuration variables are available.
| `cluster_name` | `exasol-cluster` | A name for the to be deployed cluster. |
| `database_name` | `exadb` | A name of the Exasol database. |
| `ami_image_id` | `null` | An Exasol release AMI image id, e.g, `ami-05fad9f0c2609cef0`. |
| `ami_image_name` | _<none>_ | An Exasol release AMI image name, e.g, `R6.1.5-PAYG` or `R6.2.1-BYOL`. |
| `ami_image_name` | _<none>_ | An Exasol release AMI image name, e.g, `Exasol-R7.1.26-PAYG`. |
| `sys_user_password` | _<none>_ | An Exasol database `sys` user password. |
| `admin_user_password` | _<none>_ | An EXAOperation `admin` user password. |
| `management_server_instance_type` | `m5.large` | An EC2 instance type for management server. |
| `datanode_instance_type` | `m5.xlarge` | An EC2 instance type for Exasol datanodes. |
| `datanode_count` | `3` | The number of Exasol datanodes. |
| `standbynode_count` | `0` | The number of Exasol standby nodes. |
| `license` | `null` | An optional path for the Bring Your Own (BYOL) image license file, e.g, `./mor_byol_license.xml`. |
| `public_ip` | `true` | A boolean variable whether to set public IPv4 address to nodes. Skips waiting if set to `false`. |
| `key_pair_name` | _<none>_ | An EC2 key pair name to attach to nodes. |
| `subnet_id` | _<none>_ | A subnet id to deploy the Exasol cluster. |
Expand Down
1 change: 1 addition & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* [2.0.0](changes_2.0.0.md)
* [1.0.4](changes_1.0.4.md)
* [1.0.3](changes_1.0.3.md)
* [1.0.2](changes_1.0.2.md)
Expand Down
15 changes: 15 additions & 0 deletions doc/changes/changes_2.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# terraform-aws-exasol 2.0.0, released 2024-09-30

Code name: Update CloudFormation template and new DB version

## Summary

This release updates the NodeJS version for Lambdas used by the CloudFormation template during deployment to 20.x.

### Breaking Change

The "Bring your Own License" (BYOL) AMI images are deprecated and not available any more. Specifying your own license file is not possible any more. Please use the "Pay as you go" (PAYG) AMI images, e.g. `Exasol-R7.1.26-PAYG`.

## Bug Fixes

- #39: Fixed nodejs version in CF template
11 changes: 8 additions & 3 deletions doc/developers_guide/developers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

1. Make a copy of the latest template in `scripts` for the new version
2. Update the new template
3. Upload the template to S3 bucket `exasol-cf-templates` in region `eu-central-1` (prod account)
3. Upload the template to S3 bucket `exasol-cf-templates` in region `eu-central-1` (prod account) and enable public read access:
```sh
version=v2.0.0
aws s3 cp scripts/cloudformation_template_${version}.yml s3://exasol-cf-templates/cloudformation_template_${version}.yml
aws s3api put-object-acl --bucket exasol-cf-templates --key cloudformation_template_${version}.yml --acl public-read
```


## CI Tests

Expand All @@ -23,9 +29,8 @@ System tests for deploying the Exasol Terraform module are located in the `test`
### Running System Tests

* Install Terraform and Go
* Get an Exasol license and store it as `test/simple_exasol_setup/exasolution.lic`
* Create the file `test/simple_exasol_setup/terraform.tfvars` and fill in:
```
```properties
owner = "<YOUR_EMAIL>"
aws_profile = "<AWS PROFILE TO USE>"
```
Expand Down
24 changes: 9 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
data "aws_ami" "exasol" {
most_recent = true
owners = [
var.ami_image_owner]
owners = [var.ami_image_owner]

filter {
name = "name"
values = [
"*${var.ami_image_name}-*"]
name = "name"
values = ["*${var.ami_image_name}*"]
}
}

resource "aws_cloudformation_stack" "exasol_cluster" {
name = var.cluster_name
capabilities = [
"CAPABILITY_IAM"]
name = var.cluster_name
capabilities = ["CAPABILITY_IAM"]
on_failure = "DELETE"
template_url = "https://exasol-cf-templates.s3.eu-central-1.amazonaws.com/cloudformation_template_v1.0.4.yml"
template_url = "https://exasol-cf-templates.s3.eu-central-1.amazonaws.com/cloudformation_template_v2.0.0.yml"
parameters = {
DBSystemName = var.database_name
DBPassword = var.sys_user_password
Expand All @@ -34,7 +31,6 @@ resource "aws_cloudformation_stack" "exasol_cluster" {
CreateKMSEndpoint = var.create_kms_endpoint
CreateEC2Endpoint = var.create_ec2_endpoint
OpenPorts = var.open_ports
License = var.license == null ? null : file(var.license)
OwnerTag = var.owner
ProjectTag = var.project
}
Expand All @@ -60,9 +56,8 @@ data "aws_instance" "management_server" {
}

resource "null_resource" "exasol_cluster_wait" {
count = var.public_ip ? 1 : 0
depends_on = [
aws_cloudformation_stack.exasol_cluster]
count = var.public_ip ? 1 : 0
depends_on = [aws_cloudformation_stack.exasol_cluster]

triggers = {
always = uuid()
Expand All @@ -83,6 +78,5 @@ resource "null_resource" "exasol_cluster_wait" {
}

resource "null_resource" "exasol_waited_on" {
depends_on = [
null_resource.exasol_cluster_wait]
depends_on = [null_resource.exasol_cluster_wait]
}
Loading

0 comments on commit 19330f2

Please sign in to comment.