-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[SQL DB, SQL MI] Add minimal_tls_version property for MI and SQL DB #12414
Changes from 3 commits
35b5e3c
9662889
d8a09da
0914271
1d0dd71
0a221dd
11c5c0e
632fe0e
6683435
c595747
7fcc7f7
c8f0e1f
6e396c1
24915a9
218de31
0a06276
4f53792
f9e82ae
859cec2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,9 @@ | |
ComputeModelType, | ||
DatabaseCapabilitiesAdditionalDetails, | ||
ElasticPoolCapabilitiesAdditionalDetails, | ||
FailoverPolicyType | ||
FailoverPolicyType, | ||
SqlServerMinimalTlsVersionType, | ||
SqlManagedInstanceMinimalTlsVersionType | ||
) | ||
|
||
from ._validators import ( | ||
|
@@ -1039,6 +1041,10 @@ def _configure_security_policy_storage_params(arg_ctx): | |
help='Generate and assign an Azure Active Directory Identity for this server' | ||
'for use with key management services like Azure KeyVault.') | ||
|
||
c.argument('minimal_tls_version', | ||
arg_type=get_enum_type(SqlServerMinimalTlsVersionType), | ||
help='The minimal TLS version enforced by the sql server for inbound connections.') | ||
|
||
with self.argument_context('sql server create') as c: | ||
c.argument('location', | ||
arg_type=get_location_type_with_default_from_resource_group(self.cli_ctx)) | ||
|
@@ -1246,6 +1252,10 @@ def _configure_security_policy_storage_params(arg_ctx): | |
arg_type=get_enum_type(ServerConnectionType), | ||
help='The connection type used for connecting to the instance.') | ||
|
||
c.argument('minimal_tls_version', | ||
arg_type=get_enum_type(SqlManagedInstanceMinimalTlsVersionType), | ||
help='The minimal TLS version enforced by the managed instance for inbound connections.') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You already defined this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is the |
||
|
||
c.argument('public_data_endpoint_enabled', | ||
arg_type=get_three_state_flag(), | ||
help='Whether or not the public data endpoint is enabled for the instance.') | ||
|
@@ -1264,6 +1274,7 @@ def _configure_security_policy_storage_params(arg_ctx): | |
'administrator_login', | ||
'administrator_login_password', | ||
'license_type', | ||
'minimal_tls_version', | ||
'virtual_network_subnet_id', | ||
'vcores', | ||
'storage_size_in_gb', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,6 +425,19 @@ class FailoverPolicyType(Enum): | |
manual = 'Manual' | ||
|
||
|
||
class SqlServerMinimalTlsVersionType(Enum): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should have defined this enum in swagger so that it showed up in generated sdk. Then you wouldn't need to define it here. This is what I was asking about on your swagger review. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sorry about that, we have plans to fix it and do it the right way :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, please do :) |
||
tls_1_0 = "1.0" | ||
tls_1_1 = "1.1" | ||
tls_1_2 = "1.2" | ||
|
||
|
||
class SqlManagedInstanceMinimalTlsVersionType(Enum): | ||
tls_1_0 = "1.0" | ||
tls_1_1 = "1.1" | ||
tls_1_2 = "1.2" | ||
no_tls = "None" | ||
|
||
|
||
class ComputeModelType(str, Enum): | ||
|
||
provisioned = "Provisioned" | ||
|
@@ -2294,7 +2307,8 @@ def managed_instance_update( | |
proxy_override=None, | ||
public_data_endpoint_enabled=None, | ||
tier=None, | ||
family=None): | ||
family=None, | ||
minimal_tls_version=None): | ||
''' | ||
Updates a managed instance. Custom update function to apply parameters to instance. | ||
''' | ||
|
@@ -2314,6 +2328,8 @@ def managed_instance_update( | |
storage_size_in_gb or instance.storage_size_in_gb) | ||
instance.proxy_override = ( | ||
proxy_override or instance.proxy_override) | ||
instance.minimal_tls_version = ( | ||
minimal_tls_version or instance.minimal_tls_version) | ||
|
||
instance.sku.name = None | ||
instance.sku.tier = ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_preview=True
to give a sprint time to test the parameter behavior with the following flag?