Last active
August 29, 2015 14:25
-
-
Save slyness/4978e93e6563e30564ca to your computer and use it in GitHub Desktop.
SparkleFormation array
This file contains 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
resources(:my_security_group) do | |
properties do | |
security_group_ingress _array( | |
-> { | |
ip_protocol 'tcp' | |
from_port ref!(:my_from_port) | |
to_port ref!(:my_to_port) | |
source_security_group_id ref!(:important_security_group) | |
}, | |
-> { | |
ip_protocol 'tcp' | |
from_port ref!(:foo_from_port) | |
to_port ref!(:foo_to_port | |
source_security_group_id ref!(:importand_security_group) | |
} | |
) | |
end | |
end | |
Or you can add to an exsiting thing | |
resources(:some_resource) do | |
properties do |current_properties| | |
current_properties.policies += _array( | |
-> { | |
policy_name 'my_fancy_policy' | |
policy_document do | |
statement _array( | |
-> { | |
effect 'Allow' | |
action %w(someaction:*) | |
resource '*' | |
} | |
) | |
end | |
} | |
) | |
end | |
Similar examples are in the doc examples here: | |
http://sparkleformation.github.io/sparkle_formation/UserDocs/README.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment