From bbb11267674aff10d29e5cd91022f22f7fb59888 Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Mon, 12 Feb 2024 11:02:06 -0500 Subject: [PATCH 1/8] Added test broker --- .github/workflows/prep-internal-release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/prep-internal-release.yml b/.github/workflows/prep-internal-release.yml index ce50c15..0b873bc 100644 --- a/.github/workflows/prep-internal-release.yml +++ b/.github/workflows/prep-internal-release.yml @@ -30,6 +30,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 From 4bdaefc3c0881b6c119e910ef46ea2abca8194a7 Mon Sep 17 00:00:00 2001 From: bczoma Date: Mon, 12 Feb 2024 16:05:46 +0000 Subject: [PATCH 2/8] Updating release candidate [skip ci] --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..f2e984b --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0-rc.2 From 42170fbdf53e6b16c6c819025747c64ed5b7a06e Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Mon, 12 Feb 2024 14:32:27 -0500 Subject: [PATCH 3/8] Added verify registry release --- .github/workflows/verify-registry-release.yml | 58 +++++++++++++++++++ ci/module-test/main.tf | 4 ++ ci/scripts/test-module.sh | 6 +- 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify-registry-release.yml diff --git a/.github/workflows/verify-registry-release.yml b/.github/workflows/verify-registry-release.yml new file mode 100644 index 0000000..e07f28e --- /dev/null +++ b/.github/workflows/verify-registry-release.yml @@ -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="SolaceProducts/queue-endpoint/solacebroker" + else + echo Public release + MODULE_REF="app.terraform.io/SolaceDev/queue-endpoint/solacebroker" + fi + ci/scripts/test-module.sh ci/module-test/ $MODULE_REF "${{ github.event.inputs.release_version }}" + diff --git a/ci/module-test/main.tf b/ci/module-test/main.tf index 18f1ad5..bf5e7e8 100644 --- a/ci/module-test/main.tf +++ b/ci/module-test/main.tf @@ -6,6 +6,7 @@ provider "solacebroker" { module "messaging_endpoint_1" { source = "../.." + # version = "" msg_vpn_name = "default" endpoint_type = "queue" @@ -20,6 +21,7 @@ module "messaging_endpoint_1" { module "messaging_endpoint_2" { source = "../.." + # version = "" msg_vpn_name = "default" endpoint_type = "topic_endpoint" @@ -33,6 +35,7 @@ module "messaging_endpoint_2" { module "queue_template_1" { source = "../.." + # version = "" msg_vpn_name = "default" endpoint_type = "queue_template" @@ -42,6 +45,7 @@ module "queue_template_1" { module "te_template_1" { source = "../.." + # version = "" msg_vpn_name = "default" endpoint_type = "topic_endpoint_template" diff --git a/ci/scripts/test-module.sh b/ci/scripts/test-module.sh index 5ec4f95..c520edd 100755 --- a/ci/scripts/test-module.sh +++ b/ci/scripts/test-module.sh @@ -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 From b0b2d922bc3b4ef5cd0465d7e0a872804f0c0a8e Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Mon, 12 Feb 2024 15:17:05 -0500 Subject: [PATCH 4/8] Fixed module references --- .github/workflows/verify-registry-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-registry-release.yml b/.github/workflows/verify-registry-release.yml index e07f28e..bba8335 100644 --- a/.github/workflows/verify-registry-release.yml +++ b/.github/workflows/verify-registry-release.yml @@ -49,10 +49,10 @@ jobs: run: | if [ "${{ github.event.inputs.public_release }}" == "false" ] ; then echo Internal release - MODULE_REF="SolaceProducts/queue-endpoint/solacebroker" + MODULE_REF="app.terraform.io/SolaceDev/queue-endpoint/solacebroker" else echo Public release - MODULE_REF="app.terraform.io/SolaceDev/queue-endpoint/solacebroker" + MODULE_REF="SolaceProducts/queue-endpoint/solacebroker" fi ci/scripts/test-module.sh ci/module-test/ $MODULE_REF "${{ github.event.inputs.release_version }}" From 4c7521bf40b128f926674a531db8d6aab81b556a Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Tue, 13 Feb 2024 13:22:57 -0500 Subject: [PATCH 5/8] Added copyright headers --- .github/workflows/prep-internal-release.yml | 11 +++++++++++ examples/exclusive-queue/main.tf | 14 ++++++++++++++ examples/exclusive-queue/providers.tf | 14 ++++++++++++++ examples/non-exclusive-queue/main.tf | 14 ++++++++++++++ examples/non-exclusive-queue/providers.tf | 14 ++++++++++++++ examples/partitioned-queue/main.tf | 14 ++++++++++++++ examples/partitioned-queue/providers.tf | 14 ++++++++++++++ examples/queue-template/main.tf | 14 ++++++++++++++ examples/queue-template/providers.tf | 14 ++++++++++++++ examples/queue-with-jndi/main.tf | 14 ++++++++++++++ examples/queue-with-jndi/providers.tf | 14 ++++++++++++++ examples/queue-with-topic-subscriptions/main.tf | 14 ++++++++++++++ .../queue-with-topic-subscriptions/providers.tf | 14 ++++++++++++++ examples/topic-endpoint-template/main.tf | 14 ++++++++++++++ examples/topic-endpoint-template/providers.tf | 14 ++++++++++++++ examples/topic-endpoint-with-jndi/main.tf | 14 ++++++++++++++ examples/topic-endpoint-with-jndi/providers.tf | 14 ++++++++++++++ examples/topic-endpoint/main.tf | 14 ++++++++++++++ examples/topic-endpoint/providers.tf | 14 ++++++++++++++ main.tf | 14 ++++++++++++++ outputs.tf | 14 ++++++++++++++ provider.tf | 14 ++++++++++++++ variables.tf | 14 ++++++++++++++ 23 files changed, 319 insertions(+) diff --git a/.github/workflows/prep-internal-release.yml b/.github/workflows/prep-internal-release.yml index 0b873bc..d7bbaae 100644 --- a/.github/workflows/prep-internal-release.yml +++ b/.github/workflows/prep-internal-release.yml @@ -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 @@ -47,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 diff --git a/examples/exclusive-queue/main.tf b/examples/exclusive-queue/main.tf index 0920135..5f52559 100644 --- a/examples/exclusive-queue/main.tf +++ b/examples/exclusive-queue/main.tf @@ -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" diff --git a/examples/exclusive-queue/providers.tf b/examples/exclusive-queue/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/exclusive-queue/providers.tf +++ b/examples/exclusive-queue/providers.tf @@ -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 { diff --git a/examples/non-exclusive-queue/main.tf b/examples/non-exclusive-queue/main.tf index d97d9f8..ff78518 100644 --- a/examples/non-exclusive-queue/main.tf +++ b/examples/non-exclusive-queue/main.tf @@ -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" diff --git a/examples/non-exclusive-queue/providers.tf b/examples/non-exclusive-queue/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/non-exclusive-queue/providers.tf +++ b/examples/non-exclusive-queue/providers.tf @@ -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 { diff --git a/examples/partitioned-queue/main.tf b/examples/partitioned-queue/main.tf index 45aa5f5..11351b2 100644 --- a/examples/partitioned-queue/main.tf +++ b/examples/partitioned-queue/main.tf @@ -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" diff --git a/examples/partitioned-queue/providers.tf b/examples/partitioned-queue/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/partitioned-queue/providers.tf +++ b/examples/partitioned-queue/providers.tf @@ -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 { diff --git a/examples/queue-template/main.tf b/examples/queue-template/main.tf index 3f777ce..9391aa5 100644 --- a/examples/queue-template/main.tf +++ b/examples/queue-template/main.tf @@ -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" diff --git a/examples/queue-template/providers.tf b/examples/queue-template/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/queue-template/providers.tf +++ b/examples/queue-template/providers.tf @@ -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 { diff --git a/examples/queue-with-jndi/main.tf b/examples/queue-with-jndi/main.tf index 290b255..e089f01 100644 --- a/examples/queue-with-jndi/main.tf +++ b/examples/queue-with-jndi/main.tf @@ -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" diff --git a/examples/queue-with-jndi/providers.tf b/examples/queue-with-jndi/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/queue-with-jndi/providers.tf +++ b/examples/queue-with-jndi/providers.tf @@ -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 { diff --git a/examples/queue-with-topic-subscriptions/main.tf b/examples/queue-with-topic-subscriptions/main.tf index d0a8e16..347b993 100644 --- a/examples/queue-with-topic-subscriptions/main.tf +++ b/examples/queue-with-topic-subscriptions/main.tf @@ -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" diff --git a/examples/queue-with-topic-subscriptions/providers.tf b/examples/queue-with-topic-subscriptions/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/queue-with-topic-subscriptions/providers.tf +++ b/examples/queue-with-topic-subscriptions/providers.tf @@ -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 { diff --git a/examples/topic-endpoint-template/main.tf b/examples/topic-endpoint-template/main.tf index 088af5b..7035aff 100644 --- a/examples/topic-endpoint-template/main.tf +++ b/examples/topic-endpoint-template/main.tf @@ -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" diff --git a/examples/topic-endpoint-template/providers.tf b/examples/topic-endpoint-template/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/topic-endpoint-template/providers.tf +++ b/examples/topic-endpoint-template/providers.tf @@ -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 { diff --git a/examples/topic-endpoint-with-jndi/main.tf b/examples/topic-endpoint-with-jndi/main.tf index 98d0012..6232012 100644 --- a/examples/topic-endpoint-with-jndi/main.tf +++ b/examples/topic-endpoint-with-jndi/main.tf @@ -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" diff --git a/examples/topic-endpoint-with-jndi/providers.tf b/examples/topic-endpoint-with-jndi/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/topic-endpoint-with-jndi/providers.tf +++ b/examples/topic-endpoint-with-jndi/providers.tf @@ -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 { diff --git a/examples/topic-endpoint/main.tf b/examples/topic-endpoint/main.tf index 7f0a64e..a4211d0 100644 --- a/examples/topic-endpoint/main.tf +++ b/examples/topic-endpoint/main.tf @@ -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" diff --git a/examples/topic-endpoint/providers.tf b/examples/topic-endpoint/providers.tf index 46c4322..cf0d9af 100644 --- a/examples/topic-endpoint/providers.tf +++ b/examples/topic-endpoint/providers.tf @@ -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 { diff --git a/main.tf b/main.tf index d0de371..3a49413 100644 --- a/main.tf +++ b/main.tf @@ -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. + resource "solacebroker_msg_vpn_queue" "main" { count = var.endpoint_type == "queue" ? 1 : 0 diff --git a/outputs.tf b/outputs.tf index 65923d4..25d480c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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. + # Output variable definitions output "queue" { diff --git a/provider.tf b/provider.tf index 92095b9..d0e66b6 100644 --- a/provider.tf +++ b/provider.tf @@ -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 { diff --git a/variables.tf b/variables.tf index 2726026..d7fbe7e 100644 --- a/variables.tf +++ b/variables.tf @@ -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. + # Input variable definitions # Required variables From 7c0e9eaef9e1ec445eed4b4140b6f40394b1e578 Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Fri, 16 Feb 2024 09:26:30 -0500 Subject: [PATCH 6/8] Doc updates --- README.md | 4 +- examples/exclusive-queue/README.md | 17 ++++-- examples/exclusive-queue/main.tf | 54 ++++++++++--------- examples/non-exclusive-queue/README.md | 17 ++++-- examples/partitioned-queue/README.md | 17 ++++-- examples/queue-template/README.md | 17 ++++-- examples/queue-with-jndi/README.md | 17 ++++-- .../queue-with-topic-subscriptions/README.md | 17 ++++-- examples/topic-endpoint-template/README.md | 17 ++++-- examples/topic-endpoint-with-jndi/README.md | 17 ++++-- examples/topic-endpoint/README.md | 17 ++++-- 11 files changed, 149 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index c8e1d3b..eeb15b7 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,13 @@ 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 diff --git a/examples/exclusive-queue/README.md b/examples/exclusive-queue/README.md index fc5e2fc..2700ee3 100644 --- a/examples/exclusive-queue/README.md +++ b/examples/exclusive-queue/README.md @@ -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 @@ -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. @@ -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. diff --git a/examples/exclusive-queue/main.tf b/examples/exclusive-queue/main.tf index 5f52559..60ae288 100644 --- a/examples/exclusive-queue/main.tf +++ b/examples/exclusive-queue/main.tf @@ -1,30 +1,41 @@ -# 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. - +# 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" url = "http://localhost:8080" } -module "exclusive_queue" { - # update with the module location - source = "../.." +# resource "solacebroker_msg_vpn_queue" "exclusive_queue" { +# msg_vpn_name = "default" +# queue_name = "testEQ" + +# # permission "consume" enables a messaging client to connect, read and consume messages to/from the queue +# permission = "delete" + +# # access_type "exclusive" is the default queue access type. While it has been specified here for clarity, it is not strictly required. +# access_type = "exclusive" +# # ingress and egress are enabled by default in the module, no need to enable here +# # ingress_enabled = true +# # egress_enabled = true +# } + +resource "solacebroker_msg_vpn_queue" "exclusive_queue2" { msg_vpn_name = "default" - endpoint_type = "queue" - endpoint_name = "testEQ" + queue_name = "testEQ" # permission "consume" enables a messaging client to connect, read and consume messages to/from the queue permission = "consume" @@ -37,8 +48,3 @@ module "exclusive_queue" { # egress_enabled = true } -output "provisioned_queue" { - value = module.exclusive_queue.queue - description = "The provisioned queue resource" -} - diff --git a/examples/non-exclusive-queue/README.md b/examples/non-exclusive-queue/README.md index b9c0333..444b253 100644 --- a/examples/non-exclusive-queue/README.md +++ b/examples/non-exclusive-queue/README.md @@ -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 @@ -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. @@ -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. diff --git a/examples/partitioned-queue/README.md b/examples/partitioned-queue/README.md index 8cf6f3f..d0d25c7 100644 --- a/examples/partitioned-queue/README.md +++ b/examples/partitioned-queue/README.md @@ -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 @@ -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. @@ -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. diff --git a/examples/queue-template/README.md b/examples/queue-template/README.md index e6c3e45..8f9dfaf 100644 --- a/examples/queue-template/README.md +++ b/examples/queue-template/README.md @@ -1,6 +1,6 @@ # Queue Template Example -Configuration in this directory creates a [queue template](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Endpoint-Templates.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [queue template](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Endpoint-Templates.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. ## Module Configuration in the Example @@ -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/queue-template +``` + ### 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. @@ -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. diff --git a/examples/queue-with-jndi/README.md b/examples/queue-with-jndi/README.md index 6fc5812..9f0e44f 100644 --- a/examples/queue-with-jndi/README.md +++ b/examples/queue-with-jndi/README.md @@ -1,6 +1,6 @@ # Queue with JNDI Example -Configuration in this directory creates a [queue that is also exposed as a JNDI administered object](https://docs.solace.com/API/Solace-JMS-API/Managing-Solace-JNDI-Objects.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [queue that is also exposed as a JNDI administered object](https://docs.solace.com/API/Solace-JMS-API/Managing-Solace-JNDI-Objects.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. Note that exposing queues as JNDI objects also requires JNDI enabled at the Message VPN level and the configuration of a Connection Factory. The [Service Module](TODO:add link) and the [JNDI Connection Factory Module](TODO:add link) may be used to configure that. This module will not check if they are in place but configuration will fail. @@ -38,6 +38,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/queue-with-jndi +``` + ### 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. @@ -49,9 +58,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. diff --git a/examples/queue-with-topic-subscriptions/README.md b/examples/queue-with-topic-subscriptions/README.md index bbbd636..e4c8207 100644 --- a/examples/queue-with-topic-subscriptions/README.md +++ b/examples/queue-with-topic-subscriptions/README.md @@ -1,6 +1,6 @@ # Queue with Topic Subsciptions Example -Configuration in this directory creates a [queue with topic subscriptions](https://docs.solace.com/API/API-Developer-Guide/Adding-Topic-Subscriptio.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [queue with topic subscriptions](https://docs.solace.com/API/API-Developer-Guide/Adding-Topic-Subscriptio.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. ## Module Configuration in the Example @@ -38,6 +38,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/queue-with-topic-subscriptions +``` + ### 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. @@ -49,9 +58,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. diff --git a/examples/topic-endpoint-template/README.md b/examples/topic-endpoint-template/README.md index 705f933..a9fd5da 100644 --- a/examples/topic-endpoint-template/README.md +++ b/examples/topic-endpoint-template/README.md @@ -1,6 +1,6 @@ # Topic Endpoint Template Example -Configuration in this directory creates a [topic endpoint template](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Endpoint-Templates.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [topic endpoint template](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-Endpoint-Templates.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. Important: The topic subscription that a topic endpoint will spool messages for is not specified when a topic endpoint template is provisioned. For additional details refer to the [PubSub+ documentation](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-DTEs.htm). @@ -35,6 +35,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/topic-endpoint-template +``` + ### 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. @@ -46,9 +55,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. diff --git a/examples/topic-endpoint-with-jndi/README.md b/examples/topic-endpoint-with-jndi/README.md index 61b3d71..56ddcb9 100644 --- a/examples/topic-endpoint-with-jndi/README.md +++ b/examples/topic-endpoint-with-jndi/README.md @@ -1,6 +1,6 @@ # Topic Endpoint with JNDI Example -Configuration in this directory creates a [topic endpoint that is also exposed as a JNDI administered object](https://docs.solace.com/API/Solace-JMS-API/Managing-Solace-JNDI-Objects.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [topic endpoint that is also exposed as a JNDI administered object](https://docs.solace.com/API/Solace-JMS-API/Managing-Solace-JNDI-Objects.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. Note that exposing topics as JNDI objects also requires JNDI enabled at the Message VPN level and the configuration of a Connection Factory. The [Service Module](TODO:add link) and the [JNDI Connection Factory Module](TODO:add link) may be used to configure that. This module will not check if they are in place but configuration will fail. @@ -38,6 +38,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/topic-endpoint-with-jndi +``` + ### 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. @@ -49,9 +58,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. diff --git a/examples/topic-endpoint/README.md b/examples/topic-endpoint/README.md index ce237dc..abdf200 100644 --- a/examples/topic-endpoint/README.md +++ b/examples/topic-endpoint/README.md @@ -1,6 +1,6 @@ # Topic Endpoint Example -Configuration in this directory creates a [topic endpoint](https://docs.solace.com/Get-Started/topic-endpoints-queues.htm) on the PubSub+ event broker leveraging the Queue Endpoint Terraform module. +Configuration in this directory creates a [topic endpoint](https://docs.solace.com/Get-Started/topic-endpoints-queues.htm) on the PubSub+ event broker leveraging the Queues & Endpoints Terraform module. Important: The topic subscription that a topic endpoint will spool messages for is not specified when a topic endpoint is provisioned. For additional details refer to the [PubSub+ documentation](https://docs.solace.com/Messaging/Guaranteed-Msg/Configuring-DTEs.htm). @@ -35,6 +35,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/topic-endpoint +``` + ### 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. @@ -46,9 +55,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. From 15bbedacd1707dde22e5a14cbf8fd1df4fd946f7 Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Thu, 22 Feb 2024 15:29:51 -0500 Subject: [PATCH 7/8] Reverted to correct example --- examples/exclusive-queue/main.tf | 54 ++++++++++++++------------------ 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/examples/exclusive-queue/main.tf b/examples/exclusive-queue/main.tf index 60ae288..5f52559 100644 --- a/examples/exclusive-queue/main.tf +++ b/examples/exclusive-queue/main.tf @@ -1,41 +1,30 @@ -# 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. - +# 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" url = "http://localhost:8080" } -# resource "solacebroker_msg_vpn_queue" "exclusive_queue" { -# msg_vpn_name = "default" -# queue_name = "testEQ" - -# # permission "consume" enables a messaging client to connect, read and consume messages to/from the queue -# permission = "delete" - -# # access_type "exclusive" is the default queue access type. While it has been specified here for clarity, it is not strictly required. -# access_type = "exclusive" +module "exclusive_queue" { + # update with the module location + source = "../.." -# # ingress and egress are enabled by default in the module, no need to enable here -# # ingress_enabled = true -# # egress_enabled = true -# } - -resource "solacebroker_msg_vpn_queue" "exclusive_queue2" { msg_vpn_name = "default" - queue_name = "testEQ" + endpoint_type = "queue" + endpoint_name = "testEQ" # permission "consume" enables a messaging client to connect, read and consume messages to/from the queue permission = "consume" @@ -48,3 +37,8 @@ resource "solacebroker_msg_vpn_queue" "exclusive_queue2" { # egress_enabled = true } +output "provisioned_queue" { + value = module.exclusive_queue.queue + description = "The provisioned queue resource" +} + From 819cf1a9ac01156458b62ebc7325757fb9c79757 Mon Sep 17 00:00:00 2001 From: Balazs Czoma Date: Fri, 23 Feb 2024 14:14:41 -0500 Subject: [PATCH 8/8] Doc updates --- README.md | 2 +- examples/topic-endpoint-template/main.tf | 30 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index eeb15b7..25ebc7d 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Most optional variables' default value is `null`, meaning that if not provided t | Name | Version | |------|---------| -| [solacebroker](#provider\_solacebroker) | ~> 0.9 | +| [solacebroker](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest) | ~> 0.9 | ## Resources diff --git a/examples/topic-endpoint-template/main.tf b/examples/topic-endpoint-template/main.tf index 7035aff..f3a811d 100644 --- a/examples/topic-endpoint-template/main.tf +++ b/examples/topic-endpoint-template/main.tf @@ -1,17 +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. - +# 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" @@ -30,7 +30,7 @@ module "topic_endpoint_template" { # that has been created from the template permission = "consume" - # example optional config for the queue template + # example optional config for the topic endpoint template respect_ttl_enabled = true }