Skip to content

Commit

Permalink
Merge pull request #330 from terraform-providers/f-validate-resource-…
Browse files Browse the repository at this point in the history
…group-name

Adding validation to all resource_group_name attributes
  • Loading branch information
mbfrahry authored Sep 13, 2017
2 parents a90b5b0 + 442c69c commit 5e33821
Show file tree
Hide file tree
Showing 75 changed files with 193 additions and 444 deletions.
5 changes: 1 addition & 4 deletions azurerm/data_source_arm_public_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ func dataSourceArmPublicIP() *schema.Resource {
Required: true,
},

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

"domain_name_label": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/data_source_arm_resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ func dataSourceArmResourceGroup() *schema.Resource {
Read: dataSourceArmResourceGroupRead,

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},

"name": resourceGroupNameForDataSourceSchema(),
"location": locationForDataSourceSchema(),
"tags": tagsForDataSourceSchema(),
},
Expand Down
5 changes: 1 addition & 4 deletions azurerm/data_source_managed_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ func dataSourceArmManagedDisk() *schema.Resource {
Required: true,
},

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

"storage_account_type": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_app_service_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmAppServicePlan() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_application_insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ func resourceArmApplicationInsights() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_availability_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ func resourceArmAvailabilitySet() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_cdn_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ func resourceArmCdnEndpoint() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"profile_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_cdn_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ func resourceArmCdnProfile() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"sku": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ func resourceArmContainerRegistry() *schema.Resource {
ValidateFunc: validateAzureRMContainerRegistryName,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_container_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ func resourceArmContainerService() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"orchestration_platform": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_cosmos_db_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ func resourceArmCosmosDBAccount() *schema.Resource {
StateFunc: azureRMNormalizeLocation,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"offer_type": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_a_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsARecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_aaaa_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsAAAARecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_cname_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsCNameRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_mx_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ func resourceArmDnsMxRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_ns_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsNsRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_ptr_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsPtrRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_srv_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ func resourceArmDnsSrvRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_dns_txt_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ func resourceArmDnsTxtRecord() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"zone_name": {
Type: schema.TypeString,
Expand Down
7 changes: 1 addition & 6 deletions azurerm/resource_arm_dns_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ func resourceArmDnsZone() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
DiffSuppressFunc: resourceAzurermResourceGroupNameDiffSuppress,
},
"resource_group_name": resourceGroupNameDiffSuppressSchema(),

"number_of_record_sets": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_eventgrid_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ func resourceArmEventGridTopic() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"tags": tagsSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ func resourceArmEventHub() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_eventhub_authorization_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ func resourceArmEventHubAuthorizationRule() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_eventhub_consumer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ func resourceArmEventHubConsumerGroup() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_eventhub_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ func resourceArmEventHubNamespace() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"sku": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_express_route_circuit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ func resourceArmExpressRouteCircuit() *schema.Resource {
ForceNew: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"location": locationSchema(),

Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ func resourceArmImage() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"source_virtual_machine_id": {
Type: schema.TypeString,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_key_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ func resourceArmKeyVault() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"sku": {
Type: schema.TypeSet,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ func resourceArmLoadBalancer() *schema.Resource {

"location": locationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"frontend_ip_configuration": {
Type: schema.TypeList,
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_loadbalancer_backend_address_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ func resourceArmLoadBalancerBackendAddressPool() *schema.Resource {

"location": deprecatedLocationSchema(),

"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"resource_group_name": resourceGroupNameSchema(),

"loadbalancer_id": {
Type: schema.TypeString,
Expand Down
Loading

0 comments on commit 5e33821

Please sign in to comment.