in samcli/commands/delete/delete_context.py [0:0]
def s3_prompts(self):
"""
Guided prompts asking user to delete s3 artifacts
"""
# Note: s3_bucket and s3_prefix information is only
# available if it is provided as an option flag, a
# local toml file or if this information is obtained
# from the template resources and so if this
# information is not found, warn the user that S3 artifacts
# will need to be manually deleted.
if not self.no_prompts and self.s3_bucket:
if self.s3_prefix:
self.delete_artifacts_folder = confirm(
click.style(
"\tAre you sure you want to delete the folder"
f" {self.s3_prefix} in S3 which contains the artifacts?",
bold=True,
),
default=False,
)
if not self.delete_artifacts_folder:
LOG.debug("S3 prefix not present or user does not want to delete the prefix folder")
self.delete_cf_template_file = confirm(
click.style(
"\tDo you want to delete the template file" + f" {self.cf_template_file_name} in S3?", bold=True
),
default=False,
)
elif self.s3_bucket:
if self.s3_prefix:
self.delete_artifacts_folder = True
else:
self.delete_cf_template_file = True