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

New Resource(s)/Data Sources for HDInsights Cluster #3196

Merged
merged 35 commits into from
Apr 9, 2019

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Apr 5, 2019

This PR adds support for HDInsights, in all of its various incarnations - in particular this PR adds the following:

  • Data Source: azurerm_hdinsight_cluster
  • Resource: azurerm_hdinsight_kafka_cluster
  • Resource: azurerm_hdinsight_kbase_cluster
  • Resource: azurerm_hdinsight_hadoop_cluster
  • Resource: azurerm_hdinsight_interactive_query_cluster
  • Resource: azurerm_hdinsight_ml_services_cluster
  • Resource: azurerm_hdinsight_rserver_cluster
  • Resource: azurerm_hdinsight_spark_cluster
  • Resource: azurerm_hdinsight_storm_cluster

The Data Source azurerm_hdinsight_cluster intentionally only exports a subset of fields since there's sufficient differences between the different kinds of HDInsights Cluster that this is both practical and (what I believe) are the relevant fields that most users are likely to need.

Due to the HDInsights API being very pedantic about the result structure - rather than try and ship a single HDInsights Resource (as has been previously attempted in #1267, #924 and #814) this PR introduces separate resources for each "kind" of HDInsights Cluster, due to the number of these the resources in this PR follow a very different structure to other resources.

Remaining Tasks

  • Validation Documentation for the Node password field
  • Validation for the Cluster Version
  • Filing an API bug about the Sku being returned in the incorrect case

Fixes #37

```
=== RUN   TestHDInsightClusterVersionDiffSuppress
=== RUN   TestHDInsightClusterVersionDiffSuppress/empty_name
=== RUN   TestHDInsightClusterVersionDiffSuppress/missing_user_input
=== RUN   TestHDInsightClusterVersionDiffSuppress/missing_api_response
=== RUN   TestHDInsightClusterVersionDiffSuppress/major_minor_user_input
=== RUN   TestHDInsightClusterVersionDiffSuppress/full_version_user_input
--- PASS: TestHDInsightClusterVersionDiffSuppress (0.00s)
    --- PASS: TestHDInsightClusterVersionDiffSuppress/empty_name (0.00s)
    --- PASS: TestHDInsightClusterVersionDiffSuppress/missing_user_input (0.00s)
    --- PASS: TestHDInsightClusterVersionDiffSuppress/missing_api_response (0.00s)
    --- PASS: TestHDInsightClusterVersionDiffSuppress/major_minor_user_input (0.00s)
    --- PASS: TestHDInsightClusterVersionDiffSuppress/full_version_user_input (0.00s)
PASS
```
```
=== RUN   TestHDInsightClusterVersion
=== RUN   TestHDInsightClusterVersion/empty_name
=== RUN   TestHDInsightClusterVersion/major_only
=== RUN   TestHDInsightClusterVersion/major_minor
=== RUN   TestHDInsightClusterVersion/major_minor_large
=== RUN   TestHDInsightClusterVersion/major_minor_build
=== RUN   TestHDInsightClusterVersion/major_minor_build_revision
=== RUN   TestHDInsightClusterVersion/real-world-example
--- PASS: TestHDInsightClusterVersion (0.00s)
    --- PASS: TestHDInsightClusterVersion/empty_name (0.00s)
    --- PASS: TestHDInsightClusterVersion/major_only (0.00s)
    --- PASS: TestHDInsightClusterVersion/major_minor (0.00s)
    --- PASS: TestHDInsightClusterVersion/major_minor_large (0.00s)
    --- PASS: TestHDInsightClusterVersion/major_minor_build (0.00s)
    --- PASS: TestHDInsightClusterVersion/major_minor_build_revision (0.00s)
    --- PASS: TestHDInsightClusterVersion/real-world-example (0.00s)
PASS
```
@tombuildsstuff
Copy link
Contributor Author

Tests pass for Kafka, HBase, Hadoop, ML Services, R Server and Storm

Screenshot 2019-04-08 at 10 20 11

Changes have been pushed for Interactive Query and Spark - running atm

@tombuildsstuff
Copy link
Contributor Author

Tests pass for Interactive Query Clusters:

Screenshot 2019-04-08 at 11 01 55

@tombuildsstuff
Copy link
Contributor Author

HDInsight Spark Cluster tests pass:

Screenshot 2019-04-08 at 12 40 10

@tombuildsstuff
Copy link
Contributor Author

Ignoring a failed assertion (which has been fixed in a follow up commit) the data source tests pass:

Screenshot 2019-04-08 at 20 08 32

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Aside from a couple minor comments LGTM @tombuildsstuff 👍

azurerm/common_hdinsight.go Outdated Show resolved Hide resolved
azurerm/data_source_hdinsight_cluster.go Show resolved Hide resolved
azurerm/helpers/azure/hdinsight.go Show resolved Hide resolved
azurerm/helpers/azure/hdinsight.go Show resolved Hide resolved
@tombuildsstuff tombuildsstuff merged commit b18af3a into master Apr 9, 2019
@tombuildsstuff tombuildsstuff deleted the f/hdinsights branch April 9, 2019 07:16
tombuildsstuff added a commit that referenced this pull request Apr 9, 2019
@ofirshtrull
Copy link

ofirshtrull commented Apr 17, 2019

hi,
I couldnt find in the new configurations,
will there be an option to add cluster configurations like for hive-site.xml
i.e https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-customize-cluster-bootstrap

Thanks

@ghost
Copy link

ghost commented Apr 17, 2019

This has been released in version 1.25.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.25.0"
}
# ... other configuration ...


* `username` - The username used for the Ambari Portal.

* `username` - The password used for the Ambari Portal.
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't be password here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@widgetpl - yes - would you mind opening a new issue for this? thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

@tombuildsstuff done #3287 but should we make docs per cluster type like azurerm_hdinsight_kafka_cluster, azurerm_hdinsight_hadoop_cluster, azurerm_hdinsight_spark_cluster I see there are some small differences?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry I mixed data with resource documentation, everything is in place ;)

@ghost
Copy link

ghost commented May 9, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: HDinsight Cluster Deployment
4 participants