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: SignalR service azurerm_signalr_service #2410

Merged
merged 21 commits into from Dec 12, 2018
Merged

Conversation

JunyiYi
Copy link

@JunyiYi JunyiYi commented Nov 29, 2018

In this pull request, I introduced Azure SignalR (used to create real-time web application) to Terraform. AFAIK, there are no issues or feature requests yet.

I put it under "Messaging" section because it is somehow similar to notification hub.

@ghost ghost added the size/XXL label Nov 29, 2018
@JunyiYi JunyiYi changed the title [New Resource] SignalR service: azurerm_signalr New Resource SignalR service: azurerm_signalr Nov 29, 2018
@JunyiYi JunyiYi changed the title New Resource SignalR service: azurerm_signalr New Resource: SignalR service azurerm_signalr Nov 29, 2018
@metacpp metacpp added this to the 1.20.0 milestone Nov 29, 2018
@tombuildsstuff tombuildsstuff requested review from WodansSon and removed request for metacpp November 29, 2018 15:32
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.

Hi @JunyiYi,

Thanks for the new resource, i've taken a quick look and left some comments inline.

website/docs/r/signalr.html.markdown Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @JunyiYi

Thanks for this PR :)

I've taken a look through and left some comments in-line - but most of these comments are fairly minor; if we can fix those up & split the SKU block out we should be able to run the tests 👍

Thanks!

azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr.go Outdated Show resolved Hide resolved
azurerm/resource_arm_signalr_test.go Outdated Show resolved Hide resolved
website/docs/r/signalr.html.markdown Outdated Show resolved Hide resolved
website/docs/r/signalr.html.markdown Outdated Show resolved Hide resolved
website/docs/r/signalr.html.markdown Outdated Show resolved Hide resolved
website/docs/r/signalr.html.markdown Outdated Show resolved Hide resolved
katbyte and others added 8 commits November 29, 2018 15:43
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
Co-Authored-By: JunyiYi <junyi@microsoft.com>
@JunyiYi JunyiYi changed the title New Resource: SignalR service azurerm_signalr New Resource: SignalR service azurerm_signalr_service Nov 30, 2018
@JunyiYi
Copy link
Author

JunyiYi commented Nov 30, 2018

Thanks @tombuildsstuff and @katbyte for reviewing the code. I have updated it accordingly, please take a look.

Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

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

@JunyiYi Thanks for the PR LGTM!

v := input[0].(map[string]interface{})
name := v["name"].(string)
if name == "Free" {
name = "Free_F1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason we don't just have the user use Free_F1 for the name property?

Also is it Free_F1 for all capacities?

Copy link
Author

Choose a reason for hiding this comment

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

It is what @tombuildsstuff suggested before:

sku {
  name = "Free"
  capacity = 1
}

And for your second question, the answer is "Yes". SignalR service does not follow the convention of sku, they only accept Free_F1 and Standard_S1 no matter what capacity is.

@JunyiYi
Copy link
Author

JunyiYi commented Dec 7, 2018

@tombuildsstuff @katbyte , after talking with the service team, they do need to use fixed sku names (i.e. Free_F1 and Standard_S1) for all capacities, because they want to adapt capacity changes easily. Quote from service team:

Initially capacity is allowed to be 1-10, now it’s currency values (1,2,5,...,100). We may add more supported numbers in future). To keep the same SKU name, we can support more (or less) units by slightly updating our UI/Validation logic while keeping the UX/interface and consistent and stable.

So I will change the sku name to only allow Free_F1 and Standard_S1.

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.

Sounds good @JunyiYi

@tombuildsstuff tombuildsstuff modified the milestones: 1.20.0, 1.21.0 Dec 8, 2018
@JunyiYi
Copy link
Author

JunyiYi commented Dec 10, 2018

@tombuildsstuff @katbyte Code change has been pushed. One more thing, what service labeled should be added to this PR? If no existing label is applicable, could you please add a new service/signalr label?

Copy link
Contributor

@metacpp metacpp left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

@JunyiYi,

Looks good aside from two comments i've left inline

website/docs/r/signalr_service.html.markdown Outdated Show resolved Hide resolved
website/docs/r/signalr_service.html.markdown Outdated Show resolved Hide resolved
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.

@JunyiYi,

Looks good aside from two comments i've left inline

katbyte and others added 3 commits December 11, 2018 19:19
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 for the changes @JunyiYi, LGTM 👍

@katbyte
Copy link
Collaborator

katbyte commented Dec 12, 2018

Tests pass:
screen shot 2018-12-12 at 10 56 17

@katbyte katbyte modified the milestones: 1.21.0, 1.20.0 Dec 12, 2018
@katbyte katbyte merged commit 642ff3a into master Dec 12, 2018
@katbyte katbyte deleted the resource_signalr branch December 12, 2018 19:01
katbyte added a commit that referenced this pull request Dec 12, 2018

func flattenSignalRServiceSku(input *signalr.ResourceSku) []interface{} {
result := make(map[string]interface{})
if input != nil {
Copy link
Member

Choose a reason for hiding this comment

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

if input's nil we're going to set an empty sku block in the state (so there'll be an object there but it'll be empty) - can we update this to:

if input == nil {
  return []interface{}{}
}

...

this way it'll show that the Sku block isn't being returned from the API from the fact that Terraform will show the block being removed, rather than the fields being blank

@ghost
Copy link

ghost commented Mar 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Mar 5, 2019
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

5 participants