Skip to content

Instantly share code, notes, and snippets.

@slyness
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slyness/4978e93e6563e30564ca to your computer and use it in GitHub Desktop.
Save slyness/4978e93e6563e30564ca to your computer and use it in GitHub Desktop.
SparkleFormation array
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