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

Add support for Azure Database for MySQL - Flexible Server #1245

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

supertrampr
Copy link

@supertrampr supertrampr commented Feb 10, 2023

Description

Fixes #1230.

  • Added new test cases in Terratest to support new Azure MySql Flexible Server resource.
  • Update Azure SDK for GO to the minimum version (v57.1.0) that starts to expose methods for managing new resources; the old Azure MySQL Single Server is still being maintained in newer version of the sdk.
  • Minor changes on documentation at /examples/azure/README.md.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added MySQL Flexible Server tests. [X]
Updated version of azure-sdk-go from 50.2.0 to 57.1.0. [X]

Migration Guide

@denis256
Copy link
Member

Tried to run tests, and noticed that fails TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example


=== RUN   TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z test_structure.go:130: Copied terraform folder /home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example to /tmp/terraform-azure-mysqldb-flexible-example2144364670/project/examples/azure/terraform-azure-mysqldb-flexible-example
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z retry.go:91: terraform [init -upgrade=false]
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: Running command terraform with args [init -upgrade=false]
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: There are some problems with the configuration, described below.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: The Terraform configuration must be valid before initialization so that
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: Terraform can determine which modules and providers need to be installed.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: ╷
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ Error: Invalid validation error message
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │   on variables.tf line 85, in variable "mysql_version":
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │   85:     error_message = "MySQL version for Flexbile Server instance should be 5.7 or 8.0.21"
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ The validation error message must be at least one full sentence starting
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ with an uppercase letter and ending with a period or question mark.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ Your given message will be included as part of a larger Terraform error
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ message, written as English prose. For broadly-shared modules we suggest
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ using a similar writing style so that the overall result will be
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ consistent.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: ╵
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; There are some problems with the configuration, described below.

@supertrampr
Copy link
Author

Tried to run tests, and noticed that fails TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example


=== RUN   TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z test_structure.go:130: Copied terraform folder /home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example to /tmp/terraform-azure-mysqldb-flexible-example2144364670/project/examples/azure/terraform-azure-mysqldb-flexible-example
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z retry.go:91: terraform [init -upgrade=false]
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: Running command terraform with args [init -upgrade=false]
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: There are some problems with the configuration, described below.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: The Terraform configuration must be valid before initialization so that
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: Terraform can determine which modules and providers need to be installed.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: ╷
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ Error: Invalid validation error message
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │   on variables.tf line 85, in variable "mysql_version":
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │   85:     error_message = "MySQL version for Flexbile Server instance should be 5.7 or 8.0.21"
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ The validation error message must be at least one full sentence starting
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ with an uppercase letter and ending with a period or question mark.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ Your given message will be included as part of a larger Terraform error
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ message, written as English prose. For broadly-shared modules we suggest
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ using a similar writing style so that the overall result will be
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: │ consistent.
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: ╵
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z logger.go:66: 
TestValidateAllTerraformModulesOnTerratest/home/circleci/project/examples/azure/terraform-azure-mysqldb-flexible-example 2023-02-14T21:17:44Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; There are some problems with the configuration, described below.

Sorry for the inconvenient! Should be fixed now.
Running on local environment test regarding Flexible Server are working fine, version of terraform is 1.3.9.
Let me know if something else comes up!

@supertrampr
Copy link
Author

@denis256 Let me know if there is anything else that there is need to be done. Unfortunately I cannot trigger any circleci build

@supertrampr
Copy link
Author

Hey @denis256 sorry to disturb you but I was wondering if this PR will be approved or needs further adjustment. Thanks!

@supertrampr
Copy link
Author

Hi @denis256, any update on this?

return &flexibleMySqlServer, nil
}

// GetMySqlFlexibleDBClientE is a helper function that will setup a MySql flexible DB client.
Copy link
Member

Choose a reason for hiding this comment

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

GetMySqlFlexibleServerDBClientE

@denis256
Copy link
Member

Hi, it is still not clear status of this PR:

  • title says [WIP]
  • there are conflicting files which prevent merging
Conflicting files
go.mod
go.sum

@supertrampr supertrampr changed the title [WIP] Add support for Azure Database for MySQL - Flexible Server Add support for Azure Database for MySQL - Flexible Server Aug 10, 2023
@supertrampr
Copy link
Author

Hi, it is still not clear status of this PR:

  • title says [WIP]
  • there are conflicting files which prevent merging
Conflicting files
go.mod
go.sum

Hi @denis256, I have resolved merge conflicts.
I remove [WIP] from the title since tests are passing and no more updates from my side on my branch are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for new Azure Database for MySQL - Flexible Server resource
2 participants