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

catch up with the team. (#1) #165

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ website/node_modules

website/vendor

.vscode/

# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/
56 changes: 54 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,61 @@
## 0.1.0 (Unreleased)
## 0.1.3 (Unreleased)

FEATURES:

* **New Resource:** `azurerm_dns_ptr_record` [GH-141]
* **New Resource:** `azurerm_servicebus_queue` [GH-151]
* `azurerm_servicebus_topic` - added a `status` field to allow disabling the topic [GH-150]

IMPROVEMENTS:

* `azurerm_storage_table` - updating the name validation [GH-143]
* `azurerm_virtual_machine` - making `admin_password` optional for Linux VM's [GH-154]

## 0.1.2 (June 29, 2017)

FEATURES:

* **New Data Source:** `azurerm_managed_disk` ([#121](https://github.com/terraform-providers/terraform-provider-azurerm/issues/121))
* **New Resource:** `azurerm_application_insights` ([#3](https://github.com/terraform-providers/terraform-provider-azurerm/issues/3))
* **New Resource:** `azurerm_cosmosdb_account` ([#108](https://github.com/terraform-providers/terraform-provider-azurerm/issues/108))
* `azurerm_network_interface` now supports import ([#119](https://github.com/terraform-providers/terraform-provider-azurerm/issues/119))

IMPROVEMENTS:

* Ensuring consistency in when storing the `location` field in the state for the `azurerm_availability_set`, `azurerm_express_route_circuit`, `azurerm_load_balancer`, `azurerm_local_network_gateway`, `azurerm_managed_disk`, `azurerm_network_security_group`
`azurerm_public_ip`, `azurerm_resource_group`, `azurerm_route_table`, `azurerm_storage_account`, `azurerm_virtual_machine` and `azurerm_virtual_network` resources ([#123](https://github.com/terraform-providers/terraform-provider-azurerm/issues/123))
* `azurerm_redis_cache` - now supports backup settings for Premium Redis Cache's ([#130](https://github.com/terraform-providers/terraform-provider-azurerm/issues/130))
* `azurerm_storage_account` - exposing a formatted Connection String for Blob access ([#142](https://github.com/terraform-providers/terraform-provider-azurerm/issues/142))

BUG FIXES:

* `azurerm_cdn_endpoint` - fixing update of the `origin_host_header` ([#134](https://github.com/terraform-providers/terraform-provider-azurerm/issues/134))
* `azurerm_container_service` - exposes the FQDN of the `master_profile` as a computed field ([#125](https://github.com/terraform-providers/terraform-provider-azurerm/issues/125))
* `azurerm_key_vault` - fixing import / the validation on Access Policies ([#124](https://github.com/terraform-providers/terraform-provider-azurerm/issues/124))
* `azurerm_network_interface` - Normalizing the location field in the state ([#122](https://github.com/terraform-providers/terraform-provider-azurerm/issues/122))
* `azurerm_network_interface` - fixing a crash when importing a NIC with a Public IP ([#128](https://github.com/terraform-providers/terraform-provider-azurerm/issues/128))
* `azurerm_network_security_rule`: `network_security_group_name` is now `ForceNew` ([#138](https://github.com/terraform-providers/terraform-provider-azurerm/issues/138))
* `azurerm_subnet` now correctly detects changes to Network Securtiy Groups and Routing Table's ([#113](https://github.com/terraform-providers/terraform-provider-azurerm/issues/113))
* `azurerm_virtual_machine_scale_set` - making `storage_profile_os_disk`.`name` optional ([#129](https://github.com/terraform-providers/terraform-provider-azurerm/issues/129))

## 0.1.1 (June 21, 2017)

BUG FIXES:

* Sort ResourceID.Path keys for consistent output ([#116](https://github.com/terraform-providers/terraform-provider-azurerm/issues/116))

## 0.1.0 (June 20, 2017)

BACKWARDS INCOMPATIBILITIES / NOTES:

FEATURES:

* **New Data Source:** `azurerm_resource_group` [GH-15022](https://github.com/hashicorp/terraform/pull/15022)
* **New Data Source:** `azurerm_resource_group` [[#15022](https://github.com/terraform-providers/terraform-provider-azurerm/issues/15022)](https://github.com/hashicorp/terraform/pull/15022)

IMPROVEMENTS:

* Add diff supress func to endpoint_location [[#15094](https://github.com/terraform-providers/terraform-provider-azurerm/issues/15094)](https://github.com/hashicorp/terraform/pull/15094)

BUG FIXES:

* Fixing the Deadlock issue ([#6](https://github.com/terraform-providers/terraform-provider-azurerm/issues/6))
19 changes: 4 additions & 15 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
COVER_TEST?=$$(go list ./... |grep -v 'vendor')

default: build

Expand All @@ -15,17 +14,6 @@ test: fmtcheck
testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m

testrace: fmtcheck
TF_ACC= go test -race $(TEST) $(TESTARGS)

cover:
@go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \
go get -u golang.org/x/tools/cmd/cover; \
fi
go test $(COVER_TEST) -coverprofile=coverage.out
go tool cover -html=coverage.out
rm coverage.out

vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
Expand All @@ -47,12 +35,13 @@ errcheck:
vendor-status:
@govendor status

test-compile: fmtcheck
test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
echo " make test-compile TEST=./builtin/providers/aws"; \
echo " make test-compile TEST=./aws"; \
exit 1; \
fi
go test -c $(TEST) $(TESTARGS)

.PHONY: build test testacc testrace cover vet fmt fmtcheck errcheck vendor-status test-compile
.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Terraform Provider
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)

![Terraform](https://rawgithub.com/hashicorp/terraform/master/website/source/assets/images/logo-hashicorp.svg)
![Terraform](https://rawgit.com/hashicorp/terraform-website/master/source/assets/images/logo-hashicorp.svg)

Requirements
------------
Expand All @@ -16,17 +16,17 @@ Requirements
Building The Provider
---------------------

Clone repository to: `$GOPATH/src/github.com/hashicorp/terraform-provider-$PROVIDER_NAME`
Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-$PROVIDER_NAME`

```sh
$ mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp
$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone [email protected]:hashicorp/terraform-provider-$PROVIDER_NAME
```

Enter the provider directory and build the provider

```sh
$ cd $GOPATH/src/github.com/hashicorp/terraform-provider-$PROVIDER_NAME
$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-$PROVIDER_NAME
$ make build
```

Expand All @@ -42,7 +42,7 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

```sh
$ make bin
$ make build
...
$ $GOPATH/bin/terraform-provider-$PROVIDER_NAME
...
Expand Down
34 changes: 33 additions & 1 deletion azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import (
"net/http"
"net/http/httputil"

"github.com/Azure/azure-sdk-for-go/arm/appinsights"
"github.com/Azure/azure-sdk-for-go/arm/cdn"
"github.com/Azure/azure-sdk-for-go/arm/compute"
"github.com/Azure/azure-sdk-for-go/arm/containerregistry"
"github.com/Azure/azure-sdk-for-go/arm/containerservice"
"github.com/Azure/azure-sdk-for-go/arm/disk"
"github.com/Azure/azure-sdk-for-go/arm/dns"
"github.com/Azure/azure-sdk-for-go/arm/documentdb"
"github.com/Azure/azure-sdk-for-go/arm/eventhub"
"github.com/Azure/azure-sdk-for-go/arm/keyvault"
"github.com/Azure/azure-sdk-for-go/arm/network"
Expand Down Expand Up @@ -50,7 +53,8 @@ type ArmClient struct {
vmImageClient compute.VirtualMachineImagesClient
vmClient compute.VirtualMachinesClient

diskClient disk.DisksClient
diskClient disk.DisksClient
documentDBClient documentdb.DatabaseAccountsClient

appGatewayClient network.ApplicationGatewaysClient
ifaceClient network.InterfacesClient
Expand All @@ -68,6 +72,7 @@ type ArmClient struct {
vnetPeeringsClient network.VirtualNetworkPeeringsClient
routeTablesClient network.RouteTablesClient
routesClient network.RoutesClient
dnsClient dns.RecordSetsClient

cdnProfilesClient cdn.ProfilesClient
cdnEndpointsClient cdn.EndpointsClient
Expand Down Expand Up @@ -98,12 +103,15 @@ type ArmClient struct {
trafficManagerEndpointsClient trafficmanager.EndpointsClient

serviceBusNamespacesClient servicebus.NamespacesClient
serviceBusQueuesClient servicebus.QueuesClient
serviceBusTopicsClient servicebus.TopicsClient
serviceBusSubscriptionsClient servicebus.SubscriptionsClient

keyVaultClient keyvault.VaultsClient

sqlElasticPoolsClient sql.ElasticPoolsClient

appInsightsClient appinsights.ComponentsClient
}

func withRequestLogging() autorest.SendDecorator {
Expand Down Expand Up @@ -254,6 +262,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
csc.Sender = autorest.CreateSender(withRequestLogging())
client.containerServicesClient = csc

ddb := documentdb.NewDatabaseAccountsClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&ddb.Client)
ddb.Authorizer = auth
ddb.Sender = autorest.CreateSender(withRequestLogging())
client.documentDBClient = ddb

dkc := disk.NewDisksClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&dkc.Client)
dkc.Authorizer = auth
Expand Down Expand Up @@ -362,6 +376,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
rc.Sender = autorest.CreateSender(withRequestLogging())
client.routesClient = rc

dn := dns.NewRecordSetsClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&dn.Client)
dn.Authorizer = auth
dn.Sender = autorest.CreateSender(withRequestLogging())
client.dnsClient = dn

rgc := resources.NewGroupsClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&rgc.Client)
rgc.Authorizer = auth
Expand Down Expand Up @@ -452,6 +472,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
sbnc.Sender = autorest.CreateSender(withRequestLogging())
client.serviceBusNamespacesClient = sbnc

sbqc := servicebus.NewQueuesClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&sbqc.Client)
sbqc.Authorizer = auth
sbqc.Sender = autorest.CreateSender(withRequestLogging())
client.serviceBusQueuesClient = sbqc

sbtc := servicebus.NewTopicsClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&sbtc.Client)
sbtc.Authorizer = auth
Expand All @@ -476,6 +502,12 @@ func (c *Config) getArmClient() (*ArmClient, error) {
sqlepc.Sender = autorest.CreateSender(withRequestLogging())
client.sqlElasticPoolsClient = sqlepc

ai := appinsights.NewComponentsClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&ai.Client)
ai.Authorizer = auth
ai.Sender = autorest.CreateSender(withRequestLogging())
client.appInsightsClient = ai

return &client, nil
}

Expand Down
82 changes: 82 additions & 0 deletions azurerm/data_source_managed_disk.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package azurerm

import (
"fmt"
"net/http"

"github.com/hashicorp/terraform/helper/schema"
)

func dataSourceArmManagedDisk() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmManagedDiskRead,
Schema: map[string]*schema.Schema{

"name": {
Type: schema.TypeString,
Required: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
},

"storage_account_type": {
Type: schema.TypeString,
Computed: true,
},

"source_uri": {
Type: schema.TypeString,
Computed: true,
},

"source_resource_id": {
Type: schema.TypeString,
Computed: true,
},

"os_type": {
Type: schema.TypeString,
Computed: true,
},

"disk_size_gb": {
Type: schema.TypeInt,
Computed: true,
},

"tags": tagsSchema(),
},
}
}

func dataSourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) error {
diskClient := meta.(*ArmClient).diskClient

resGroup := d.Get("resource_group_name").(string)
name := d.Get("name").(string)

resp, err := diskClient.Get(resGroup, name)
if err != nil {
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
return fmt.Errorf("[ERROR] Error making Read request on Azure Managed Disk %s (resource group %s): %s", name, resGroup, err)
}

d.SetId(*resp.ID)
if resp.Properties != nil {
flattenAzureRmManagedDiskProperties(d, resp.Properties)
}

if resp.CreationData != nil {
flattenAzureRmManagedDiskCreationData(d, resp.CreationData)
}

flattenAndSetTags(d, resp.Tags)

return nil
}
Loading