Returns 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:
-
stack_name
(Optional[StackName], default:
None
)
–
The name or the unique stack ID that is associated with the stack, which aren't always interchangeable:
Required: Conditional. If you don't specify StackName, you must specify PhysicalResourceId.
-
logical_resource_id
(Optional[LogicalResourceId], default:
None
)
–
The logical name of the resource as specified in the template.
-
physical_resource_id
(Optional[PhysicalResourceId], default:
None
)
–
The 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.
Raises:
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
| async def describe_stack_resources(
self,
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
stack_name: Optional["capo_cloudformation.types.stack_name.StackName"] = None,
logical_resource_id: Optional[
"capo_cloudformation.types.logical_resource_id.LogicalResourceId"
] = None,
physical_resource_id: Optional[
"capo_cloudformation.types.physical_resource_id.PhysicalResourceId"
] = None,
) -> "capo_cloudformation.types.describe_stack_resources_output.DescribeStackResourcesOutput":
"""<p>Returns Amazon Web Services resource descriptions for running and deleted stacks. If <code>StackName</code> is specified, all the associated resources that are part of the stack are returned. If <code>PhysicalResourceId</code> is specified, the associated resources of the stack that the resource belongs to are returned.</p> <note> <p>Only the first 100 resources will be returned. If your stack has more resources than this, you should use <code>ListStackResources</code> instead.</p> </note> <p>For deleted stacks, <code>DescribeStackResources</code> returns resource information for up to 90 days after the stack has been deleted.</p> <p>You must specify either <code>StackName</code> or <code>PhysicalResourceId</code>, but not both. In addition, you can specify <code>LogicalResourceId</code> to filter the returned result. For more information about resources, the <code>LogicalResourceId</code> and <code>PhysicalResourceId</code>, see the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/">CloudFormation User Guide</a>.</p> <note> <p>A <code>ValidationError</code> is returned if you specify both <code>StackName</code> and <code>PhysicalResourceId</code> in the same request.</p> </note>
Args:
stack_name: <p>The name or the unique stack ID that is associated with the stack, which aren't always interchangeable:</p> <ul> <li> <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p> </li> <li> <p>Deleted stacks: You must specify the unique stack ID.</p> </li> </ul> <p>Required: Conditional. If you don't specify <code>StackName</code>, you must specify <code>PhysicalResourceId</code>.</p>
logical_resource_id: <p>The logical name of the resource as specified in the template.</p>
physical_resource_id: <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p> <p>For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack.</p> <p>Required: Conditional. If you don't specify <code>PhysicalResourceId</code>, you must specify <code>StackName</code>.</p>
Raises:
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudformation.types.describe_stack_resources_input.DescribeStackResourcesInput]",
) -> AsyncOperationResponse[
"capo_cloudformation.types.describe_stack_resources_output.DescribeStackResourcesOutput"
]:
import capo_cloudformation._operations.cloud_formation.describe_stack_resources
(
output,
http_response,
) = await capo_cloudformation._operations.cloud_formation.describe_stack_resources.async_describe_stack_resources(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeStackResources")
)
input_: capo_cloudformation.types.describe_stack_resources_input.DescribeStackResourcesInput = {}
if stack_name is not None:
input_["stack_name"] = stack_name
if logical_resource_id is not None:
input_["logical_resource_id"] = logical_resource_id
if physical_resource_id is not None:
input_["physical_resource_id"] = physical_resource_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|