cloudstrap-azure 0.6.2.pre → 0.7.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a6db7b5576a1d3f791d713a942f1544b8718a14da6bc1dcf549f00ec790b943
4
- data.tar.gz: f4ecd4d68b973932110bf9dc3a1ed8a93830f55bf9c7c3d890d65f6510689c2c
3
+ metadata.gz: b8157e5960128618648c4da46d2f98d21f896161f40a8bf6b565057b9f251d7a
4
+ data.tar.gz: bd3cf8ea3ac38c8c52c3160c0bf8bbe0c13fe2145d87b68237afd084a759757c
5
5
  SHA512:
6
- metadata.gz: 5538afd73118953d0d8873e22aedfffdae7b46b460061248bed34136dcd088a3812a346b0638d9a84caf24bae161aa251bca1e22d75bed67b2b12621ec4ca713
7
- data.tar.gz: 1d52f8bc49602f8992c70632675f32d30cdc5c40ad921209fbb626881dca158ad0dd76b315ce44ac62526445acac4e09159437b3078e6ebb4f181846d0dff4e9
6
+ metadata.gz: e5279876e16b7b7d1bec27c0622e5ff401cea22d3f8fd032773155f3344dbf3a1bc5fc1c6c0432063c56be3a97770083ed4aa8addbeb670d7c76500358f6cef5
7
+ data.tar.gz: 94b828772c08ea5624244fa05d2fa42001a941305d730c72b0db442a51ade75b825c0eba85464b1eb252b4e93be2ba3d647013e4d003571a6a325ddbb97c080b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -72,7 +72,7 @@ If = ->(predicate, consequent, alternative = Nothing) {
72
72
  predicate.(*arguments) ? consequent.(*arguments) : alternative.(*arguments) } }
73
73
  ApplyIf = ->(predicate, consequent) { If.(predicate, consequent, Itself) }
74
74
 
75
- LONGEST_MESSAGE = 30
75
+ LONGEST_MESSAGE = 36
76
76
 
77
77
  WhileSpinning = lambda do |message, report: nil, &block|
78
78
  Concurrent::IVar.new.tap do |ivar|
@@ -445,22 +445,22 @@ KubernetesMasterSecurityGroup = ->(resource_group) {
445
445
  .list(resource_group.name)
446
446
  .find { |network_security_group| network_security_group.name == name }}}
447
447
 
448
- FindSecurityRule = ->(network_security_group) {
449
- WhileSpinning.("Security Rule Exists", report: :name) {
448
+ FindSecurityRule = ->(network_security_group, port) {
449
+ WhileSpinning.("Security Rule Exists for Port #{port}", report: :name) {
450
450
  network_security_group
451
451
  .security_rules
452
- .find { |security_rule| security_rule.name == Chamber.env.identifier }}}
452
+ .find { |security_rule| security_rule.name == "#{Chamber.env.identifier}-#{port}" }}}
453
453
 
454
- CreateSecurityRule = ->(network_security_group, resource_group) {
455
- WhileSpinning.("Create Security Rule", report: :name) {
454
+ CreateSecurityRule = ->(network_security_group, port, resource_group) {
455
+ WhileSpinning.("Create Security Rule for Port #{port}", report: :name) {
456
456
  AzureAPI::Network::SecurityRules.create_or_update(
457
457
  resource_group.name,
458
458
  network_security_group.name,
459
- Chamber.env.identifier,
459
+ "#{Chamber.env.identifier}-#{port}",
460
460
  AzureAPI::Network::Models::SecurityRule.new.tap { |security_rule|
461
461
  security_rule.access = 'Allow'
462
462
  security_rule.destination_address_prefix = '*'
463
- security_rule.destination_port_ranges = [80,443,4443,2222,2793]
463
+ security_rule.destination_port_ranges = [port]
464
464
  security_rule.direction = AzureAPI::Network::Models::SecurityRuleDirection::Inbound
465
465
  security_rule.priority = network_security_group.security_rules.map(&:priority).max.next
466
466
  security_rule.protocol = 'Tcp'
@@ -564,7 +564,14 @@ public_ip_address = FindPublicIPv4.(resource_group) || Cre
564
564
  container_service = FindContainerService.(resource_group) || CreateContainerService.(service_principal, resource_group)
565
565
 
566
566
  network_security_group = KubernetesMasterSecurityGroup.(resource_group)
567
- security_rule = FindSecurityRule.(network_security_group) || CreateSecurityRule.(network_security_group, resource_group)
567
+
568
+ security_rules = [80,443,4443,2222,2793].map do |port|
569
+ [
570
+ port,
571
+ (FindSecurityRule.(network_security_group, port) || CreateSecurityRule.(network_security_group = KubernetesMasterSecurityGroup.(resource_group), port, resource_group))
572
+ ]
573
+ end.to_h
574
+
568
575
  network_interface = FindNetworkInterface.(resource_group)
569
576
  association = AssociatePublicIP.(resource_group, network_interface, public_ip_address)
570
577
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstrap-azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2.pre
4
+ version: 0.7.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom
@@ -34,7 +34,7 @@ cert_chain:
34
34
  EIKh6yDoB+oCRuiTV0uw/lKE2PtbONhJb7uN1qhZqla/iBpmUjiEu8+skI+ygv9n
35
35
  7Krw8FJrV3+VRCiZTPKHeshAfL9yeIZh
36
36
  -----END CERTIFICATE-----
37
- date: 2018-05-25 00:00:00.000000000 Z
37
+ date: 2018-05-28 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: azure_graph_rbac
metadata.gz.sig CHANGED
Binary file