From 077a3c364b1e9799d51f208b16b0b2afc4127286 Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Mon, 29 Aug 2016 11:40:34 -0700 Subject: [PATCH] Update app dev framework with multi-region support When security rules were applied they were were applied to the environment's Heat stack. Now they are applied to each region's stack application instances belong in. Change-Id: Ia94cf24bcf517af7db57117f86c7b802423f81df --- .../Classes/component.yaml | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/meta/io.murano.applications/Classes/component.yaml b/meta/io.murano.applications/Classes/component.yaml index 6e19acaf..1bf4fabf 100644 --- a/meta/io.murano.applications/Classes/component.yaml +++ b/meta/io.murano.applications/Classes/component.yaml @@ -362,11 +362,26 @@ Methods: Contract: $.class(ServerGroup).notNull() Body: - $sr: $this.getSecurityRules() - - $env: $this.find(std:Environment) - - If: $sr and $env + - If: $sr Then: - - $env.securityGroupManager.addGroupIngress($sr) - - $env.stack.push() + - $regions: $servers.select($.getRegion()).distinct() + - $regions.pselect($this._configureSecurityGroup($, $sr)) + + _configureSecurityGroup: + Usage: Static + Arguments: + - region: + Contract: $.class(std:CloudRegion).notNull() + - rules: + Contract: + - FromPort: $.int().notNull() + ToPort: $.int().notNull() + IpProtocol: $.string().notNull() + External: $.bool().notNull() + Ethertype: $.string().check($ in list(null, 'IPv4', 'IPv6')) + Body: + - $region.securityGroupManager.addGroupIngress($rules) + - $region.stack.push() getSecurityRules: Body: