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 azurerm_synapse_sql_pool #8095

Merged
merged 5 commits into from
Sep 11, 2020
Merged

Conversation

njuCZ
Copy link
Contributor

@njuCZ njuCZ commented Aug 12, 2020

the third resource of #7406

it needs to take a long time to run test for PointInTime restore (8h according to the doc) and recovery (1 day), so I don't add test case for these two create mode. I have tested it offline and there is no problem

image

(fixes #7406)

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.

Thanks @njuCZ - aside from a few minor comments this looks pretty good

website/docs/r/synapse_sql_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/r/synapse_sql_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/r/synapse_sql_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/r/synapse_sql_pool.html.markdown Outdated Show resolved Hide resolved
@njuCZ
Copy link
Contributor Author

njuCZ commented Aug 13, 2020

@katbyte I have refined my PR, could you please have a look again?

@tombuildsstuff tombuildsstuff modified the milestones: v2.23.0, v2.24.0 Aug 13, 2020
@WodansSon WodansSon dismissed katbyte’s stale review August 20, 2020 06:19

Requested changes have been made.

Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

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

@njuCZ, thanks for pushing the requested changes by @katbyte ... LGTM! 🚀

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hi @njuCZ

Thanks for this PR.

I've taken a look through here and left some comments inline - but this is off to a good start. If we can fix up the comments then we should be able to take another look through here.

Thanks!

"data_encrypted": {
Type: schema.TypeBool,
Optional: true,
},
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a value that'll change in the future:

a) is this defaulted off?
b) is this going to change to on in the future?
c) is this not a ForceNew field like in many other API's?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a) for now, it's default "off"
b) I am sorry that I don't know whether it will change default value in the future
c) it's a updatable field. I don't see similiar fields in other API?


* `create_mode` - (Optional) Specifies how to create the Sql Pool. Valid values are: `Default`, `Recovery` or `PointInTimeRestore`. Must be `Default` to create a new database. Defaults to `Default`.

* `collation` - (Optional) The name of the collation to use with this pool. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
Copy link
Member

Choose a reason for hiding this comment

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

we should default this within Terraform too:

Suggested change
* `collation` - (Optional) The name of the collation to use with this pool. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
* `collation` - (Optional) The name of the collation to use with this pool, only applicable when `create_mode` is set to `Default`. Defaults to `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could not add default value here, the reason is as below

azurerm/internal/services/sql/parse/sql_database.go Outdated Show resolved Hide resolved
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Copy link
Member

Choose a reason for hiding this comment

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

(as below) this should probably be defaulted

I believe we've also got validation for collations somewhere in the codebase we could use 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.

I have added validation. But I think this field should not have default value. Because in "recovery" or "restore" createmode, the "collation" is the same with the sourceDatabase, but not what user input. If there is a default value, it might cause diff in this case.

@njuCZ
Copy link
Contributor Author

njuCZ commented Aug 24, 2020

@tombuildsstuff I have modifed this PR, could you please have a look again?

@ghost ghost removed the waiting-response label Aug 24, 2020
@tombuildsstuff tombuildsstuff modified the milestones: v2.25.0, v2.26.0 Aug 27, 2020
@tombuildsstuff tombuildsstuff modified the milestones: v2.26.0, v2.27.0 Sep 3, 2020
@jackofallops
Copy link
Member

Hi @njuCZ - Is there a reason this is leveraging/updating sql rather than the newer mssql ?

@jackofallops jackofallops modified the milestones: v2.27.0, v2.28.0 Sep 10, 2020
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.

Thanks @njuCZ - LGTM 👍

@katbyte katbyte merged commit 87114b2 into hashicorp:master Sep 11, 2020
katbyte added a commit that referenced this pull request Sep 11, 2020
@njuCZ
Copy link
Contributor Author

njuCZ commented Sep 11, 2020

@jackofallops sorry that I understand the relation between sql and mssql just now. Since this PR has been merged, and only parse function and validation function from sql package is used. I will change to use functions from mssql. This is not breaking change and I will submit follow up PR to do this #8434 . Thanks for your suggestion

@ghost ghost removed the waiting-response label Sep 11, 2020
WodansSon pushed a commit that referenced this pull request Sep 11, 2020
@ghost
Copy link

ghost commented Sep 17, 2020

This has been released in version 2.28.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 = "~> 2.28.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 11, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 11, 2020
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.

Support for [Azure Synapse Analytics]
5 participants