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

mariadb_server: New attributes, flatten storage_profile block #6865

Merged
merged 4 commits into from May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 0 additions & 23 deletions azurerm/helpers/validate/database.go

This file was deleted.

28 changes: 0 additions & 28 deletions azurerm/helpers/validate/mariadb.go

This file was deleted.

Expand Up @@ -3,9 +3,10 @@ package mariadb
import (
"fmt"
"log"
"regexp"
"time"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mariadb/validate"

"github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
Expand Down Expand Up @@ -43,13 +44,10 @@ func resourceArmMariaDbConfiguration() *schema.Resource {
"resource_group_name": azure.SchemaResourceGroupName(),

"server_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[-a-zA-Z0-9]{3,50}$"),
"server_name must be 3 - 50 characters long, and contain only letters, numbers and hyphens",
),
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.MariaDbServerServerName,
},

"value": {
Expand Down
25 changes: 13 additions & 12 deletions azurerm/internal/services/mariadb/mariadb_database_resource.go
Expand Up @@ -6,13 +6,14 @@ import (
"regexp"
"time"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mariadb/validate"

"github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb"
"github.com/hashicorp/go-azure-helpers/response"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
Expand Down Expand Up @@ -49,13 +50,10 @@ func resourceArmMariaDbDatabase() *schema.Resource {
"resource_group_name": azure.SchemaResourceGroupName(),

"server_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[-a-zA-Z0-9]{3,50}$"),
"server_name must be 3 - 50 characters long, and contain only letters, numbers and hyphens",
),
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.MariaDbServerServerName,
},

"charset": {
Expand All @@ -69,10 +67,13 @@ func resourceArmMariaDbDatabase() *schema.Resource {
},

"collation": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.MariaDatabaseCollation,
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[A-Za-z0-9_. ]+$"),
"collation must contain only alphanumeric, underscore, space and dot characters",
),
},
},
}
Expand Down
Expand Up @@ -3,13 +3,17 @@ package mariadb
import (
"fmt"
"log"
"regexp"
"time"

"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mariadb/validate"

"github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
azValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
Expand All @@ -35,10 +39,13 @@ func resourceArmMariaDBFirewallRule() *schema.Resource {

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.MariaDBFirewallRuleName,
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[-a-z0-9]{1,128}$"),
"name must be 1-128 characters long and contain only letters, numbers and hyphens",
),
},

"resource_group_name": azure.SchemaResourceGroupName(),
Expand All @@ -47,19 +54,19 @@ func resourceArmMariaDBFirewallRule() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.MariaDBServerName,
ValidateFunc: validate.MariaDbServerServerName,
},

"start_ip_address": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.IPv4Address,
ValidateFunc: azValidate.IPv4Address,
},

"end_ip_address": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.IPv4Address,
ValidateFunc: azValidate.IPv4Address,
},
},
}
Expand Down
Expand Up @@ -46,12 +46,6 @@ func dataSourceMariaDbServer() *schema.Resource {
Computed: true,
},

"administrator_login_password": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},

"version": {
Type: schema.TypeString,
Computed: true,
Expand Down