aws-sdk-databasemigrationservice 1.88.0 → 1.111.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,15 +52,18 @@ module Aws::DatabaseMigrationService
52
52
  self[:region] = options[:region]
53
53
  self[:use_dual_stack] = options[:use_dual_stack]
54
54
  self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
- if self[:use_dual_stack].nil?
56
- raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
- end
58
55
  self[:use_fips] = options[:use_fips]
59
56
  self[:use_fips] = false if self[:use_fips].nil?
60
- if self[:use_fips].nil?
61
- raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
- end
63
57
  self[:endpoint] = options[:endpoint]
64
58
  end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ region: config.region,
63
+ use_dual_stack: config.use_dualstack_endpoint,
64
+ use_fips: config.use_fips_endpoint,
65
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
66
+ }.merge(options))
67
+ end
65
68
  end
66
69
  end
@@ -32,14 +32,14 @@ module Aws::DatabaseMigrationService
32
32
  raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
33
  end
34
34
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
36
- if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
35
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
36
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
37
37
  return Aws::Endpoints::Endpoint.new(url: "https://dms.#{region}.amazonaws.com", headers: {}, properties: {})
38
38
  end
39
- if Aws::Endpoints::Matchers.string_equals?("aws-iso", Aws::Endpoints::Matchers.attr(partition_result, "name"))
39
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso")
40
40
  return Aws::Endpoints::Endpoint.new(url: "https://dms.#{region}.c2s.ic.gov", headers: {}, properties: {})
41
41
  end
42
- if Aws::Endpoints::Matchers.string_equals?("aws-iso-b", Aws::Endpoints::Matchers.attr(partition_result, "name"))
42
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-iso-b")
43
43
  return Aws::Endpoints::Endpoint.new(url: "https://dms.#{region}.sc2s.sgov.gov", headers: {}, properties: {})
44
44
  end
45
45
  return Aws::Endpoints::Endpoint.new(url: "https://dms-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})