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.
Parameters:
-
stack_name
(Optional[StackName], default:
None
)
–
The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:
-
logical_resource_id
(Optional[LogicalResourceId], default:
None
)
–
The logical name of the resource as specified in the template.
Raises:
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
| def describe_stack_resource(
self,
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
stack_name: Optional["capo_cloudformation.types.stack_name.StackName"] = None,
logical_resource_id: Optional[
"capo_cloudformation.types.logical_resource_id.LogicalResourceId"
] = None,
) -> "capo_cloudformation.types.describe_stack_resource_output.DescribeStackResourceOutput":
"""<p>Returns a description of the specified resource in the specified stack.</p> <p>For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been deleted.</p>
Args:
stack_name: <p>The name or the unique stack ID that's 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>
logical_resource_id: <p>The logical name of the resource as specified in the template.</p>
Raises:
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudformation.types.describe_stack_resource_input.DescribeStackResourceInput]",
) -> OperationResponse[
"capo_cloudformation.types.describe_stack_resource_output.DescribeStackResourceOutput"
]:
import capo_cloudformation._operations.cloud_formation.describe_stack_resource
output, http_response = (
capo_cloudformation._operations.cloud_formation.describe_stack_resource.describe_stack_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeStackResource")
)
input_: capo_cloudformation.types.describe_stack_resource_input.DescribeStackResourceInput = {}
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
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|