da8c2348a7
* Skip runtime properties initialization * Fix usage of defaultGroupName property in SecurityGroupManager Co-Authored-By: Stan Lagun <slagun@mirantis.com> Closes-Bug: #1363253 Change-Id: I869f45bf31f8b7480624a5bfb5f3690ccdb9abc4
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
Namespaces:
|
|
=: io.murano.system
|
|
std: io.murano
|
|
|
|
Name: SecurityGroupManager
|
|
|
|
Properties:
|
|
environment:
|
|
Contract: $.class(std:Environment).notNull()
|
|
|
|
defaultGroupName:
|
|
Contract: $.string()
|
|
Default: format('MuranoSecurityGroup-{0}', $.environment.name)
|
|
|
|
Methods:
|
|
addGroupIngress:
|
|
Arguments:
|
|
- rules:
|
|
Contract:
|
|
- FromPort: $.int().notNull()
|
|
ToPort: $.int().notNull()
|
|
IpProtocol: $.string().notNull()
|
|
External: $.bool().notNull()
|
|
- groupName:
|
|
Contract: $.string().notNull()
|
|
Default: $this.defaultGroupName
|
|
Body:
|
|
- $ext_keys:
|
|
true:
|
|
ext_key: remote_ip_prefix
|
|
ext_val: '0.0.0.0/0'
|
|
false:
|
|
ext_key: remote_mode
|
|
ext_val: remote_group_id
|
|
|
|
- $stack: $.environment.stack
|
|
- $template:
|
|
resources:
|
|
$groupName:
|
|
type: 'OS::Neutron::SecurityGroup'
|
|
properties:
|
|
description: format('Composite security group of Murano environment {0}', $.environment.name)
|
|
rules:
|
|
- port_range_min: null
|
|
port_range_max: null
|
|
protocol: icmp
|
|
remote_ip_prefix: '0.0.0.0/0'
|
|
- $.environment.stack.updateTemplate($template)
|
|
|
|
- $ingress: $rules.select(dict(
|
|
port_range_min => $.FromPort,
|
|
port_range_max => $.ToPort,
|
|
protocol => $.IpProtocol,
|
|
$ext_keys.get($.External).ext_key => $ext_keys.get($.External).ext_val
|
|
))
|
|
|
|
- $template:
|
|
resources:
|
|
$groupName:
|
|
type: 'OS::Neutron::SecurityGroup'
|
|
properties:
|
|
rules: $ingress
|
|
- $.environment.stack.updateTemplate($template)
|
|
|
|
|
|
|
|
|
|
|