@staticmethod<EOL><INDENT>def _get_resource_id_from_stack(cfn_client, stack_name, logical_id):<DEDENT>
LOG.debug("<STR_LIT>",<EOL>stack_name, logical_id)<EOL>try:<EOL><INDENT>response = cfn_client.describe_stack_resource(StackName=stack_name, LogicalResourceId=logical_id)<EOL>LOG.debug("<STR_LIT>", response)<EOL>return response["<STR_LIT>"]["<STR_LIT>"]<EOL><DEDENT>except botocore.exceptions.ClientError as ex:<EOL><INDENT>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>", stack_name, logical_id, ex.response)<EOL>raise UserException(str(ex))<EOL><DEDENT>
Given the LogicalID of a resource, call AWS CloudFormation to get physical ID of the resource within
the specified stack.

Parameters
----------
cfn_client
    CloudFormation client provided by AWS SDK

stack_name : str
    Name of the stack to query

logical_id : str
    LogicalId of the resource

Returns
-------
str
    Physical ID of the resource

Raises
------
samcli.commands.exceptions.UserException
    If the stack or resource does not exist