Closed ravitandonrt closed 5 years ago
Hi @ravitandonrt! Thanks for reporting this.
This seems to be the same root problem as #19224, so I'm going to close this one just to consolidate over there.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
Full TF Config: https://github.com/terraform-providers/terraform-provider-oci/tree/master/docs/examples/identity/identity_providers
Debug Output
Error: Reference to undeclared resource
on /Users/ratandon/projects/go/src/github.com/terraform-providers/terraform-provider-oci/docs/examples/identity/identity_providers/idp_group_mapping.tf line 3, in resource "oci_identity_idp_group_mapping" "test_idp_group_mapping": 3: group_id = "${oci_identity_group.group1.id}"
A resource "oci_identity_group" "group1" has not been declared in the root module
The resources in that file
group.tf
got completely skipped due to the two multi-line comments in there, here is the walkthrough: vtity_api_key.api-key1 - terraform.NodeValidatableResource oci_identity_auth_token.auth-token1 - terraform.NodeValidatableResource oci_identity_compartment.compartment1 - terraform.NodeValidatableResource oci_identity_customer_secret_key.customer-secret-key1 - terraform.NodeValidatableResource oci_identity_dynamic_group.dynamic-group-1 - terraform.NodeValidatableResource oci_identity_identity_provider.test_identity_provider - terraform.NodeValidatableResource oci_identity_idp_group_mapping.test_idp_group_mapping - terraform.NodeValidatableResource oci_identity_ui_password.password1 - terraform.NodeValidatableResource oci_identity_user.user1 - terraform.NodeValidatableResource output.auth-token - terraform.NodeApplyableOutput output.compartments - terraform.NodeApplyableOutput output.customer-secret-key - terraform.NodeApplyableOutput output.dynamicGroups - terraform.NodeApplyableOutput output.identity_providers - terraform.NodeApplyableOutput output.idp_group_mappings - terraform.NodeApplyableOutput output.user-api-key - terraform.NodeApplyableOutput output.user-password - terraform.NodeApplyableOutput output.users1 - terraform.NodeApplyableOutput provider.oci - terraform.NodeApplyableProvider var.fingerprint - terraform.NodeRootVariable var.identity_provider_defined_tags_value - terraform.NodeRootVariable var.identity_provider_description - terraform.NodeRootVariable var.identity_provider_freeform_tags - terraform.NodeRootVariable var.identity_provider_metadata - terraform.NodeRootVariable var.identity_provider_metadata_file - terraform.NodeRootVariable var.identity_provider_metadata_url - terraform.NodeRootVariable var.identity_provider_name - terraform.NodeRootVariable var.identity_provider_product_type - terraform.NodeRootVariable var.identity_provider_protocol - terraform.NodeRootVariable var.idp_group_mapping_idp_group_name - terraform.NodeRootVariable var.private_key_path - terraform.NodeRootVariable var.region - terraform.NodeRootVariable var.tenancy_ocid - terraform.NodeRootVariable var.user_ocid - terraform.NodeRootVariableCrash Output
Expected Behavior
Multi-line comments should continue to work as in hcl v1. I noticed that there are tests for different types of comments in there. It would be good to run those tests against hcl v2.
https://github.com/hashicorp/hcl/blob/ef8a98b0bbce4a65b5aa4c368430a80ddc533168/hcl/printer/testdata/comment.golden
Actual Behavior
Most likely the hcl2 parser greedily consumed the rest of the TF config file as part of the multi-line comment, haven't had a change to look at the parser.
On removing the comments, the TF config worked. However, this can break any existing TF configs with multi-line comments in them using / and /
Steps to Reproduce
terraform init
terraform plan
orterraform validate
Additional Context
Our OCI provider does not ship with the terraform v12 alpha and is built locally. It is compiled against go version go1.9.6 darwin/amd64
2018-11-14T17:29:36.874-0800 [DEBUG] plugin: waiting for RPC address: path=/Users/ratandon/.terraform.d/plugins/darwin_amd64/terraform-provider-oci 2018-11-14T17:29:36.892-0800 [DEBUG] plugin.terraform-provider-oci: 2018/11/14 17:29:36 [INFO] terraform-provider-oci 3.6.0
I will also try updating the Go version but that should not have any impact on parsing of TF config from a plugin perspective.
References