-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Huawei Cloud SMN module (#4)
- Loading branch information
1 parent
2367cd7
commit bb09e53
Showing
5 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
# Module name | ||
# Huawei Cloud SMN | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.4 | | ||
| <a name="requirement_huaweicloud"></a> [huaweicloud](#requirement\_huaweicloud) | ~>1.47 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_huaweicloud"></a> [huaweicloud](#provider\_huaweicloud) | ~>1.47 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [huaweicloud_smn_subscription.emails](https://registry.terraform.io/providers/huaweicloud/huaweicloud/latest/docs/resources/smn_subscription) | resource | | ||
| [huaweicloud_smn_topic.topic](https://registry.terraform.io/providers/huaweicloud/huaweicloud/latest/docs/resources/smn_topic) | resource | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_emails"></a> [emails](#input\_emails) | Specifies the subscriptions emails | `list(string)` | `[]` | no | | ||
| <a name="input_topic_name"></a> [topic\_name](#input\_topic\_name) | Specifies the name of the topic to be created | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_topic_id"></a> [topic\_id](#output\_topic\_id) | The ID of a created topic | | ||
| <a name="output_topic_name"></a> [topic\_name](#output\_topic\_name) | The ID of a created topic | | ||
<!-- END_TF_DOCS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource "huaweicloud_smn_topic" "topic" { | ||
name = var.topic_name | ||
} | ||
|
||
resource "huaweicloud_smn_subscription" "emails" { | ||
for_each = toset(var.emails) | ||
|
||
topic_urn = huaweicloud_smn_topic.topic.id | ||
endpoint = each.value | ||
protocol = "email" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "topic_id" { | ||
description = "The ID of a created topic" | ||
value = huaweicloud_smn_topic.topic.id | ||
} | ||
|
||
output "topic_name" { | ||
description = "The ID of a created topic" | ||
value = huaweicloud_smn_topic.topic.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
variable "topic_name" { | ||
description = "Specifies the name of the topic to be created" | ||
type = string | ||
} | ||
|
||
variable "emails" { | ||
description = "Specifies the subscriptions emails" | ||
type = list(string) | ||
default = [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
terraform { | ||
required_version = "~> 1.4" | ||
|
||
required_providers { | ||
huaweicloud = { | ||
source = "huaweicloud/huaweicloud" | ||
version = "~>1.47" | ||
} | ||
} | ||
} |