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

azurerm_communication_service - add forceNew for data_location #20711

Merged
merged 1 commit into from
Mar 1, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func resourceArmCommunicationService() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
// TODO: should this become Required and remove the default in 4.0?
Optional: true,
ForceNew: true,
Default: "United States",
ValidateFunc: validation.StringInSlice([]string{
"Africa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,84 +78,7 @@ func TestAccCommunicationService_update(t *testing.T) {
},
data.ImportStep(),
{
Config: r.update(data, "Australia"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Africa"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Brazil"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Canada"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "France"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Germany"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "India"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Japan"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Korea"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Norway"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "Switzerland"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data, "UAE"),
Config: r.update(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
Expand Down Expand Up @@ -223,20 +146,20 @@ resource "azurerm_communication_service" "test" {
`, r.template(data), data.RandomInteger)
}

func (r CommunicationServiceResource) update(data acceptance.TestData, dataLocation string) string {
func (r CommunicationServiceResource) update(data acceptance.TestData) string {
return fmt.Sprintf(`
%s

resource "azurerm_communication_service" "test" {
name = "acctest-CommunicationService-%d"
resource_group_name = azurerm_resource_group.test.name
data_location = "%s"
data_location = "United States"

tags = {
env = "Test2"
}
}
`, r.template(data), data.RandomInteger, dataLocation)
`, r.template(data), data.RandomInteger)
}

func (r CommunicationServiceResource) template(data acceptance.TestData) string {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/communication_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The following arguments are supported:

---

* `data_location` - (Optional) The location where the Communication service stores its data at rest. Possible values are `Africa`, `Asia Pacific`, `Australia`, `Brazil`, `Canada`, `Europe`, `France`, `Germany`, `India`, `Japan`, `Korea`, `Norway`, `Switzerland`, `UAE`, `UK` and `United States`. Defaults to `United States`.
* `data_location` - (Optional) The location where the Communication service stores its data at rest. Possible values are `Africa`, `Asia Pacific`, `Australia`, `Brazil`, `Canada`, `Europe`, `France`, `Germany`, `India`, `Japan`, `Korea`, `Norway`, `Switzerland`, `UAE`, `UK` and `United States`. Defaults to `United States`. Changing this forces a new Communication Service to be created.

* `tags` - (Optional) A mapping of tags which should be assigned to the Communication Service.

Expand Down