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

Introduce Oracle Autonomous Database Resource & Data #27696

Merged
merged 50 commits into from
Oct 24, 2024

Conversation

eelhomsi
Copy link
Contributor

@eelhomsi eelhomsi commented Oct 18, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

Introduce Oracle Autonomous Database Resource & Data
Most relevant changes in:
internal/services/oracle/

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Screenshot 2024-10-18 at 10 47 07

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • FEATURES - Introduced new AutonomousDatabaseRegularDataSource and AutonomousDatabaseRegularResource.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

…e-adbs-data-resource

# Conflicts:
#	internal/clients/client.go
#	internal/provider/services.go
#	internal/services/oracledatabase/client/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_generatewallet.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabase.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listprivateipaddresses.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/version.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/client.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_get.go
#	vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/version.go
Comment on lines 127 to 131
lifecycle {
ignore_changes = [
admin_password
]
}
Copy link
Member

Choose a reason for hiding this comment

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

Something we can do is to retrieve the value from the configuration and set it into state in the Read function, I'll leave a comment further up where that should be done.

This should be removed from the tests then.

if !ok {
return fmt.Errorf("%s was not of type `Regular`", id)
}
state.AdminPassword = pointer.From(props.AdminPassword)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
state.AdminPassword = pointer.From(props.AdminPassword)
state.AdminPassword = metadata.ResourceData.Get("admin_password").(string)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
Copy link
Member

Choose a reason for hiding this comment

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

The import step in the tests will fail since we can't retrieve this value from the API. Adding it as an argument here will tell the test to not expect it when we try importing the resource.

Suggested change
data.ImportStep(),
data.ImportStep("admin_password"),

It will probably want to be added to all the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@eelhomsi
Copy link
Contributor Author

New test results here:
Screenshot 2024-10-23 at 16 46 29

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @eelhomsi LGTM ☂️

@stephybun stephybun merged commit a09a5ef into hashicorp:main Oct 24, 2024
33 checks passed
@github-actions github-actions bot added this to the v4.7.0 milestone Oct 24, 2024
stephybun added a commit that referenced this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants