You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1005 B
33 lines
1005 B
import boto3
|
|
import zipfile
|
|
|
|
################################################################################################
|
|
#
|
|
# Configuration Parameters
|
|
#
|
|
################################################################################################
|
|
|
|
region = 'eu-central-1'
|
|
functionName = 'cloudcomp-counter-lambda-demo'
|
|
roleName = 'arn:aws:iam::309000625112:role/service-role/cloudcomp-counter-demo-role-6rs7pah3'
|
|
|
|
|
|
################################################################################################
|
|
#
|
|
# boto3 code
|
|
#
|
|
################################################################################################
|
|
|
|
|
|
client = boto3.setup_default_session(region_name=region)
|
|
lClient = boto3.client('lambda')
|
|
|
|
|
|
print("Deleting old function...")
|
|
print("------------------------------------")
|
|
try:
|
|
response = lClient.delete_function(
|
|
FunctionName=functionName,
|
|
)
|
|
except lClient.exceptions.ResourceNotFoundException:
|
|
print('Function not available. No need to delete it.')
|