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

ecs/account_setting_default: Remove validation on value value #33393

Merged
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
3 changes: 3 additions & 0 deletions .changelog/33393.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_ecs_account_setting_default: Remove plan-time validation of `value`
```
7 changes: 3 additions & 4 deletions internal/service/ecs/account_setting_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
)

// @SDKResource("aws_ecs_account_setting_default")
// @SDKResource("aws_ecs_account_setting_default", name="Account Setting Defauilt")
func ResourceAccountSettingDefault() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceAccountSettingDefaultCreate,
Expand All @@ -42,9 +42,8 @@ func ResourceAccountSettingDefault() *schema.Resource {
Computed: true,
},
"value": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"enabled", "disabled"}, false),
Type: schema.TypeString,
Required: true,
},
},
}
Expand Down
34 changes: 24 additions & 10 deletions internal/service/ecs/account_setting_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,26 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/conns"
)

func TestAccECSAccountSettingDefault_containerInstanceLongARNFormat(t *testing.T) {
func TestAccECSAccountSettingDefault_serial(t *testing.T) {
t.Parallel()

testCases := map[string]func(*testing.T){
"containerInstanceLongARNFormat": testAccAccountSettingDefault_containerInstanceLongARNFormat,
"serviceLongARNFormat": testAccAccountSettingDefault_serviceLongARNFormat,
"taskLongARNFormat": testAccAccountSettingDefault_taskLongARNFormat,
"vpcTrunking": testAccAccountSettingDefault_vpcTrunking,
"containerInsights": testAccAccountSettingDefault_containerInsights,
}

acctest.RunSerialTests1Level(t, testCases, 0)
}

func testAccAccountSettingDefault_containerInstanceLongARNFormat(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_ecs_account_setting_default.test"
settingName := ecs.SettingNameContainerInstanceLongArnFormat

resource.ParallelTest(t, resource.TestCase{
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Expand All @@ -47,12 +61,12 @@ func TestAccECSAccountSettingDefault_containerInstanceLongARNFormat(t *testing.T
})
}

func TestAccECSAccountSettingDefault_serviceLongARNFormat(t *testing.T) {
func testAccAccountSettingDefault_serviceLongARNFormat(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_ecs_account_setting_default.test"
settingName := ecs.SettingNameServiceLongArnFormat

resource.ParallelTest(t, resource.TestCase{
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Expand All @@ -76,12 +90,12 @@ func TestAccECSAccountSettingDefault_serviceLongARNFormat(t *testing.T) {
})
}

func TestAccECSAccountSettingDefault_taskLongARNFormat(t *testing.T) {
func testAccAccountSettingDefault_taskLongARNFormat(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_ecs_account_setting_default.test"
settingName := ecs.SettingNameTaskLongArnFormat

resource.ParallelTest(t, resource.TestCase{
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Expand All @@ -105,12 +119,12 @@ func TestAccECSAccountSettingDefault_taskLongARNFormat(t *testing.T) {
})
}

func TestAccECSAccountSettingDefault_vpcTrunking(t *testing.T) {
func testAccAccountSettingDefault_vpcTrunking(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_ecs_account_setting_default.test"
settingName := ecs.SettingNameAwsvpcTrunking

resource.ParallelTest(t, resource.TestCase{
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Expand All @@ -134,12 +148,12 @@ func TestAccECSAccountSettingDefault_vpcTrunking(t *testing.T) {
})
}

func TestAccECSAccountSettingDefault_containerInsights(t *testing.T) {
func testAccAccountSettingDefault_containerInsights(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_ecs_account_setting_default.test"
settingName := ecs.SettingNameContainerInsights

resource.ParallelTest(t, resource.TestCase{
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Expand Down
1 change: 1 addition & 0 deletions internal/service/ecs/service_package_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions website/docs/r/ecs_account_setting_default.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ resource "aws_ecs_account_setting_default" "test" {

This resource supports the following arguments:

* `name` - (Required) Name of the account setting to set. Valid values are `serviceLongArnFormat`, `taskLongArnFormat`, `containerInstanceLongArnFormat`, `awsvpcTrunking` and `containerInsights`.
* `value` - (Required) State of the setting. Valid values are `enabled` and `disabled`.
* `name` - (Required) Name of the account setting to set.
* `value` - (Required) State of the setting.

## Attribute Reference

Expand Down
Loading