Skip to content

Commit

Permalink
feat: add new service mqcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuaib Bapputty authored and hkantare committed Dec 12, 2023
1 parent 17b8132 commit 6aa6b14
Show file tree
Hide file tree
Showing 47 changed files with 5,426 additions and 117 deletions.
175 changes: 175 additions & 0 deletions examples/ibm-mqcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Example for MqcloudV1

This example illustrates how to use the MqcloudV1

The following types of resources are supported:

* mqcloud_queue_manager
* mqcloud_application
* mqcloud_user
* mqcloud_keystore_certificate
* mqcloud_truststore_certificate

## Usage

To run this example, execute the following commands:

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

Run `terraform destroy` when you don't need these resources.


## MqcloudV1 resources

mqcloud_queue_manager resource:

```hcl
resource "mqcloud_queue_manager" "mqcloud_queue_manager_instance" {
service_instance_guid = var.mqcloud_queue_manager_service_instance_guid
name = var.mqcloud_queue_manager_name
display_name = var.mqcloud_queue_manager_display_name
location = var.mqcloud_queue_manager_location
size = var.mqcloud_queue_manager_size
version = var.mqcloud_queue_manager_version
}
```
mqcloud_application resource:

```hcl
resource "mqcloud_application" "mqcloud_application_instance" {
service_instance_guid = var.mqcloud_application_service_instance_guid
name = var.mqcloud_application_name
}
```
mqcloud_user resource:

```hcl
resource "mqcloud_user" "mqcloud_user_instance" {
service_instance_guid = var.mqcloud_user_service_instance_guid
name = var.mqcloud_user_name
email = var.mqcloud_user_email
}
```
mqcloud_keystore_certificate resource:

```hcl
resource "mqcloud_keystore_certificate" "mqcloud_keystore_certificate_instance" {
service_instance_guid = var.mqcloud_keystore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_keystore_certificate_queue_manager_id
label = var.mqcloud_keystore_certificate_label
}
```
mqcloud_truststore_certificate resource:

```hcl
resource "mqcloud_truststore_certificate" "mqcloud_truststore_certificate_instance" {
service_instance_guid = var.mqcloud_truststore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_truststore_certificate_queue_manager_id
label = var.mqcloud_truststore_certificate_label
}
```

## MqcloudV1 data sources

mqcloud_queue_manager data source:

```hcl
data "mqcloud_queue_manager" "mqcloud_queue_manager_instance" {
service_instance_guid = var.mqcloud_queue_manager_service_instance_guid
name = var.mqcloud_queue_manager_name
}
```
mqcloud_queue_manager_status data source:

```hcl
data "mqcloud_queue_manager_status" "mqcloud_queue_manager_status_instance" {
service_instance_guid = var.mqcloud_queue_manager_status_service_instance_guid
queue_manager_id = var.mqcloud_queue_manager_status_queue_manager_id
}
```
mqcloud_application data source:

```hcl
data "mqcloud_application" "mqcloud_application_instance" {
service_instance_guid = var.mqcloud_application_service_instance_guid
name = var.mqcloud_application_name
}
```
mqcloud_user data source:

```hcl
data "mqcloud_user" "mqcloud_user_instance" {
service_instance_guid = var.mqcloud_user_service_instance_guid
name = var.mqcloud_user_name
}
```
mqcloud_truststore_certificate data source:

```hcl
data "mqcloud_truststore_certificate" "mqcloud_truststore_certificate_instance" {
service_instance_guid = var.mqcloud_truststore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_truststore_certificate_queue_manager_id
label = var.mqcloud_truststore_certificate_label
}
```
mqcloud_keystore_certificate data source:

```hcl
data "mqcloud_keystore_certificate" "mqcloud_keystore_certificate_instance" {
service_instance_guid = var.mqcloud_keystore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_keystore_certificate_queue_manager_id
label = var.mqcloud_keystore_certificate_label
}
```

## Assumptions

1. TODO

## Notes

1. TODO

## Requirements

| Name | Version |
|------|---------|
| terraform | ~> 0.12 |

## Providers

| Name | Version |
|------|---------|
| ibm | 1.13.1 |

## Inputs

| Name | Description | Type | Required |
|------|-------------|------|---------|
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
| service_instance_guid | The GUID that uniquely identifies the MQ on Cloud service instance. | `string` | true |
| name | A queue manager name conforming to MQ restrictions. | `string` | true |
| display_name | A displayable name for the queue manager - limited only in length. | `string` | false |
| location | The locations in which the queue manager could be deployed. | `string` | true |
| size | The queue manager sizes of deployment available. Deployment of lite queue managers for aws_us_east_1 and aws_eu_west_1 locations is not available. | `string` | true |
| version | The MQ version of the queue manager. | `string` | false |
| name | The name of the application - conforming to MQ rules. | `string` | true |
| name | The shortname of the user that will be used as the IBM MQ administrator in interactions with a queue manager for this service instance. | `string` | true |
| email | The email of the user. | `string` | true |
| queue_manager_id | The id of the queue manager to retrieve its full details. | `string` | true |
| label | Certificate label in queue manager store. | `string` | true |

## Outputs

| Name | Description |
|------|-------------|
| mqcloud_queue_manager | mqcloud_queue_manager object |
| mqcloud_queue_manager_status | mqcloud_queue_manager_status object |
| mqcloud_application | mqcloud_application object |
| mqcloud_user | mqcloud_user object |
| mqcloud_truststore_certificate | mqcloud_truststore_certificate object |
| mqcloud_keystore_certificate | mqcloud_keystore_certificate object |
103 changes: 103 additions & 0 deletions examples/ibm-mqcloud/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
}

// Provision mqcloud_queue_manager resource instance
resource "ibm_mqcloud_queue_manager" "mqcloud_queue_manager_instance" {
service_instance_guid = var.mqcloud_queue_manager_service_instance_guid
name = var.mqcloud_queue_manager_name
display_name = var.mqcloud_queue_manager_display_name
location = var.mqcloud_queue_manager_location
size = var.mqcloud_queue_manager_size
version = var.mqcloud_queue_manager_version
}

// Provision mqcloud_application resource instance
resource "ibm_mqcloud_application" "mqcloud_application_instance" {
service_instance_guid = var.mqcloud_application_service_instance_guid
name = var.mqcloud_application_name
}

// Provision mqcloud_user resource instance
resource "ibm_mqcloud_user" "mqcloud_user_instance" {
service_instance_guid = var.mqcloud_user_service_instance_guid
name = var.mqcloud_user_name
email = var.mqcloud_user_email
}

// Provision mqcloud_keystore_certificate resource instance
resource "ibm_mqcloud_keystore_certificate" "mqcloud_keystore_certificate_instance" {
service_instance_guid = var.mqcloud_keystore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_keystore_certificate_queue_manager_id
label = var.mqcloud_keystore_certificate_label
}

// Provision mqcloud_truststore_certificate resource instance
resource "ibm_mqcloud_truststore_certificate" "mqcloud_truststore_certificate_instance" {
service_instance_guid = var.mqcloud_truststore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_truststore_certificate_queue_manager_id
label = var.mqcloud_truststore_certificate_label
}

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_queue_manager data source
data "ibm_mqcloud_queue_manager" "mqcloud_queue_manager_instance" {
service_instance_guid = var.mqcloud_queue_manager_service_instance_guid
name = var.mqcloud_queue_manager_name
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_queue_manager_status data source
data "ibm_mqcloud_queue_manager_status" "mqcloud_queue_manager_status_instance" {
service_instance_guid = var.mqcloud_queue_manager_status_service_instance_guid
queue_manager_id = var.mqcloud_queue_manager_status_queue_manager_id
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_application data source
data "ibm_mqcloud_application" "mqcloud_application_instance" {
service_instance_guid = var.mqcloud_application_service_instance_guid
name = var.mqcloud_application_name
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_user data source
data "ibm_mqcloud_user" "mqcloud_user_instance" {
service_instance_guid = var.mqcloud_user_service_instance_guid
name = var.mqcloud_user_name
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_truststore_certificate data source
data "ibm_mqcloud_truststore_certificate" "mqcloud_truststore_certificate_instance" {
service_instance_guid = var.mqcloud_truststore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_truststore_certificate_queue_manager_id
label = var.mqcloud_truststore_certificate_label
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create mqcloud_keystore_certificate data source
data "ibm_mqcloud_keystore_certificate" "mqcloud_keystore_certificate_instance" {
service_instance_guid = var.mqcloud_keystore_certificate_service_instance_guid
queue_manager_id = var.mqcloud_keystore_certificate_queue_manager_id
label = var.mqcloud_keystore_certificate_label
}
*/
30 changes: 30 additions & 0 deletions examples/ibm-mqcloud/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This output allows mqcloud_queue_manager data to be referenced by other resources and the terraform CLI
// Modify this output if only certain data should be exposed
output "ibm_mqcloud_queue_manager" {
value = ibm_mqcloud_queue_manager.mqcloud_queue_manager_instance
description = "mqcloud_queue_manager resource instance"
}
// This output allows mqcloud_application data to be referenced by other resources and the terraform CLI
// Modify this output if only certain data should be exposed
output "ibm_mqcloud_application" {
value = ibm_mqcloud_application.mqcloud_application_instance
description = "mqcloud_application resource instance"
}
// This output allows mqcloud_user data to be referenced by other resources and the terraform CLI
// Modify this output if only certain data should be exposed
output "ibm_mqcloud_user" {
value = ibm_mqcloud_user.mqcloud_user_instance
description = "mqcloud_user resource instance"
}
// This output allows mqcloud_keystore_certificate data to be referenced by other resources and the terraform CLI
// Modify this output if only certain data should be exposed
output "ibm_mqcloud_keystore_certificate" {
value = ibm_mqcloud_keystore_certificate.mqcloud_keystore_certificate_instance
description = "mqcloud_keystore_certificate resource instance"
}
// This output allows mqcloud_truststore_certificate data to be referenced by other resources and the terraform CLI
// Modify this output if only certain data should be exposed
output "ibm_mqcloud_truststore_certificate" {
value = ibm_mqcloud_truststore_certificate.mqcloud_truststore_certificate_instance
description = "mqcloud_truststore_certificate resource instance"
}
Loading

0 comments on commit 6aa6b14

Please sign in to comment.