Skip to content

Commit

Permalink
Documentation improvements (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma authored Feb 23, 2024
1 parent 6a74fb1 commit 10564d8
Show file tree
Hide file tree
Showing 37 changed files with 515 additions and 41 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/prep-internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
name: Prep release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"

- name: Checkout the code
uses: actions/checkout@v2

Expand All @@ -30,6 +35,13 @@ jobs:
run: |
find . -type d -print0 | xargs -0 -n1 terraform fmt
- name: Setup test broker
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--env system_scaling_maxconnectioncount="1000" --mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:latest
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Check code builds and pass acceptance test
run: |
ci/scripts/test-module.sh ci/module-test
Expand All @@ -40,6 +52,12 @@ jobs:
VERSION=$(echo "${{ github.event.inputs.release_branch_name }}" | cut -d'v' -f2)
echo $VERSION > VERSION
- name: Add copyright headers where needed
run: |
go install github.com/google/addlicense@latest
addlicense -c 'Solace Corporation. All rights reserved.' -v -l apache ./*.tf
addlicense -c 'Solace Corporation. All rights reserved.' -v -l apache $(find ./examples -name "*.tf" -type f -print0 | xargs -0)
- name: Check changed files
uses: tj-actions/verify-changed-files@v17
id: check-changed-files
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/verify-registry-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Launched manually to test new release from registry
on:
workflow_dispatch:
inputs:
release_version:
description: 'The version of the release in the Terraform registry (expecting semver format)'
required: true
default: '0.1.0-rc.1'
public_release:
type: boolean
description: 'Check if this is a public release (from registry.terraform.io). Private release is from app.terraform.io'
required: true
default: false

jobs:
build:
name: Verify registry release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v4

- name: Setup test broker
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.6.1.52"
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Set up Terraform latest - public
if: ${{ github.event.inputs.public_release != 'false' }}
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: true

- name: Set up Terraform latest - private, with token
if: ${{ github.event.inputs.public_release == 'false' }}
uses: hashicorp/setup-terraform@v3
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform_wrapper: true

- name: Setup token and patch module with release information
run: |
if [ "${{ github.event.inputs.public_release }}" == "false" ] ; then
echo Internal release
MODULE_REF="app.terraform.io/SolaceDev/queue-endpoint/solacebroker"
else
echo Public release
MODULE_REF="SolaceProducts/queue-endpoint/solacebroker"
fi
ci/scripts/test-module.sh ci/module-test/ $MODULE_REF "${{ github.event.inputs.release_version }}"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ Optional module variables are either shared by multiple types, or conditional to
|[solacebroker_msg_vpn_queue_template](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs/resources/msg_vpn_queue_template#optional)|
|[solacebroker_msg_vpn_topic_endpoint_template](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs/resources/msg_vpn_topic_endpoint_template#optional)|

Most optional variables' default value is null. If they are not provided then the default for the related resource attribute will be configured on the broker.
Most optional variables' default value is `null`, meaning that if not provided then the resource default value will be provisioned on the broker.

-> The module defaults for `ingress_enabled` and `egress_enabled` optional variables are `true`, which differ from the resource attribute defaults.

## Module outputs

Outputs provide references to created resources. Any reference for a resource that has not been created for an endpoint type will be set to `(null)`.
[Module outputs](https://developer.hashicorp.com/terraform/language/values/outputs) provide reference to created resources. Any reference to a resource that has not been created will be set to `(null)`.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_solacebroker"></a> [solacebroker](#provider\_solacebroker) | ~> 0.9 |
| <a name="provider_solacebroker"></a> [solacebroker](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest) | ~> 0.9 |

## Resources

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0-rc.2
4 changes: 4 additions & 0 deletions ci/module-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ provider "solacebroker" {

module "messaging_endpoint_1" {
source = "../.."
# version = ""

msg_vpn_name = "default"
endpoint_type = "queue"
Expand All @@ -20,6 +21,7 @@ module "messaging_endpoint_1" {

module "messaging_endpoint_2" {
source = "../.."
# version = ""

msg_vpn_name = "default"
endpoint_type = "topic_endpoint"
Expand All @@ -33,6 +35,7 @@ module "messaging_endpoint_2" {

module "queue_template_1" {
source = "../.."
# version = ""

msg_vpn_name = "default"
endpoint_type = "queue_template"
Expand All @@ -42,6 +45,7 @@ module "queue_template_1" {

module "te_template_1" {
source = "../.."
# version = ""

msg_vpn_name = "default"
endpoint_type = "topic_endpoint_template"
Expand Down
6 changes: 5 additions & 1 deletion ci/scripts/test-module.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
# Basic terraform test on a config. Params: $1 is the directory name
# Basic terraform test on a config.
# Params: $1 is the directory name, $2 (optional), the module registry URL, $3 (optional), the module version
set -e
pushd "$1"
if [ -n "$2" ] ; then sed -i "s@source =.*@source = \"$2\"@g" main.tf; fi
if [ -n "$3" ] ; then sed -i "s@# version =.*@version = \"$3\"@g" main.tf; fi
cat main.tf
terraform init
terraform validate
# Create
Expand Down
17 changes: 13 additions & 4 deletions examples/exclusive-queue/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exclusive Queue Example

Configuration in this directory creates an [exclusive queue](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Queues.htm#Configuring_Access_Types_..49?Highlight=exclusive) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module.
Configuration in this directory creates an [exclusive queue](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Queues.htm#Configuring_Access_Types_..49?Highlight=exclusive) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module.

## Module Configuration in the Example

Expand Down Expand Up @@ -33,6 +33,15 @@ This example will create following resources:

If you don't already have access to a broker, refer to the [Developers page](https://www.solace.dev/) for options to get started.

### Sample source code

The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-queue-endpoint.git
cd examples/exclusive-queue
```

### Adjust Provider Configuration

Adjust the [provider parameters](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs#schema) in `main.tf` according to your broker. The example configuration shows settings for a local broker running in Docker.
Expand All @@ -44,9 +53,9 @@ Hint: You can verify configuration changes on the broker, before and after, usin
Execute from this folder:

```bash
$ terraform init
$ terraform plan
$ terraform apply
terraform init
terraform plan
terraform apply
```

Run `terraform destroy` to clean up created resources when no longer needed.
Expand Down
14 changes: 14 additions & 0 deletions examples/exclusive-queue/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

provider "solacebroker" {
username = "admin"
password = "admin"
Expand Down
14 changes: 14 additions & 0 deletions examples/exclusive-queue/providers.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Terraform configuration

terraform {
Expand Down
17 changes: 13 additions & 4 deletions examples/non-exclusive-queue/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Non-exclusive Queue Example

Configuration in this directory creates a [non-exclusive queue](https://docs.solace.com/Get-Started/message-exchange-patterns.htm#Point-to) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module.
Configuration in this directory creates a [non-exclusive queue](https://docs.solace.com/Get-Started/message-exchange-patterns.htm#Point-to) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module.

## Module Configuration in the Example

Expand Down Expand Up @@ -33,6 +33,15 @@ This example will create following resources:

If you don't already have access to a broker, refer to the [Developers page](https://www.solace.dev/) for options to get started.

### Sample source code

The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-queue-endpoint.git
cd examples/non-exclusive-queue
```

### Adjust Provider Configuration

Adjust the [provider parameters](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs#schema) in `main.tf` according to your broker. The example configuration shows settings for a local broker running in Docker.
Expand All @@ -44,9 +53,9 @@ Hint: You can verify configuration changes on the broker, before and after, usin
Execute from this folder:

```bash
$ terraform init
$ terraform plan
$ terraform apply
terraform init
terraform plan
terraform apply
```

Run `terraform destroy` to clean up created resources when no longer needed.
Expand Down
14 changes: 14 additions & 0 deletions examples/non-exclusive-queue/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

provider "solacebroker" {
username = "admin"
password = "admin"
Expand Down
14 changes: 14 additions & 0 deletions examples/non-exclusive-queue/providers.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Terraform configuration

terraform {
Expand Down
17 changes: 13 additions & 4 deletions examples/partitioned-queue/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Partitioned Queue Example

Configuration in this directory creates a [partitioned queue](https://docs.solace.com/Messaging/Guaranteed-Msg/Queues.htm#partitioned-queues) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module.
Configuration in this directory creates a [partitioned queue](https://docs.solace.com/Messaging/Guaranteed-Msg/Queues.htm#partitioned-queues) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module.

## Module Configuration in the Example

Expand Down Expand Up @@ -37,6 +37,15 @@ This example will create following resources:

If you don't already have access to a broker, refer to the [Developers page](https://www.solace.dev/) for options to get started.

### Sample source code

The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-queue-endpoint.git
cd examples/partitioned-queue
```

### Adjust Provider Configuration

Adjust the [provider parameters](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs#schema) in `main.tf` according to your broker. The example configuration shows settings for a local broker running in Docker.
Expand All @@ -48,9 +57,9 @@ Hint: You can verify configuration changes on the broker, before and after, usin
Execute from this folder:

```bash
$ terraform init
$ terraform plan
$ terraform apply
terraform init
terraform plan
terraform apply
```

Run `terraform destroy` to clean up created resources when no longer needed.
Expand Down
14 changes: 14 additions & 0 deletions examples/partitioned-queue/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

provider "solacebroker" {
username = "admin"
password = "admin"
Expand Down
14 changes: 14 additions & 0 deletions examples/partitioned-queue/providers.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Solace Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Terraform configuration

terraform {
Expand Down
Loading

0 comments on commit 10564d8

Please sign in to comment.