Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Change supported python versions for the cloudformation-cross-account…
Browse files Browse the repository at this point in the history
… sample lambda_function

ADD: Support for Python 3.8, 3.9, 3.10
DROP: Support for Python 3.6 environments (support for which has been deprecated by AWS)
  • Loading branch information
emoffett committed Aug 4, 2023
1 parent ff1a8e3 commit 20dd5a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import string
import logging
import threading
import requests
import urllib3 # Added by EM
import json
from botocore.credentials import (
AssumeRoleCredentialFetcher,
Expand All @@ -14,6 +14,8 @@
from botocore.exceptions import ClientError


http = urllib3.PoolManager() # Added by EM

cfn_states = {
"failed": ["CREATE_FAILED", "ROLLBACK_IN_PROGRESS", "ROLLBACK_FAILED", "ROLLBACK_COMPLETE", "DELETE_FAILED",
"UPDATE_ROLLBACK_IN_PROGRESS", "UPDATE_ROLLBACK_FAILED", "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS",
Expand Down Expand Up @@ -83,9 +85,8 @@ def send(event, context, response_status, response_data, physical_resource_id, l
}

try:
response = requests.put(response_url,
data=json_response_body,
headers=headers)
response = http.request('PUT', response_url, headers=headers, body=json_response_body)

logger.info("CloudFormation returned status code: " + response.reason)
except Exception as e:
logger.error("send(..) failed executing requests.put(..): " + str(e))
Expand Down

This file was deleted.

0 comments on commit 20dd5a4

Please sign in to comment.