Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Resource: azurerm_bot_channel_line #12746

Merged
merged 10 commits into from Aug 4, 2021

Conversation

neil-yechenwei
Copy link
Contributor

Currently, TF doesn't support to create Bot Line Channel. So I submitted this PR to implement it.

With creating test data of Line Channel, please refer this doc.

--- PASS: TestAccBotChannelsRegistration/channel/lineComplete (238.88s)
--- PASS: TestAccBotChannelsRegistration/channel/lineUpdate (300.47s)
--- PASS: TestAccBotChannelsRegistration/channel/lineBasic (250.22s)
--- PASS: TestAccBotChannelsRegistration/channel/lineRequiresImport (226.83s)

API reference:
https://github.com/Azure/azure-rest-api-specs/blob/e3dbb827d99eaadf132075707373f6b4bda08fd9/specification/botservice/resource-manager/Microsoft.BotService/stable/2021-03-01/botservice.json#L1903

Comment on lines 53 to 72
"line_registration": {
Type: pluginsdk.TypeSet,
Required: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"channel_access_token": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},

"channel_secret": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
},
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to put this in a block?

Suggested change
"line_registration": {
Type: pluginsdk.TypeSet,
Required: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"channel_access_token": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"channel_secret": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
},
},
"line_channel_access_token": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"line_channel_secret": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katbyte , Seems it has to be a block since I found it can configure multiple access tokens and secrets after tested.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry i missed that, how about we go with:

Suggested change
"line_registration": {
Type: pluginsdk.TypeSet,
Required: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"channel_access_token": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"channel_secret": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
},
},
"line_channel": {
Type: pluginsdk.TypeSet,
Required: true,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"access_token": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"secret": {
Type: pluginsdk.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
},
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@neil-yechenwei
Copy link
Contributor Author

@katbyte , thanks for your comment. I've updated code. Please have an another look. Thanks.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THanks @neil-yechenwei - LGTM 🍰

@katbyte katbyte added this to the v2.71.0 milestone Aug 4, 2021
@katbyte katbyte merged commit f41c1c5 into hashicorp:master Aug 4, 2021
katbyte added a commit that referenced this pull request Aug 4, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

This functionality has been released in v2.71.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Sep 6, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants