Skip to main content

stack_resources

Creates, updates, deletes, gets or lists a stack_resources resource.

Overview

Namestack_resources
TypeResource
Idaws.cloudformation.stack_resources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringUser defined description associated with the resource.
drift_informationstringInformation about whether the resource's actual configuration differs, or has drifted, from its expected configuration, as defined in the stack template and any values specified as template parameters. For more information, see Detect unmanaged configuration changes to stacks and resources with drift detection.
last_updated_timestampstringTime the status was updated.
logical_resource_idstringThe logical name of the resource specified in the template.
metadatastringThe content of the Metadata attribute declared for the resource. For more information, see Metadata attribute in the CloudFormation User Guide.
module_infostringContains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
physical_resource_idstringThe name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.
resource_statusstringCurrent status of the resource.
resource_status_reasonstringSuccess/failure message associated with the resource.
resource_typestringType of resource. For more information, see Amazon Web Services resource and property types reference in the CloudFormation User Guide.
stack_idstringUnique identifier of the stack.
stack_namestringThe name associated with the stack.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_stack_resourceselectStackName, LogicalResourceId, regionReturns a description of the specified resource in the specified stack. For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been deleted.
list_stack_resourcesselectStackName, regionNextTokenReturns descriptions of all resources of the specified stack. For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been deleted.
describe_stack_resourcesselectregionStackName, LogicalResourceId, PhysicalResourceIdReturns Amazon Web Services resource descriptions for running and deleted stacks. If StackName is specified, all the associated resources that are part of the stack are returned. If PhysicalResourceId is specified, the associated resources of the stack that the resource belongs to are returned. Only the first 100 resources will be returned. If your stack has more resources than this, you should use ListStackResources instead. For deleted stacks, DescribeStackResources returns resource information for up to 90 days after the stack has been deleted. You must specify either StackName or PhysicalResourceId, but not both. In addition, you can specify LogicalResourceId to filter the returned result. For more information about resources, the LogicalResourceId and PhysicalResourceId, see the CloudFormation User Guide. A ValidationError is returned if you specify both StackName and PhysicalResourceId in the same request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
LogicalResourceIdstringThe logical name of the resource as specified in the template.
StackNamestringThe name or the unique stack ID that is associated with the stack, which aren't always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID.
regionstringAWS region (default: us-east-1)
LogicalResourceIdstringThe logical name of the resource as specified in the template.
NextTokenstringThe token for the next set of items to return. (You received this token from a previous call.)
PhysicalResourceIdstringThe name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation. For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId corresponds to the InstanceId. You can pass the EC2 InstanceId to DescribeStackResources to find which stack the instance belongs to and what other resources are part of the stack. Required: Conditional. If you don't specify PhysicalResourceId, you must specify StackName.
StackNamestringThe name or the unique stack ID that is associated with the stack, which aren't always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. Required: Conditional. If you don't specify StackName, you must specify PhysicalResourceId.

SELECT examples

Returns a description of the specified resource in the specified stack. For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been deleted.

SELECT
description,
drift_information,
last_updated_timestamp,
logical_resource_id,
metadata,
module_info,
physical_resource_id,
resource_status,
resource_status_reason,
resource_type,
stack_id,
stack_name
FROM aws.cloudformation.stack_resources
WHERE StackName = '{{ StackName }}' -- required
AND LogicalResourceId = '{{ LogicalResourceId }}' -- required
AND region = '{{ region }}' -- required
;