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

provider/azurerm: Event Hub Namespaces #9297

Merged
merged 15 commits into from
Oct 25, 2016

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Oct 9, 2016

Added support for Event Hubs Namespaces:

  • Added a Type for Event Hub Namespaces
  • Website Documentation
  • Imported the Event Hub SDK
  • Run the Tests

I started / was hoping to add support for Event Hubs / Consumer Groups / Authorization Rules in the same PR - but there's bugs in the Azure SDK for Go meaning this isn't possible right now.. so I'll send a follow up when it's fixed :)

@tombuildsstuff
Copy link
Contributor Author

The tests pass.. I'm roaming so there's some latency / timeout issues - I'll re-run them when I'm on a stable connection..

tharvey-mbp:terraform tharvey$ TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMEventHubNamespace -timeout 120m
=== RUN   TestAccAzureRMEventHubNamespaceCapacity_validation
--- PASS: TestAccAzureRMEventHubNamespaceCapacity_validation (0.00s)
=== RUN   TestAccAzureRMEventHubNamespaceSku_validation
--- PASS: TestAccAzureRMEventHubNamespaceSku_validation (0.00s)
=== RUN   TestAccAzureRMEventHubNamespace_basic
--- PASS: TestAccAzureRMEventHubNamespace_basic (1051.51s)
=== RUN   TestAccAzureRMEventHubNamespace_readDefaultKeys
--- FAIL: TestAccAzureRMEventHubNamespace_readDefaultKeys (893.14s)
    testing.go:265: Step 0 error: Check failed: Check 1/5 error: Bad: Get on eventHubNamespacesClient: eventhub.NamespacesClient#Get: Failure sending request: StatusCode=0 -- Original Error: Get https://management.azure.com/subscriptions/d386467e-33de-44ff-b324-641549c30383/resourceGroups/acctestRG-4544350067092685854/providers/Microsoft.EventHub/namespaces/acctesteventhubnamespace-4544350067092685854?api-version=2015-08-01: read tcp 192.168.1.100:50289->13.87.96.212:443: read: operation timed out
FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/azurerm    1944.659s

tharvey-mbp:terraform tharvey$ TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMEventHubNamespace_readDefaultKeys -timeout 120m
=== RUN   TestAccAzureRMEventHubNamespace_readDefaultKeys
--- PASS: TestAccAzureRMEventHubNamespace_readDefaultKeys (588.10s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    588.112s

One thing of note - if you create an Event Hub Namespace, and subsequently delete it - you can't create it (in a new subscription, at least) for 7 days - as noted in this screenshot. Is it worth mentioning this in the docs?

event-hubs-error

@tombuildsstuff tombuildsstuff changed the title [WIP] provider/azurerm: Event Hub Namespaces provider/azurerm: Event Hub Namespaces Oct 16, 2016
@tombuildsstuff
Copy link
Contributor Author

tombuildsstuff commented Oct 18, 2016

tharvey-mbp:terraform tharvey$ TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMEventHubNamespace -timeout 120m
=== RUN   TestAccAzureRMEventHubNamespaceCapacity_validation
--- PASS: TestAccAzureRMEventHubNamespaceCapacity_validation (0.00s)
=== RUN   TestAccAzureRMEventHubNamespaceSku_validation
--- PASS: TestAccAzureRMEventHubNamespaceSku_validation (0.00s)
=== RUN   TestAccAzureRMEventHubNamespace_basic
--- PASS: TestAccAzureRMEventHubNamespace_basic (790.14s)
=== RUN   TestAccAzureRMEventHubNamespace_readDefaultKeys
--- PASS: TestAccAzureRMEventHubNamespace_readDefaultKeys (345.84s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    1135.997s

👍 all good - not sure why Travis is failing

cc @jen20 / @stack72

@tombuildsstuff
Copy link
Contributor Author

@stack72 @jen20 I've rebased this and the previously failing Travis tests (AWS) pass fine, do I need to re-run the tests?

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

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

Hi @tombuildsstuff

This LGTM! I have 1 suggested addition - a test for import :)

When we add that (to prove the import works!) we can get it merged

P.

Read: resourceArmEventHubNamespaceRead,
Update: resourceArmEventHubNamespaceCreate,
Delete: resourceArmEventHubNamespaceDelete,
Importer: &schema.ResourceImporter{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a test to make sure that the import works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test but it's failing - posting this here for later as a reminder of what needs fixing:

TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMEventHubNamespace_importBasic -timeout 120m
=== RUN   TestAccAzureRMEventHubNamespace_importBasic
--- FAIL: TestAccAzureRMEventHubNamespace_importBasic (371.43s)
    testing.go:265: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.

        (map[string]string) {
        }


        (map[string]string) (len=2) {
         (string) (len=8) "location": (string) (len=6) "westus",
         (string) (len=19) "resource_group_name": (string) (len=28) "acctestRG-342930116917413830"
        }

FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/azurerm    371.449s

"sku": {
Type: schema.TypeString,
Required: true,
ForceNew: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

ForceNew is false by default :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this.

@stack72
Copy link
Contributor

stack72 commented Oct 25, 2016

Hi @tombuildsstuff

This LGTM now :) Thanks for the extra work here! I am going to rebase this PR to a single commit to keep the commit log clean :)

% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMEventHubNamespace_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/25 15:31:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMEventHubNamespace_ -timeout 120m
=== RUN   TestAccAzureRMEventHubNamespace_importBasic
--- PASS: TestAccAzureRMEventHubNamespace_importBasic (345.29s)
=== RUN   TestAccAzureRMEventHubNamespace_basic
--- PASS: TestAccAzureRMEventHubNamespace_basic (340.01s)
=== RUN   TestAccAzureRMEventHubNamespace_readDefaultKeys
--- PASS: TestAccAzureRMEventHubNamespace_readDefaultKeys (347.12s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    1032.443s

P.

@stack72 stack72 merged commit 59a81da into hashicorp:master Oct 25, 2016
@tombuildsstuff tombuildsstuff mentioned this pull request Nov 4, 2016
5 tasks
@ghost
Copy link

ghost commented Apr 21, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
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.

3 participants