diff --git a/pyproject.toml b/pyproject.toml index 5a9f0c2..8ae4f99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "terraform-worker" -version = "0.10.9" +version = "0.10.10" description = "An orchestration tool for Terraform" authors = [ "Richard Maynard ", diff --git a/tfworker/backends/s3.py b/tfworker/backends/s3.py index 90978bb..73c25f3 100644 --- a/tfworker/backends/s3.py +++ b/tfworker/backends/s3.py @@ -64,6 +64,13 @@ def __init__(self, authenticators, definitions, deployment=None): self._s3_client.head_bucket(Bucket=self._authenticator.bucket) except botocore.exceptions.ClientError as err: err_str = str(err) + if "Forbidden" in err_str: + click.secho( + "Possibly re-using a bucket name? Bucket names should be globally unique.", + fg="red", + ) + click.secho(err, fg="red") + sys.exit(5) if "Not Found" not in err_str: raise err if self._authenticator.create_backend_bucket: @@ -89,6 +96,13 @@ def __init__(self, authenticators, definitions, deployment=None): if "PYTEST_CURRENT_TEST" not in os.environ: click.secho(err_str, fg="red") sys.exit(4) + elif "conflicting conditional operation" in err_str: + click.secho( + "Possibly a recent bucket delete operation in another account has not completed.", + fg="red", + ) + click.secho(err, fg="red") + sys.exit(6) elif "BucketAlreadyOwnedByYou" not in err_str: raise err