class AWS::CloudFormation::StackResourceCollection
resource = stack.resources[‘web’]
@example Getting a stack resource by its logical resource id
end
puts resource.resource_type + “ ” + resource.physical_resource_id
stack.resources.each do |resource|
# enumerating all resources for a stack
@example Enumerating stack resources
light-weight hashes of stack resource details.
You can also take a look at {Stack#resource_summaries} for
id, then you should use {CloudFormation#stack_resource}.
If you want to get a {StackResource} by its physical resource
= Other Ways to Get Resource Details
by its logical resource id.
You can enumerate resources, or request a specific resource
This collection represents the resources for a single {Stack}.
= StackResourceCollection
def [] logical_resource_id
-
(StackResource)
- Returns a stack resource with the given
Parameters:
-
logical_resource_id
(String
) --
def [] logical_resource_id StackResource.new(stack, logical_resource_id) end
def _each_item options = {}
def _each_item options = {} options[:stack_name] = stack.name response = client.describe_stack_resources(options) response.stack_resources.each do |details| stack_resource = StackResource.new_from( :describe_stack_resources, details, self, details.logical_resource_id) yield(stack_resource) end end
def initialize stack, options = {}
-
options
(Hash
) -- -
stack
(Stack
) --
def initialize stack, options = {} @stack = stack super end