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

Check existing modules for Azure on Terraform Registry #16

Open
9 of 13 tasks
jcorioland opened this issue May 17, 2019 · 15 comments
Open
9 of 13 tasks

Check existing modules for Azure on Terraform Registry #16

jcorioland opened this issue May 17, 2019 · 15 comments
Labels
good first issue Good for newcomers module

Comments

@jcorioland
Copy link
Contributor

jcorioland commented May 17, 2019

There are about 100 modules for Azure registered on the Terraform Registry.

Some of them are a bit outdated, may need some updates or may have stop working. One good first issue for beginners could be to check on those modules and report the one that are not up to date.
By doing that, you will definitely get more familiar with Terraform and modules.

Please find below a suggested list of modules that could be investigated and checked. Feel free to drop a comment to notify others that you are taking one in particular.

You can also browse the Terraform Registry here.

@jcorioland jcorioland added good first issue Good for newcomers module labels May 17, 2019
@ams0
Copy link

ams0 commented May 24, 2019

Manual checking could be time consuming, wonder if it's worth automating the process. There should be tests available for each.

@jcorioland
Copy link
Contributor Author

yeah, this is something I thought about, but it might be tricky.

@grayjeremy
Copy link

is there a way to run terraform side by side? or should we just test against the newest version for issues?

@jcorioland
Copy link
Contributor Author

@grayjeremy that's an interesting question! As terraform is just a binary, I think you can have two of them in your PATH, like terraform11 and terraform12 and just use them like that. Another solution could be to have separate folder and switch in your PATH, but that would not allow running both version at the same time... @grayzu @echuvyrov any suggestion?

@grayjeremy
Copy link

I was able to create a mysql object with the following configuration using terraform version 0.12

module "mysql" {
  source = "foreverXZC/mysql/azurerm"
  db_name = "mydatabase"
  location = "${var.az_region_default}"
  admin_username = "azureuser"
  password = "..."
  resource_group_name = "${var.az_rg_name}"
  sku_name = "GP_Gen5_2"
  sku_family = "Gen5"
  sku_tier = "GeneralPurpose"
  sku_capacity = "2"
}

@grayjeremy
Copy link

So to run these side by side, just download the previous version, put it in a folder on the desktop and reference it by the full path. I didn't mess with the path variable, just did a shift+right click on the downloaded file and "copy as path" to get something like "C:\Users\JEGRA\Desktop\tf 11.14\terraform.exe". The only issue is you will need to run the same TF files in a different directory for different versions. I got the error below.

Terraform doesn't allow running any operations against a state
that was written by a future Terraform version. The state is
reporting it is written by Terraform '0.12.0'

@grayjeremy
Copy link

grayjeremy commented May 29, 2019

In the webapp module, there was an error introduced. A plan works successfully in version 0.11.14, but an error is created in .12.0

An argument named "site_config" is not expected here. Did you mean to define a
block of type "site_config"?

This is likely due to the "Generalized Type System" introduced in 0.12

@jcorioland what should I do here? Log an issue on the original module? Log an issue in our backlog? I'd like to continue to verify before I stop and start fixing stuff.

There is also a second error in this module that exists in both versions.
According to the app service plan docs. When creating a Linux App Service Plan, the reserved field must be set to 'true'. This doesn't exist as an option in the webapp module.

@jcorioland
Copy link
Contributor Author

@grayjeremy excellent! I propose that we track/aggregate all the issues in comments here for now, like you've just done. @grayzu @echuvyrov any suggestion?

@grayjeremy
Copy link

In the redis module, there was an error introduced. A plan works successfully in version 0.11.14, but and error is thrown on plan in 0.12.0

  on .terraform\modules\redis\rahulkhengare-terraform-azurerm-redis-ff49cbd\main.tf line 24, in resource "azurerm_redis_cache" "redis":
  24:   redis_configuration = {}

An argument named "redis_configuration" is not expected here. Did you mean to
define a block of type "redis_configuration"?

This is the 2nd error of this type that I have found.

@grayzu
Copy link
Contributor

grayzu commented May 29, 2019

I'd suggest creating an issue per module in this repo once you have finished your testing. That will be much easier to track.

@grayjeremy
Copy link

grayjeremy commented May 29, 2019

In the functions module, there was an error introduced. A plan works successfully in version 0.11.14, but and error is thrown on plan in 0.12.0

   on .terraform\modules\myfunction\anoff-terraform-azurerm-functionapp-bc17e58\main.tf line 49, in resource "azurerm_function_app" "funcapp":
  49:   site_config               = "${local.site_config}"

An argument named "site_config" is not expected here. Did you mean to define a
block of type "site_config"?

This is the 3rd error that has the same root cause in v.12. I found some prelim stuff that may be related in v.12 that I will come back to later once I start looking into these issues.

hashicorp/terraform-provider-azurerm@9738a21

hashicorp/terraform-provider-azurerm#3210

@grayjeremy
Copy link

Postgres module has an issue in version .11.14 and .12. This may be user error on my part...

module "demo_db" {
  source            = "sjones-sot/database-for-postgres/azurerm"
  resource_group_name = "${var.az_rg_name}"
  location          = "${var.az_region_default}"
  service_name      = "testdb"
  db_admin_password = "${var.az_fake_password}"
  sku_compute_units = 1
}
Error: Missing resource instance key

  on .terraform\modules\demo_db\sjones-sot-terraform-azurerm-database-for-postgres-59b1e13\postgres.tf line 10, in resource "azurerm_postgresql_server" "postgresql_server":  10:   resource_group_name = "${var.resource_group_name == "" ? azurerm_resource_group.resource_group.name : var.resource_group_name}"
Because azurerm_resource_group.resource_group has "count" set, its attributes
must be accessed on specific instances.

For example, to correlate with indices of a referring resource, use:
    azurerm_resource_group.resource_group[count.index]

@grayjeremy
Copy link

grayjeremy commented May 29, 2019

the subnet, vnet, and remote-state-storage modules uses a version constraint that excludes version 0.12.0, referenced below. I had assumed that the version constraint listed was good for versions >= 0.11.1 and < 1.0.0, per this article. This may not be the case. On another note, this module doesn't really seem to add any value to the subnet provider and has no documentation on usage.

terraform {
  required_version = "~> 0.11.1"
}

@grayjeremy
Copy link

@jcorioland consul, vault, cassandra, and subscription-base still need to be verified. I have created seperate, linked issues around the others. I can't update the text of the original issue but it may be nice to title the ones I have already looked over in a separate section. My cousin @grayzu realized this comment string was getting out of hand long before I did. We may want to delete all the comments relating to issues and leave the ones about how to run two versions side by side.

@jcorioland
Copy link
Contributor Author

jcorioland commented May 30, 2019

@grayjeremy thank you so much for your work on that, it's really good insights. And thanks for filling all the issues. I've updated the original issue to transform the list to a tasks list. I propose that even if you have created issues, we keep the comment in the thread for history :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers module
Projects
None yet
Development

No branches or pull requests

4 participants