Skip to content

Commit

Permalink
d/docdb_orderable_db_instance: Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 2, 2020
1 parent 9cee2f8 commit 5a315a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions aws/data_source_aws_docdb_orderable_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func dataSourceAwsDocdbOrderableDbInstance() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
},

"db_instance_class": {
"instance_class": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Expand All @@ -42,7 +42,7 @@ func dataSourceAwsDocdbOrderableDbInstance() *schema.Resource {
Computed: true,
},

"preferred_db_instance_classes": {
"preferred_instance_classes": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Expand All @@ -62,7 +62,7 @@ func dataSourceAwsDocdbOrderableDbInstanceRead(d *schema.ResourceData, meta inte

input := &docdb.DescribeOrderableDBInstanceOptionsInput{}

if v, ok := d.GetOk("db_instance_class"); ok {
if v, ok := d.GetOk("instance_class"); ok {
input.DBInstanceClass = aws.String(v.(string))
}

Expand Down Expand Up @@ -106,7 +106,7 @@ func dataSourceAwsDocdbOrderableDbInstanceRead(d *schema.ResourceData, meta inte

// preferred classes
var found *docdb.OrderableDBInstanceOption
if l := d.Get("preferred_db_instance_classes").([]interface{}); len(l) > 0 {
if l := d.Get("preferred_instance_classes").([]interface{}); len(l) > 0 {
for _, elem := range l {
preferredInstanceClass, ok := elem.(string)

Expand Down Expand Up @@ -141,7 +141,7 @@ func dataSourceAwsDocdbOrderableDbInstanceRead(d *schema.ResourceData, meta inte

d.SetId(aws.StringValue(found.DBInstanceClass))

d.Set("db_instance_class", found.DBInstanceClass)
d.Set("instance_class", found.DBInstanceClass)

var availabilityZones []string
for _, az := range found.AvailabilityZones {
Expand Down
14 changes: 7 additions & 7 deletions aws/data_source_aws_docdb_orderable_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAccAWSDocdbOrderableDbInstanceDataSource_basic(t *testing.T) {
{
Config: testAccAWSDocdbOrderableDbInstanceDataSourceConfigBasic(class, engine, engineVersion, license),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(dataSourceName, "db_instance_class", class),
resource.TestCheckResourceAttr(dataSourceName, "instance_class", class),
resource.TestCheckResourceAttr(dataSourceName, "engine", engine),
resource.TestCheckResourceAttr(dataSourceName, "engine_version", engineVersion),
resource.TestCheckResourceAttr(dataSourceName, "license_model", license),
Expand Down Expand Up @@ -52,7 +52,7 @@ func TestAccAWSDocdbOrderableDbInstanceDataSource_preferred(t *testing.T) {
resource.TestCheckResourceAttr(dataSourceName, "engine", engine),
resource.TestCheckResourceAttr(dataSourceName, "engine_version", engineVersion),
resource.TestCheckResourceAttr(dataSourceName, "license_model", license),
resource.TestCheckResourceAttr(dataSourceName, "db_instance_class", preferredOption),
resource.TestCheckResourceAttr(dataSourceName, "instance_class", preferredOption),
),
},
},
Expand Down Expand Up @@ -80,10 +80,10 @@ func testAccPreCheckAWSDocdbOrderableDbInstance(t *testing.T) {
func testAccAWSDocdbOrderableDbInstanceDataSourceConfigBasic(class, engine, version, license string) string {
return fmt.Sprintf(`
data "aws_docdb_orderable_db_instance" "test" {
db_instance_class = %q
engine = %q
engine_version = %q
license_model = %q
instance_class = %q
engine = %q
engine_version = %q
license_model = %q
}
`, class, engine, version, license)
}
Expand All @@ -95,7 +95,7 @@ data "aws_docdb_orderable_db_instance" "test" {
engine_version = %q
license_model = %q
preferred_db_instance_classes = ["db.xyz.xlarge", %q, "db.t3.small"]
preferred_instance_classes = ["db.xyz.xlarge", %q, "db.t3.small"]
}
`, engine, version, license, preferredOption)
}
6 changes: 3 additions & 3 deletions website/docs/d/docdb_orderable_db_instance.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data "aws_docdb_orderable_db_instance" "test" {
engine_version = "3.6.0"
license_model = "na"
preferred_db_instance_classes = ["db.r5.large", "db.r4.large", "db.t3.medium"]
preferred_instance_classes = ["db.r5.large", "db.r4.large", "db.t3.medium"]
}
```

Expand All @@ -27,10 +27,10 @@ data "aws_docdb_orderable_db_instance" "test" {
The following arguments are supported:

* `engine` - (Required) DB engine. Engine values include `docdb`.
* `db_instance_class` - (Optional) DB instance class. Examples of classes are `db.r5.12xlarge`, `db.r5.24xlarge`, `db.r5.2xlarge`, `db.r5.4xlarge`, `db.r5.large`, `db.r5.xlarge`, and `db.t3.medium`.
* `instance_class` - (Optional) DB instance class. Examples of classes are `db.r5.12xlarge`, `db.r5.24xlarge`, `db.r5.2xlarge`, `db.r5.4xlarge`, `db.r5.large`, `db.r5.xlarge`, and `db.t3.medium`.
* `engine_version` - (Optional) Version of the DB engine. For example, `3.6.0`.
* `license_model` - (Optional) License model. Examples of license models are `general-public-license`, `na`, `bring-your-own-license`, and `amazon-license`.
* `preferred_db_instance_classes` - (Optional) Ordered list of preferred DocumentDB DB instance classes. The first match in this list will be returned. If no preferred matches are found and the original search returned more than one result, an error is returned.
* `preferred_instance_classes` - (Optional) Ordered list of preferred DocumentDB DB instance classes. The first match in this list will be returned. If no preferred matches are found and the original search returned more than one result, an error is returned.
* `vpc` - (Optional) Boolean that indicates whether to show only VPC or non-VPC offerings.

## Attribute Reference
Expand Down

0 comments on commit 5a315a2

Please sign in to comment.