Skip to content

Conversation

@johnsonaj
Copy link
Member

@johnsonaj johnsonaj commented Nov 21, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

When variables are used for configuration input ValidateConfig produces an error. This behavior is incorrect since the argument is present but variables have not be evaluated as yet.

Removing Unknown checks from validation allows Terraform to run evaluation on the final plan that has incorporated variables.

Relations

Closes #45203

References

func (r cloudVmClusterResourceModel) isNetworkIdAndExadataInfraIdPresent() bool {
return !r.OdbNetworkId.IsNull() && !r.OdbNetworkId.IsUnknown() && !r.CloudExadataInfrastructureId.IsNull() && !r.CloudExadataInfrastructureId.IsUnknown()
}
func (r cloudVmClusterResourceModel) isNetworkARNAndExadataInfraARNPresent() bool {
return !r.OdbNetworkArn.IsNull() && !r.OdbNetworkArn.IsUnknown() && !r.CloudExadataInfrastructureArn.IsNull() && !r.CloudExadataInfrastructureArn.IsUnknown()
}
func (r cloudVmClusterResourceModel) isNetworkARNAndIdPresent() bool {
return (!r.OdbNetworkId.IsNull() && !r.OdbNetworkId.IsUnknown()) && (!r.OdbNetworkArn.IsNull() && !r.OdbNetworkArn.IsUnknown())
}
func (r cloudVmClusterResourceModel) isExadataInfraARNAndIdPresent() bool {
return (!r.CloudExadataInfrastructureId.IsNull() && !r.CloudExadataInfrastructureId.IsUnknown()) && (!r.CloudExadataInfrastructureArn.IsNull() && !r.CloudExadataInfrastructureArn.IsUnknown())
}

Output from Acceptance Testing

Before

% make testacc TESTARGS='-run=TestAccODBCloudVmCluster_variables' PKG=odb

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 b-odb_vm_cluster_validation 🌿...
TF_ACC=1 go1.24.10 test ./internal/service/odb/... -v -count 1 -parallel 20  -run=TestAccODBCloudVmCluster_variables -timeout 360m -vet=off
2025/11/21 11:10:27 Creating Terraform AWS Provider (SDKv2-style)...
2025/11/21 11:10:27 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccODBCloudVmCluster_variables
=== PAUSE TestAccODBCloudVmCluster_variables
=== CONT  TestAccODBCloudVmCluster_variables
    cloud_vm_cluster_test.go:349: Step 1/1 error: Error running non-refresh plan: exit status 1

        Error: creating AWS Oracle Database@AWS Cloud Vm Cluster ("Ofake-vmc-2569224526035348859"): either odb_network_id & cloud_exadata_infrastructure_id combination or odb_network_arn & cloud_exadata_infrastructure_arn combination must present. neither is present

          with aws_odb_cloud_vm_cluster.test,
          on terraform_plugin_test.tf line 24, in resource "aws_odb_cloud_vm_cluster" "test":
          24: resource "aws_odb_cloud_vm_cluster" "test" {

        either odb_network_id & cloud_exadata_infrastructure_id combination or
        odb_network_arn & cloud_exadata_infrastructure_arn combination must present.
        neither is present
--- FAIL: TestAccODBCloudVmCluster_variables (1.22s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/odb	8.744s
FAIL
make: *** [testacc] Error 1
...

After

% make testacc TESTARGS='-run=TestAccODBCloudVmCluster_variables' PKG=odb

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 b-odb_vm_cluster_validation 🌿...
TF_ACC=1 go1.24.10 test ./internal/service/odb/... -v -count 1 -parallel 20  -run=TestAccODBCloudVmCluster_variables -timeout 360m -vet=off
2025/11/21 11:13:14 Creating Terraform AWS Provider (SDKv2-style)...
2025/11/21 11:13:14 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccODBCloudVmCluster_variables
=== PAUSE TestAccODBCloudVmCluster_variables
=== CONT  TestAccODBCloudVmCluster_variables
--- PASS: TestAccODBCloudVmCluster_variables (5.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/odb	13.379s

@github-actions
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/odb Issues and PRs that pertain to the odb service. size/XS Managed by automation to categorize the size of a PR. labels Nov 21, 2025
@johnsonaj johnsonaj added the bug Addresses a defect in current functionality. label Nov 21, 2025
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Nov 21, 2025
@johnsonaj johnsonaj marked this pull request as ready for review November 21, 2025 17:20
@johnsonaj johnsonaj requested a review from a team as a code owner November 21, 2025 17:20
jar-b
jar-b previously approved these changes Nov 21, 2025
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jar-b jar-b added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Nov 21, 2025
@johnsonaj johnsonaj merged commit ee5b715 into main Nov 21, 2025
61 checks passed
@johnsonaj johnsonaj deleted the b-odb_vm_cluster_validation branch November 21, 2025 18:30
@github-actions
Copy link
Contributor

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v6.23.0 milestone Nov 21, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request Nov 21, 2025
@github-actions
Copy link
Contributor

This functionality has been released in v6.22.1 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/odb Issues and PRs that pertain to the odb service. size/M Managed by automation to categorize the size of a PR. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

odb: Validation on arguments causes error when using variables

2 participants