Last active
October 15, 2015 18:58
-
-
Save imbriaco/5b8540d5a39d91a47111 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dynamic!(:my_security_group, :nat, { | |
:description => 'My Shiny Security Group', | |
:ingress => [ | |
{ | |
:cidr_ip => '0.0.0.0/0', | |
:ip_protocol => 'icmp', | |
:from_port => -1, | |
:to_port => -1 | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SparkleFormation.dynamic(:my_security_group) do |_name, _config = {}| | |
resources("#{_name}_security_group".to_sym) do | |
type 'AWS::EC2::SecurityGroup' | |
::SparkleFormation::SparkleStruct.camel_keys = true | |
[ :ingress, :egress ].each do |dir| | |
next unless _config[dir] | |
_config[dir] = _config[dir].map { |rule| ::SparkleFormation::SparkleStruct.new(rule) } | |
end | |
properties do | |
vpc_id _config[:vpc_id] || ref!(:vpc) | |
group_description _config[:description] | |
security_group_ingress _config[:ingress] | |
security_group_egress _config[:egress] | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SparkleFormation.dynamic(:my_security_group) do |_name, _config = {}| | |
resources("#{_name}_security_group".to_sym) do | |
type 'AWS::EC2::SecurityGroup' | |
properties do | |
vpc_id _config[:vpc_id] || ref!(:vpc) | |
group_description _config[:description] | |
security_group_ingress _config[:ingress] | |
security_group_egress _config[:egress] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment