Closed yugandhar-btc closed 1 year ago
Hi @yugandhar-btc Thank you for reporting. Can you please provide a minimum reproducible code sample please?
LMK, if you are trying to combine a module code module "mysql-test"
and a resource code (https://github.com/terraform-google-modules/terraform-docs-samples/blob/main/cloud_sql/instance_ssl_cert/main.tf#L18-L29).
Thank you for the resonance and yes @msampathkumar , I would trying to combine my code module "mysql-test"
to https://github.com/terraform-google-modules/terraform-docs-samples/blob/main/cloud_sql/instance_ssl_cert/main.tf#L18-L29 and my tf configuration file( main.tf
) was provided above.
Thank you for your response @yugandhar-btc
I hope you have understood the issues now. If so, you can ignore the content below.
Modules and Resources are completely different. To put simply, Resources are like building blocks and Modules are concept-specific ready-made infra-automation tools. So combining two different items will not work.
When using a module, I would strictly limit the definition of the module, as you can find it here @ https://github.com/terraform-google-modules/terraform-google-sql-db/tree/v14.1.0/modules/safer_mysql#inputs
While modules are built based on lots of observations, consideration and management, IMO, they are not a perfect fit for every case. In your case, I believe you want ssl
to be disabled. If so, I have the following recommendations.
(My humble recommendation) Take a copy(or fork) of the module https://github.com/terraform-google-modules/terraform-google-sql-db/tree/v14.1.0/modules/safer_mysql and customise it according to your requirements.
Raise a feature request to https://github.com/terraform-google-modules/terraform-google-sql-db with clear details & preferably with an example.
If you have still doubts on this, please re-open this issue.
TL;DR
Iam trying to enforce SSL/TLS encryption to my mysql_instance and I have followed this code spinet instance_ssl_cert and terraform is failed run in all stated ( plan,validate & appy)
Expected behavior
No response
Observed behavior
Step #2 - "Validate": │ Error: Unsupported block type Step #2 - "Validate": │ Step #2 - "Validate": │ on main.tf line 99, in module "XXXXX": Step #2 - "Validate": │ 99: settings { Step #2 - "Validate": │ Step #2 - "Validate": │ Blocks of type "settings" are not expected here.
Terraform Configuration
Terraform Version
Additional information
No response