403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/cfnbootstrap/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/cfnbootstrap/__pycache__/cfn_client.cpython-39.pyc
a

��0i$.�@s�dZddlmZmZddlmZmZddlmZm	Z	m
Z
ddlZddlZddl
Z
ddlZe�d�ZGdd�dej�ZGd	d
�d
e�ZGdd�de�ZdS)
z�
CloudFormation client-related classes

Classes:
CloudFormationClient - an HTTP client that makes API calls against CloudFormation
StackResourceDetail  - detailed information about a StackResource

�)�
aws_client�util)�	CFNSigner�V4Signer)�retry_on_failure�timeout�CredentialsNz
cfn.clientcs�eZdZdZdZddddddd	d
ddd
�
Zd"�fdd�	Zedd��Zedd��Z	e
ejj
d�e�d#dd���Ze
ejj
d�e�d$dd���Ze
ejj
d�e�d%dd���Ze
ejj
d�e�d&dd���Ze
ejj
d�e�d'd d!���Z�ZS)(�CloudFormationClienta�
    Makes API calls against CloudFormation

    Notes:
    - Public methods of this class have a 1-to-1 equivalence to published CloudFormation APIs.
    - Calls are retried internally when appropriate; callers should not retry.

    Attributes:
    _apiVersion - the CloudFormation API version
    _endpoints  - CloudFormation service endpoints differing from the https://cloudformation.<region>.amazonaws.com format

    z
2010-05-15z4https://cloudformation.eu-isoe-west-1.cloud.adc-e.ukz2https://cloudformation.eusc-de-east-1.amazonaws.euz/https://cloudformation.us-iso-east-1.c2s.ic.govz/https://cloudformation.us-iso-west-1.c2s.ic.govz3https://cloudformation.us-isob-east-1.sc2s.sgov.govz3https://cloudformation.us-isob-west-1.sc2s.sgov.govz4https://cloudformation.us-isof-east-1.csp.hci.ic.govz5https://cloudformation.us-isof-south-1.csp.hci.ic.govz2https://cloudformation.cn-north-1.amazonaws.com.cnz6https://cloudformation.cn-northwest-1.amazonaws.com.cn)
zeu-isoe-west-1zeusc-de-east-1z
us-iso-east-1z
us-iso-west-1zus-isob-east-1zus-isob-west-1zus-isof-east-1zus-isof-south-1z
cn-north-1zcn-northwest-1N�	us-east-1cs�|st�|�}n|}|s"|jo(t��|_|jsJ|rB|jrB|jsJtd��|jsj|s^t�|�}|sjtd��|jrvt	�nt
|d�}tt|�j|d|||d�t
�d|�dS)Nz�In order to sign requests, 169.254.169.254 must be accessible or valid credentials must be set. Please ensure your proxy environment variables allow access to 169.254.169.254 (NO_PROXY) or that your credentials have a valid access key and secret key.z(Region is required for AWS V4 SignaturesZcloudformationT)�	proxyinfoz2CloudFormation client initialized with endpoint %s)r	�endpointForRegionZ
access_keyrZis_ec2�using_instance_identityZ
secret_key�
ValueError�regionForEndpointrr�super�__init__�log�debug)�selfZcredentials�url�regionr�endpointZsigner��	__class__��;/usr/lib/python3.9/site-packages/cfnbootstrap/cfn_client.pyr?s*��
�

�zCloudFormationClient.__init__cCs|tjvrtj|Sd|S)Nz'https://cloudformation.%s.amazonaws.com)r	�
_endpoints)�clsrrrrr]s

z&CloudFormationClient.endpointForRegioncCs*t�d|�}|r|�d�St�d|�dS)Nz/https://cloudformation.([\w\d-]+).amazonaws.com�z(Non-standard CloudFormation endpoint: %s)�re�match�groupr�warn)rrr rrrrcs�
z&CloudFormationClient.regionForEndpoint)Zhttp_error_extractorcCs.t�d||�t|jd|d|tjd�|d��S)z~
        Calls DescribeStackResource and returns a StackResourceDetail object.

        Throws an IOError on failure.
        z"Describing resource %s in stack %sZDescribeStackResource�JSON)�Action�LogicalResourceId�ContentType�	StackName�Version��request_credentials)rr�StackResourceDetail�_callr	�_apiVersion)r�logicalResourceId�	stackNamer*rrr�describe_stack_resourcels���z,CloudFormationClient.describe_stack_resource�SUCCESSc	Cs6t�d||||�|jd||||dtjd�|d�dS)zN
        Calls SignalResource.

        Throws an IOError on failure.
        zASignaling resource %s in stack %s with unique ID %s and status %sZSignalResourcer#)r$r%r'ZUniqueIdZStatusr&r(r)N)rrr,r	r-)rr.r/ZuniqueIdZstatusr*rrr�signal_resource~s���z$CloudFormationClient.signal_resourcecCs:t�d||�d|dd�}|js(||d<t|j||d��S)zm
        Calls RegisterListener and returns a Listener object

        Throws an IOError on failure.
        z$Registering listener %s for stack %sZRegisterListenerr#�r$r'r&�
ListenerIdr))rrr
�Listenerr,)r�
stack_name�listener_idr*�paramsrrr�register_listener�s��z&CloudFormationClient.register_listenercCsRt�d||||�d|||dd�}|js0||d<|j||d���}|dddS)	z{
        Calls ElectCommandLeader and returns the listener id of the leader

        Throws an IOError on failure.
        zMAttempting to elect '%s' as leader for stack: %s, command: %s, invocation: %sZElectCommandLeaderr#)r$ZCommandNameZInvocationIdr'r&r4r)ZElectCommandLeaderResponseZElectCommandLeaderResult)rrr
r,�json)rr6Zcommand_nameZ
invocation_idr7r*r8Zresult_datarrr�elect_command_leader�s���
z)CloudFormationClient.elect_command_leadercCspt�d||�d|dd�}|js(||d<|j||d�}|��ddd	}t|d
|d|dtj�|d
��S)zv
        Calls GetListenerCredentials and returns a Credentials object

        Throws an IOError on failure.
        z4Get listener credentials for listener %s in stack %sZGetListenerCredentialsr#r3r4r)ZGetListenerCredentialsResponseZGetListenerCredentialsResultrZAccessKeyIdZSecretAccessKeyZSessionTokenZ
Expiration)rrr
r,r:r�datetime�utcfromtimestamp)rr6r7r*r8�resp�bodyrrr�get_listener_credentials�s,������z-CloudFormationClient.get_listener_credentials)Nr
N)N)r1N)NN)NN)NN)�__name__�
__module__�__qualname__�__doc__r-rr�classmethodrrrr�ClientZ_extract_json_messagerr0r2r9r;r@�
__classcell__rrrrr	#sB
�


r	c@s$eZdZdZdd�Zedd��ZdS)r5zResult of RegisterListenercCs|��dd}|d|_dS)NZRegisterListenerResponseZRegisterListenerResultZQueueUrl)r:�
_queue_url)rr>�resultrrrr�s��zListener.__init__cCs|jS)N)rH�rrrr�	queue_url�szListener.queue_urlN)rArBrCrDr�propertyrKrrrrr5�sr5c@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��ZdS)r+z+Detailed information about a stack resourcecCs�|��ddd}|�d�|_tj�|d�|_|d|_|�d�}|rTt�|�nd|_|�d�|_	|d	|_
|d
|_|�d�|_|�d�|_
|�d
�|_dS)NZDescribeStackResourceResponseZDescribeStackResourceResultr+ZDescriptionZLastUpdatedTimestampr%ZMetadataZPhysicalResourceIdZResourceTypeZResourceStatusZResourceStatusReasonZStackIdr')r:�get�_descriptionr<r=�_lastUpdated�_logicalResourceId�loads�	_metadata�_physicalResourceId�
_resourceType�_resourceStatus�_resourceStatusReason�_stackId�
_stackName)rr>ZdetailZ_rawMetadatarrrr�s(����



zStackResourceDetail.__init__cCs|jS)z"The resource's logical resource ID)rPrJrrrr.�sz%StackResourceDetail.logicalResourceIdcCs|jS)zThe resource's description)rNrJrrr�descriptionszStackResourceDetail.descriptioncCs|jS)zHThe timestamp of this resource's last status change as a datetime object)rOrJrrr�lastUpdatedszStackResourceDetail.lastUpdatedcCs|jS)z?The resource's metadata as python object (not as a JSON string))rRrJrrr�metadata
szStackResourceDetail.metadatacCs|jS)z#The resource's physical resource ID)rSrJrrr�physicalResourceIdsz&StackResourceDetail.physicalResourceIdcCs|jS)zThe resource's type)rTrJrrr�resourceTypesz StackResourceDetail.resourceTypecCs|jS)zThe resource's status)rUrJrrr�resourceStatussz"StackResourceDetail.resourceStatuscCs|jS)z%The reason for this resource's status)rVrJrrr�resourceStatusReason!sz(StackResourceDetail.resourceStatusReasoncCs|jS)z,The ID of the stack this resource belongs to)rWrJrrr�stackId&szStackResourceDetail.stackIdcCs|jS)z.The name of the stack this resource belongs to)rXrJrrrr/+szStackResourceDetail.stackNameN)rArBrCrDrrLr.rYrZr[r\r]r^r_r`r/rrrrr+�s,








r+)rDZcfnbootstraprrZcfnbootstrap.aws_clientrrZcfnbootstrap.utilrrrr<Zloggingrr:Z	getLoggerrrFr	�objectr5r+rrrr�<module>s
9

Youez - 2016 - github.com/yon3zu
LinuXploit