in chalice/deploy/sweeper.py [0:0]
def _determine_s3_event(self, name, resource_values):
# type: (str, Dict[str, str]) -> Optional[str]
# Special case, we have to check the resource values
# to see if they've changed. For s3 events, the resource
# name is not tied to the bucket, which means if you change
# the bucket, the resource name will stay the same.
# So we match up the bucket referenced in the instruction
# and the bucket recorded in the deployed values match up.
# If they don't then we need to clean up the bucket config
# referenced in the deployed values.
bucket = [instruction for instruction in self.marked[name]
if instruction.name == 'bucket' and
isinstance(instruction,
models.RecordResourceValue)][0]
if bucket.value != resource_values['bucket']:
return name
return None