oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
751 stars 672 forks source link

oci_data_safe_* resources coded as procedural not declarative #1859

Closed luckeyca closed 1 week ago

luckeyca commented 1 year ago

Community Note

Terraform Version and Provider Version

Terraform v1.4.5 on linux_amd64

Affected Resource(s)

oci_datasafe*

for example, oci_data_safe_set_user_assessment_baseline and oci_data_safe_unset_user_assessment_baseline

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

n/a

Debug Output

Panic Output

Expected Behavior

terraform is declarative, not procedural. however, autonomous database and multiple data safe related resource are developed and worked like procedural which completely defeats the purpose of terraform and make it cumbersome to use and sometimes impossible to develop into root modules.

Actual Behavior

terraform is declarative, not procedural. however, autonomous database and multiple data safe related resource are developed and worked like procedural which completely defeats the purpose of terraform and make it cumbersome to use and sometimes impossible to develop into root modules.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

psomashe commented 1 year ago

Data Safe and other services do have a few specific use cases where the resources are not purely declarative as they have a few pre-requisites for the resources. However most of the resources are declarative unless for specific use cases as examples below. Please refer to the documentation for the following. https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/data_safe_set_user_assessment_baseline https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/data_safe_unset_user_assessment_baseline

luckeyca commented 1 year ago

Hi @psomashe @ravinitp, could you please clarify what use cases you mentioned that have to deviate from terraform declarative? As far as I can tell, technically terraform is declarative in nature, meaning it's your responsibilities to handling the procedural steps in the terraform resource code, rather than dumping this on end user developers like us. remember a terraform resource block is where we "declare" a given resource's state(all the settings), NOT an action to make something happen(action/procedure).

psomashe commented 1 year ago

Hi @luckeyca, thanks for you feedback. We will reopen this ticket. We had an internal (with in Data Safe and with OCI terraform team) discussion regarding the same after the call we had with you (Data Safe team). We will work on changing this to be declarative.

tf-oci-pub commented 1 year ago

We have notified our service engineer. Our service engineers will get back to you.

skhm1 commented 1 week ago

All the procedural resources of data safe are available as management resources Kindly check the latest version of Terraform available

Search for management resources and you can find multiple resources

Ex: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/data_safe_set_user_assessment_baseline_management

https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/data_safe_unset_user_assessment_baseline_management

monijoshOci commented 1 week ago

Closing this, as issue has been fixed in v6.9.0.