Skip to content

Commit 221cb5a

Browse files
committed
rebase with latest. refactored code according to feedback for exadata-infra PR.
1 parent 60bf385 commit 221cb5a

11 files changed

+109
-139
lines changed

examples/odb/db_system_shapes_list_data_source.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/odb/gi_versions_list_data_source.tf

Lines changed: 0 additions & 8 deletions
This file was deleted.

internal/service/odb/db_system_shapes_list_data_source.go

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ package odb
44

55
import (
66
"context"
7-
"fmt"
8-
"github.com/hashicorp/terraform-plugin-framework/attr"
9-
107
"github.com/aws/aws-sdk-go-v2/service/odb"
11-
128
"github.com/hashicorp/terraform-plugin-framework/datasource"
139
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
1410
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -38,51 +34,19 @@ func (d *dataSourceDbSystemShapesList) Schema(ctx context.Context, req datasourc
3834
Attributes: map[string]schema.Attribute{
3935
"availability_zone_id": schema.StringAttribute{
4036
Optional: true,
41-
Description: "The physical ID of the AZ, for example, use1-az4. This ID persists across accounts",
37+
Description: "The physical ID of the AZ, for example, use1-az4. This ID persists across accounts.",
4238
},
4339
"db_system_shapes": schema.ListAttribute{
4440
Computed: true,
4541
CustomType: fwtypes.NewListNestedObjectTypeOf[dbSystemShapeDataSourceModel](ctx),
46-
Description: fmt.Sprint("The list of shapes and their properties.\n\n" +
47-
"(structure)\n" +
48-
"Information about a hardware system model (shape) that's\n " +
49-
"available for an Exadata infrastructure. The shape determines\n" +
50-
"resources, such as CPU cores, memory, and storage, to allocate to\n " +
51-
"the Exadata infrastructure.\n"),
52-
ElementType: types.ObjectType{
53-
54-
AttrTypes: map[string]attr.Type{
55-
"available_core_count": types.Int32Type,
56-
"available_core_count_per_node": types.Int32Type,
57-
"available_data_storage_in_tbs": types.Int32Type,
58-
"available_data_storage_per_server_in_tbs": types.Int32Type,
59-
"available_db_node_per_node_in_gbs": types.Int32Type,
60-
"available_db_node_storage_in_gbs": types.Int32Type,
61-
"available_memory_in_gbs": types.Int32Type,
62-
"available_memory_per_node_in_gbs": types.Int32Type,
63-
"core_count_increment": types.Int32Type,
64-
"max_storage_count": types.Int32Type,
65-
"maximum_node_count": types.Int32Type,
66-
"min_core_count_per_node": types.Int32Type,
67-
"min_data_storage_in_tbs": types.Int32Type,
68-
"min_db_node_storage_per_node_in_gbs": types.Int32Type,
69-
"min_memory_per_node_in_gbs": types.Int32Type,
70-
"min_storage_count": types.Int32Type,
71-
"minimum_core_count": types.Int32Type,
72-
"minimum_node_count": types.Int32Type,
73-
"name": types.StringType,
74-
"runtime_minimum_core_count": types.Int32Type,
75-
"shape_family": types.StringType,
76-
"shape_type": types.StringType,
77-
},
78-
},
42+
Description: "The list of shapes and their properties. Information about a hardware system model (shape) that's available for an Exadata infrastructure." +
43+
"The shape determines resources, such as CPU cores, memory, and storage, to allocate to the Exadata infrastructure.",
7944
},
8045
},
8146
}
8247
}
8348

8449
func (d *dataSourceDbSystemShapesList) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
85-
8650
conn := d.Meta().ODBClient(ctx)
8751

8852
var data dbSystemShapesListDataSourceModel

internal/service/odb/db_system_shapes_list_data_source_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package odb_test
44

55
import (
66
"fmt"
7-
87
"testing"
98

109
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -17,9 +16,7 @@ func TestAccODBDbSystemShapesListDataSource_basic(t *testing.T) {
1716
if testing.Short() {
1817
t.Skip("skipping long-running test in short mode")
1918
}
20-
2119
dataSourceName := "data.aws_odb_db_system_shapes_list.test"
22-
2320
resource.ParallelTest(t, resource.TestCase{
2421
PreCheck: func() {
2522
acctest.PreCheck(ctx, t)

internal/service/odb/gi_versions_list_data_source.go

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ package odb
44

55
import (
66
"context"
7-
"fmt"
8-
97
"github.com/aws/aws-sdk-go-v2/service/odb"
10-
118
"github.com/hashicorp/terraform-plugin-framework/datasource"
129
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
1310
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -39,38 +36,22 @@ func (d *dataSourceGiVersionsList) Schema(ctx context.Context, req datasource.Sc
3936
Optional: true,
4037
Description: "The system shape.",
4138
},
42-
},
43-
Blocks: map[string]schema.Block{
44-
"gi_versions": schema.ListNestedBlock{
45-
Description: fmt.Sprint(" (structure)\n " +
46-
"Information about a specific version of Oracle Grid\n" +
47-
"Infrastructure (GI) software that can be installed on a VM\n " +
48-
"cluster.\n\n " +
49-
"version -> (string)\n " +
50-
"The GI software version."),
51-
CustomType: fwtypes.NewListNestedObjectTypeOf[giVersionSummaryModel](ctx),
52-
NestedObject: schema.NestedBlockObject{
53-
Attributes: map[string]schema.Attribute{
54-
"version": schema.StringAttribute{
55-
Computed: true,
56-
},
57-
},
58-
},
39+
"gi_versions": schema.ListAttribute{
40+
Computed: true,
41+
CustomType: fwtypes.NewListNestedObjectTypeOf[giVersionSummaryModel](ctx),
42+
Description: "Information about a specific version of Oracle Grid Infrastructure (GI) software that can be installed on a VM cluster.",
5943
},
6044
},
6145
}
6246
}
6347

6448
func (d *dataSourceGiVersionsList) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
65-
6649
conn := d.Meta().ODBClient(ctx)
67-
6850
var data giVersionDataSourceModel
6951
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
7052
if resp.Diagnostics.HasError() {
7153
return
7254
}
73-
7455
var input odb.ListGiVersionsInput
7556
if !data.Shape.IsNull() {
7657
input.Shape = data.Shape.ValueStringPointer()
@@ -83,12 +64,10 @@ func (d *dataSourceGiVersionsList) Read(ctx context.Context, req datasource.Read
8364
)
8465
return
8566
}
86-
8767
resp.Diagnostics.Append(flex.Flatten(ctx, out, &data)...)
8868
if resp.Diagnostics.HasError() {
8969
return
9070
}
91-
9271
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
9372
}
9473

internal/service/odb/gi_versions_list_data_source_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ package odb_test
44

55
import (
66
"fmt"
7+
"testing"
8+
79
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
810
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
911
"github.com/hashicorp/terraform-provider-aws/names"
10-
"testing"
1112
)
1213

1314
func TestAccGiVersionsListDataSource_basicX9M(t *testing.T) {
@@ -26,24 +27,21 @@ func TestAccGiVersionsListDataSource_basicX9M(t *testing.T) {
2627
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
2728
Steps: []resource.TestStep{
2829
{
29-
Config: testAccGiVersionsListeConfig_basic("Exadata.X9M"),
30+
Config: testAccGiVersionsListConfigBasic("Exadata.X9M"),
3031
Check: resource.ComposeAggregateTestCheckFunc(
3132
resource.TestCheckResourceAttr(dataSourceName, "gi_versions.#", "2"),
3233
),
3334
},
3435
},
3536
})
36-
3737
}
3838

3939
func TestAccGiVersionsListDataSource_basicX11M(t *testing.T) {
4040
ctx := acctest.Context(t)
41-
4241
if testing.Short() {
4342
t.Skip("skipping long-running test in short mode")
4443
}
4544
dataSourceName := "data.aws_odb_gi_versions_list.test"
46-
4745
resource.Test(t, resource.TestCase{
4846
PreCheck: func() {
4947
acctest.PreCheck(ctx, t)
@@ -52,7 +50,7 @@ func TestAccGiVersionsListDataSource_basicX11M(t *testing.T) {
5250
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
5351
Steps: []resource.TestStep{
5452
{
55-
Config: testAccGiVersionsListeConfig_basic("Exadata.X11M"),
53+
Config: testAccGiVersionsListConfigBasic("Exadata.X11M"),
5654
Check: resource.ComposeAggregateTestCheckFunc(
5755
resource.TestCheckResourceAttr(dataSourceName, "gi_versions.#", "2"),
5856
),
@@ -61,11 +59,12 @@ func TestAccGiVersionsListDataSource_basicX11M(t *testing.T) {
6159
})
6260
}
6361

64-
func testAccGiVersionsListeConfig_basic(shape string) string {
62+
func testAccGiVersionsListConfigBasic(shape string) string {
6563
return fmt.Sprintf(`
6664
65+
6766
data "aws_odb_gi_versions_list" "test" {
68-
shape = %[1]q
67+
shape = %[1]q
6968
}
7069
`, shape)
7170
}

internal/service/odb/service_package.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

internal/service/odb/service_package_gen.go

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

names/data/names_data.hcl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9521,32 +9521,3 @@ service "evs" {
95219521
doc_prefix = ["evs_"]
95229522
brand = "Amazon"
95239523
}
9524-
service "odb" {
9525-
sdk {
9526-
id = "ODB"
9527-
arn_namespace = "odb"
9528-
}
9529-
names {
9530-
provider_name_upper = "ODB"
9531-
human_friendly = "Oracle Database@AWS"
9532-
}
9533-
endpoint_info {
9534-
endpoint_api_call = "ListGiVersions"
9535-
endpoint_region_overrides = {
9536-
"aws" = "us-east-1"
9537-
}
9538-
}
9539-
go_packages {
9540-
v1_package = ""
9541-
v2_package = "odb"
9542-
}
9543-
client{
9544-
skip_client_generate = true
9545-
}
9546-
resource_prefix{
9547-
correct = "aws_odb_"
9548-
}
9549-
provider_package_correct = "odb"
9550-
doc_prefix = ["odb_"]
9551-
brand = "AWS"
9552-
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
subcategory: "Oracle Database@AWS"
3+
layout: "AWS: aws_odb_db_system_shapes_list"
4+
page_title: "AWS: aws_odb_db_system_shapes_list"
5+
description: |-
6+
Terraform data source to retrieve available system shapes Oracle Database@AWS.
7+
---
8+
9+
# Data Source: aws_odb_db_system_shapes_list
10+
11+
Terraform data source to retrieve available system shapes Oracle Database@AWS.
12+
13+
You can find out more about Oracle Database@AWS from [User Guide](https://docs.aws.amazon.com/odb/latest/UserGuide/what-is-odb.html).
14+
15+
## Example Usage
16+
17+
### Basic Usage
18+
19+
```terraform
20+
data "aws_odb_db_system_shapes_list" "example" {
21+
22+
}
23+
```
24+
25+
## Argument Reference
26+
27+
The following arguments are optional:
28+
29+
* `availability_zone_id` - (Optional) The physical ID of the AZ, for example, use1-az4. This ID persists across accounts.
30+
* `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference).
31+
32+
## Attribute Reference
33+
34+
This data source exports the following attributes in addition to the arguments above:
35+
36+
* `db_system_shapes` - IThe list of shapes and their properties. Information about a hardware system model (shape) that's available for an Exadata infrastructure. The shape determines resources, such as CPU cores, memory, and storage, to allocate to the Exadata infrastructure.

0 commit comments

Comments
 (0)