Skip to content

Commit

Permalink
Added client username attributes example
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma committed Mar 12, 2024
1 parent bcd00b2 commit c5b718c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/acl-profile-exceptions/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ACL Profile Exceptions Configuration Example

Configuration in this directory demonstrates configuring [ACL profile exceptions](https://docs.solace.com/Security/Managing-Access-Control-Lists.htm) on the PubSub+ event broker, leveraging the Client Terraform module.
This directory demonstrates configuration of a client username with [ACL profile exceptions](https://docs.solace.com/Security/Managing-Access-Control-Lists.htm) on the PubSub+ event broker, leveraging the Client Terraform module.

One set of use cases is if the assigned ACL profile is restrictive (the default value is "disallow") and individual permissions are added as exceptions. Other cases need individual exceptions to a permissive profile. Both serve the configuration of specific requirements of the client being provisioned.

Expand Down Expand Up @@ -56,7 +56,7 @@ The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-rest-delivery.git
cd examples/adding-headers
cd examples/acl-profile-exceptions
```

### Adjust Provider Configuration
Expand Down
2 changes: 1 addition & 1 deletion examples/authorization-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-rest-delivery.git
cd examples/adding-headers
cd examples/authorization-group
```

### Adjust Provider Configuration
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-client-username/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The sample is available from the module GitHub repo:

```bash
git clone https://github.com/SolaceProducts/terraform-solacebroker-rest-delivery.git
cd examples/adding-headers
cd examples/basic-client-username
```

### Adjust Provider Configuration
Expand Down
69 changes: 69 additions & 0 deletions examples/client-username-attributes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Client Username Attributes Configuration Example

This directory demonstrates configuration of a client username with additional [client username attributes](https://docs.solace.com/Security/Configuring-Client-Usernames.htm?Highlight=client%20username%20attributes#Setting) on the PubSub+ event broker, leveraging the Client Terraform module.

## Module Configuration in the Example

### Required Inputs

* `msg_vpn_name` - set to `default` in the example
* `client_identifier_type` - set to `client_username`
* `client_identifier_name` - set to `myclientwithattributes` in the example.
* `client_profile_name` - `default`, in the example
* `acl_profile_name` - `default`, in the example

### Optional Inputs

* `client_username_attributes` - a set of attributes in a list form.

Optional module input variables have the same name as the attributes of the underlying provider resource. If omitted then the default for the related resource attribute will be configured on the broker. For attributes and defaults, refer to the [documentation of "solacebroker_msg_vpn_client_username"](https://registry.terraform.io/providers/SolaceProducts/solacebroker/latest/docs/resources/msg_vpn_client_username#optional).

The module default for the `enabled` variable is true, which enables both the RDP and the REST consumer resources.

### Output

The module `client_username` output refers to the created client username and the `attributes` output provides the list of created attributes.

## Created resources

This example will create following resources:

* `solacebroker_msg_vpn_client_username`
* `solacebroker_msg_vpn_client_username_attribute`

## Running the Example

### Access to a PubSub+ broker

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-rest-delivery.git
cd examples/client-username-attributes
```

### 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.

### Create the resource

Hint: You can verify configuration changes on the broker, before and after, using the [PubSub+ Broker Manager Web UI](https://docs.solace.com/Admin/Broker-Manager/PubSub-Manager-Overview.htm)

Execute from this folder:

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

Run `terraform destroy` to clean up created resources when no longer needed.

## Additional Documentation

Refer to the [Configuring Client Authorization](https://docs.solace.com/Security/Configuring-Client-Authorization.htm) section in the PubSub+ documentation.
2 changes: 1 addition & 1 deletion examples/client-username-attributes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module "testclient" {

msg_vpn_name = "default"
client_identifier_type = "client_username"
client_identifier_name = "myclient"
client_identifier_name = "myclientwithattributes"
client_profile_name = "default"
acl_profile_name = "default"

Expand Down

0 comments on commit c5b718c

Please sign in to comment.