Skip to content

Commit cc181cf

Browse files
authored
Merge pull request #13 from oracle-community/sync-4
merged autonomous vm cluster
2 parents 5220bab + f24bc0e commit cc181cf

23 files changed

+2316
-3
lines changed

.changelog/43809.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:new-resource
2+
aws_odb_cloud_autonomous_vm_cluster
3+
```
4+
5+
```release-note:new-data-source
6+
aws_odb_cloud_autonomous_vm_cluster
7+
```

.changelog/44272.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-data-source
2+
aws_billing_views
3+
```

.changelog/44310.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_sagemaker_endpoint_configuration: Fix panic when empty `async_inference_config.output_config.notification_config` block is specified
3+
```

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22

33
FEATURES:
44

5+
* **New Data Source:** `aws_billing_views` ([#44272](https://github.com/hashicorp/terraform-provider-aws/issues/44272))
6+
* **New Data Source:** `aws_odb_cloud_autonomous_vm_cluster` ([#43809](https://github.com/hashicorp/terraform-provider-aws/issues/43809))
57
* **New Data Source:** `aws_odb_cloud_exadata_infrastructure` ([#43650](https://github.com/hashicorp/terraform-provider-aws/issues/43650))
8+
* **New Data Source:** `aws_odb_network` ([#43715](https://github.com/hashicorp/terraform-provider-aws/issues/43715))
69
* **New Resource:** `aws_controltower_baseline` ([#42397](https://github.com/hashicorp/terraform-provider-aws/issues/42397))
10+
* **New Resource:** `aws_odb_cloud_autonomous_vm_cluster` ([#43809](https://github.com/hashicorp/terraform-provider-aws/issues/43809))
711
* **New Resource:** `aws_odb_cloud_exadata_infrastructure` ([#43650](https://github.com/hashicorp/terraform-provider-aws/issues/43650))
12+
* **New Resource:** `aws_odb_network` ([#43715](https://github.com/hashicorp/terraform-provider-aws/issues/43715))
813

914
ENHANCEMENTS:
1015

1116
* resource/aws_rds_global_cluster: Remove provider-side conflict between `source_db_cluster_identifier` and `engine` arguments ([#44252](https://github.com/hashicorp/terraform-provider-aws/issues/44252))
1217
* resource/aws_scheduler_schedule: Add `action_after_completion` argument ([#44264](https://github.com/hashicorp/terraform-provider-aws/issues/44264))
1318

19+
BUG FIXES:
20+
21+
* resource/aws_sagemaker_endpoint_configuration: Fix panic when empty `async_inference_config.output_config.notification_config` block is specified ([#44310](https://github.com/hashicorp/terraform-provider-aws/issues/44310))
22+
1423
## 6.13.0 (September 11, 2025)
1524

1625
ENHANCEMENTS:
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
4+
# Autonomous VM Cluster with default maintenance window and minimum parameters
5+
resource "aws_odb_cloud_autonomous_vm_cluster" "avmc_with_minimum_parameters" {
6+
cloud_exadata_infrastructure_id = "<exadata_infra_id>" # refer your exadata infra id
7+
odb_network_id = "<odb_net_id>" # refer_your_odb_net_id
8+
display_name = "Ofake-avmc-my_avmc"
9+
autonomous_data_storage_size_in_tbs = 5
10+
memory_per_oracle_compute_unit_in_gbs = 2
11+
total_container_databases = 1
12+
cpu_core_count_per_node = 40
13+
license_model = "LICENSE_INCLUDED"
14+
# ids of db server. refer your exa infra. This is a manadatory fileld. Refer your cloud exadata infrastructure for db server id
15+
db_servers = ["<my_db_server_id>"]
16+
scan_listener_port_tls = 8561
17+
scan_listener_port_non_tls = 1024
18+
maintenance_window {
19+
preference = "NO_PREFERENCE"
20+
}
21+
22+
}
23+
24+
# Autonomous VM Cluster with all parameters
25+
resource "aws_odb_cloud_autonomous_vm_cluster" "test" {
26+
description = "my first avmc"
27+
time_zone = "UTC"
28+
cloud_exadata_infrastructure_id = "<aws_odb_cloud_exadata_infrastructure.test.id>"
29+
odb_network_id = "<aws_odb_network.test.id>"
30+
display_name = "Ofake_my avmc"
31+
autonomous_data_storage_size_in_tbs = 5
32+
memory_per_oracle_compute_unit_in_gbs = 2
33+
total_container_databases = 1
34+
cpu_core_count_per_node = 40
35+
license_model = "LICENSE_INCLUDED"
36+
db_servers = ["<my_db_server_1>", "<my_db_server_2>"]
37+
scan_listener_port_tls = 8561
38+
scan_listener_port_non_tls = 1024
39+
maintenance_window {
40+
days_of_week = [{ name = "MONDAY" }, { name = "TUESDAY" }]
41+
hours_of_day = [4, 16]
42+
lead_time_in_weeks = 3
43+
months = [{ name = "FEBRUARY" }, { name = "MAY" }, { name = "AUGUST" }, { name = "NOVEMBER" }]
44+
preference = "CUSTOM_PREFERENCE"
45+
weeks_of_month = [2, 4]
46+
}
47+
tags = {
48+
"env" = "dev"
49+
}
50+
51+
}

internal/service/acm/sweep.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99

1010
"github.com/aws/aws-sdk-go-v2/aws"
1111
"github.com/aws/aws-sdk-go-v2/service/acm"
12+
awstypes "github.com/aws/aws-sdk-go-v2/service/acm/types"
1213
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
14+
"github.com/hashicorp/terraform-provider-aws/internal/enum"
1315
"github.com/hashicorp/terraform-provider-aws/internal/sweep"
1416
"github.com/hashicorp/terraform-provider-aws/internal/sweep/awsv2"
1517
)
@@ -48,7 +50,12 @@ func sweepCertificates(region string) error {
4850
conn := client.ACMClient(ctx)
4951
var sweepResources []sweep.Sweepable
5052

51-
input := acm.ListCertificatesInput{}
53+
input := acm.ListCertificatesInput{
54+
Includes: &awstypes.Filters{
55+
// By default, ListCertificates only returns RSA_1024 and RSA_2048 certificates
56+
KeyTypes: enum.EnumValues[awstypes.KeyAlgorithm](),
57+
},
58+
}
5259
pages := acm.NewListCertificatesPaginator(conn, &input)
5360
for pages.HasMorePages() {
5461
page, err := pages.NextPage(ctx)

internal/service/apigateway/sweep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func sweepDomainNames(region string) error {
305305
for _, v := range page.Items {
306306
r := resourceDomainName()
307307
d := r.Data(nil)
308-
d.SetId(aws.ToString(v.DomainName))
308+
d.SetId(domainNameCreateResourceID(aws.ToString(v.DomainName), aws.ToString(v.DomainNameId)))
309309

310310
sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client))
311311
}

internal/service/athena/data_catalog.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ func resourceDataCatalogDelete(ctx context.Context, d *schema.ResourceData, meta
198198
if errs.IsA[*types.ResourceNotFoundException](err) {
199199
return diags
200200
}
201+
if errs.IsAErrorMessageContains[*types.InvalidRequestException](err, "was not found") {
202+
return diags
203+
}
201204

202205
if err != nil {
203206
return sdkdiag.AppendErrorf(diags, "deleting Athena Data Catalog (%s): %s", d.Id(), err)

internal/service/billing/service_package_gen.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package billing
5+
6+
import (
7+
"context"
8+
9+
"github.com/aws/aws-sdk-go-v2/service/billing"
10+
awstypes "github.com/aws/aws-sdk-go-v2/service/billing/types"
11+
"github.com/hashicorp/terraform-plugin-framework/datasource"
12+
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
13+
"github.com/hashicorp/terraform-plugin-framework/types"
14+
"github.com/hashicorp/terraform-provider-aws/internal/framework"
15+
"github.com/hashicorp/terraform-provider-aws/internal/framework/flex"
16+
fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types"
17+
"github.com/hashicorp/terraform-provider-aws/internal/smerr"
18+
)
19+
20+
// @FrameworkDataSource("aws_billing_views", name="Views")
21+
func newDataSourceViews(context.Context) (datasource.DataSourceWithConfigure, error) {
22+
return &dataSourceViews{}, nil
23+
}
24+
25+
const (
26+
DSNameViews = "Views Data Source"
27+
)
28+
29+
type dataSourceViews struct {
30+
framework.DataSourceWithModel[dataSourceViewsModel]
31+
}
32+
33+
func (d *dataSourceViews) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
34+
resp.Schema = schema.Schema{
35+
Attributes: map[string]schema.Attribute{
36+
"billing_view_types": schema.ListAttribute{
37+
CustomType: fwtypes.ListOfStringEnumType[awstypes.BillingViewType](),
38+
Optional: true,
39+
ElementType: types.StringType,
40+
},
41+
"billing_view": framework.ResourceComputedListOfObjectsAttribute[dataSourceBillingViewModel](ctx, nil, nil),
42+
},
43+
}
44+
}
45+
46+
func (d *dataSourceViews) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
47+
conn := d.Meta().BillingClient(ctx)
48+
49+
var data dataSourceViewsModel
50+
smerr.EnrichAppend(ctx, &resp.Diagnostics, req.Config.Get(ctx, &data))
51+
if resp.Diagnostics.HasError() {
52+
return
53+
}
54+
55+
var billingViewTypes []awstypes.BillingViewType
56+
smerr.EnrichAppend(ctx, &resp.Diagnostics, data.BillingViewTypes.ElementsAs(ctx, &billingViewTypes, false))
57+
if resp.Diagnostics.HasError() {
58+
return
59+
}
60+
61+
out, err := findViewsByViewTypes(ctx, conn, billingViewTypes)
62+
if err != nil {
63+
smerr.AddError(ctx, &resp.Diagnostics, err, smerr.ID, data.BillingViewTypes.String())
64+
return
65+
}
66+
67+
smerr.EnrichAppend(ctx, &resp.Diagnostics, flex.Flatten(ctx, out, &data.BillingView, flex.WithFieldNamePrefix("Views")), smerr.ID, data.BillingViewTypes.String())
68+
if resp.Diagnostics.HasError() {
69+
return
70+
}
71+
72+
smerr.EnrichAppend(ctx, &resp.Diagnostics, resp.State.Set(ctx, &data), smerr.ID, data.BillingViewTypes.String())
73+
}
74+
75+
func findViewsByViewTypes(ctx context.Context, conn *billing.Client, billingViewTypes []awstypes.BillingViewType) ([]awstypes.BillingViewListElement, error) {
76+
input := billing.ListBillingViewsInput{}
77+
if len(billingViewTypes) > 0 {
78+
input.BillingViewTypes = billingViewTypes
79+
}
80+
81+
return findViews(ctx, conn, &input)
82+
}
83+
84+
func findViews(ctx context.Context, conn *billing.Client, input *billing.ListBillingViewsInput) ([]awstypes.BillingViewListElement, error) {
85+
var results []awstypes.BillingViewListElement
86+
87+
paginator := billing.NewListBillingViewsPaginator(conn, input)
88+
for paginator.HasMorePages() {
89+
page, err := paginator.NextPage(ctx)
90+
if err != nil {
91+
return nil, err
92+
}
93+
results = append(results, page.BillingViews...)
94+
}
95+
96+
return results, nil
97+
}
98+
99+
type dataSourceViewsModel struct {
100+
BillingViewTypes fwtypes.ListOfStringEnum[awstypes.BillingViewType] `tfsdk:"billing_view_types"`
101+
BillingView fwtypes.ListNestedObjectValueOf[dataSourceBillingViewModel] `tfsdk:"billing_view"`
102+
}
103+
104+
type dataSourceBillingViewModel struct {
105+
ARN types.String `tfsdk:"arn"`
106+
BillingViewType types.String `tfsdk:"billing_view_type"`
107+
Description types.String `tfsdk:"description"`
108+
Name types.String `tfsdk:"name"`
109+
OwnerAccountId types.String `tfsdk:"owner_account_id"`
110+
}

0 commit comments

Comments
 (0)