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: key_vault resource and client_config datasource #9478

Merged
merged 2 commits into from
Oct 25, 2016

Conversation

pmcatominey
Copy link
Contributor

No description provided.

azurerm_client_config provides access to:

 - client_id
 - tenant_id
 - subscription_id

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMClientConfig -timeout 120m
=== RUN   TestAccAzureRMClientConfig_basic
--- PASS: TestAccAzureRMClientConfig_basic (27.79s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	27.862s
```
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.

The one issue here is that the ARM provider doesn't register the azure namespace for Microsoft.KeyVault

you need to add this to the following location:

https://github.com/hashicorp/terraform/blob/master/builtin/providers/azurerm/provider.go#L190

Without this, the tests won't run:

=== RUN   TestAccAzureRMKeyVault_update
--- FAIL: TestAccAzureRMKeyVault_update (66.41s)
    testing.go:265: Step 0 error: Error applying: 1 error(s) occurred:

        * azurerm_key_vault.test: keyvault.VaultsClient#CreateOrUpdate: Failure responding to request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=409 Code="MissingSubscriptionRegistration" Message="The subscription is not registered to use namespace 'Microsoft.KeyVault'. See https://aka.ms/rps-not-found for how to register subscriptions."
FAIL
exit status 1

apart from that, it LGTM!

- vendor keyvault sdk package

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMKeyV -timeout 120m
=== RUN   TestAccAzureRMKeyVault_importBasic
--- PASS: TestAccAzureRMKeyVault_importBasic (89.01s)
=== RUN   TestAccAzureRMKeyVault_basic
--- PASS: TestAccAzureRMKeyVault_basic (83.36s)
=== RUN   TestAccAzureRMKeyVault_update
--- PASS: TestAccAzureRMKeyVault_update (102.83s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	275.285s
```
@pmcatominey
Copy link
Contributor Author

@stack72 registered the provider, cheers.

@stack72
Copy link
Contributor

stack72 commented Oct 25, 2016

LGTM! Thanks @pmcatominey :)

[stacko@Pauls-MacBook-Pro:~/Code/go/src/github.com/hashicorp/terraform on BedeGaming-azurerm-keyvault]
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMClientConfig_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/25 13:27:59 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMClientConfig_ -timeout 120m
=== RUN   TestAccAzureRMClientConfig_basic
--- PASS: TestAccAzureRMClientConfig_basic (24.60s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    24.614s
[stacko@Pauls-MacBook-Pro:~/Code/go/src/github.com/hashicorp/terraform on BedeGaming-azurerm-keyvault]
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMKeyVault_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/25 13:29:09 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMKeyVault_ -timeout 120m
=== RUN   TestAccAzureRMKeyVault_importBasic
--- PASS: TestAccAzureRMKeyVault_importBasic (85.42s)
=== RUN   TestAccAzureRMKeyVault_basic
--- PASS: TestAccAzureRMKeyVault_basic (82.71s)
=== RUN   TestAccAzureRMKeyVault_update
--- PASS: TestAccAzureRMKeyVault_update (101.54s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    269.680s

@stack72 stack72 merged commit ecb467a into hashicorp:master Oct 25, 2016
@pmcatominey pmcatominey deleted the azurerm-keyvault branch October 25, 2016 12:35
@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.

2 participants