Using sam deploy --guided, the process fails with "Error: S3 Bucket does not exist."
sam deploy --guided --template-file realtime.yaml.Output:
Stack name : askAroundMe-realtime
Region : us-east-1
Confirm changeset : False
Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-kll3li4nzc9r
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {}
Error:
S3 Bucket does not exist.
Provide steps to replicate.
The developer has also renamed the template to template.yaml to avoid the template parameter, with the same result. Then tried after deleting the toml file with the same result.
sam deploy 鈥揼uided
Stack name : askAroundMe-realtime
Region : us-east-1
Confirm changeset : False
Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-kll3li4nzc9r
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {}
Error:
S3 Bucket does not exist.
The sam deployment should create a deployment bucket and complete.
sam --version:Add --debug flag to command you are running
Were you able to figure this out? This is happening to me because I deleted the S3 bucket that SAM created on AWS when I first ran sam deploy --guided, but now it's not recreating that bucket. I'm wondering if there is a way to reset SAM, but deleting the .aws-sam and ~/.aws-sam directories did not work.
Were you able to figure this out? This is happening to me because I deleted the S3 bucket that SAM created on AWS when I first ran
sam deploy --guided, but now it's not recreating that bucket. I'm wondering if there is a way to reset SAM, but deleting the.aws-samand~/.aws-samdirectories did not work.
If this is caused by deleting the S3 bucket, I would suggest just recreating the bucket as a workaround. I'm still interested to know where S3 keeps a reference to the bucket after the configuration, build folder and toml files are deleted.
In addition to the bucket, a sam deployment also creates two cloudformation stacks. One for keeping track of SAM CLI resources, and the other to track the app's resources. Try deleting these as well.
SAM looks up a cloudformation stack with the name aws-sam-cli-managed-default link` first, and then looks for bucket within the output of that stack.
The sam deploy --guided process looks for a CloudFormation stack, rather than the bucket, to decide whether or not to create a new bucket (S3 API doesn't give us a good way to search by tags, for example, and since S3 bucket names need to be globally unique this is the approach we need to take). If you're going to delete the S3 bucket, you'll also need to delete the associated stack.
You can, of course, always provide your own S3 bucket via samconfig.toml or as a parameter to deployments.
Given that this was filed on another developer's behalf, I think the question would be what the contents of the aws-sam-cli-managed-default template are, and if there is a bucket present there and this error persists, please reopen this issue. Otherwise, delete the stack and re-run.
In addition to the bucket, a sam deployment also creates two cloudformation stacks. One for keeping track of SAM CLI resources, and the other to track the app's resources. Try deleting these as well.
this worked for me, thanks
The
sam deploy --guidedprocess looks for a CloudFormation stack, rather than the bucket, to decide whether or not to create a new bucket (S3 API doesn't give us a good way to search by tags, for example, and since S3 bucket names need to be globally unique this is the approach we need to take). If you're going to delete the S3 bucket, you'll also need to delete the associated stack.You can, of course, always provide your own S3 bucket via
samconfig.tomlor as a parameter to deployments.Given that this was filed on another developer's behalf, I think the question would be what the contents of the
aws-sam-cli-managed-defaulttemplate are, and if there is a bucket present there and this error persists, please reopen this issue. Otherwise, delete the stack and re-run.
Okay I see. This is what happened to me:
samsam deploy --guided it told me it had found the necessary resources for deployment. Meaning, it found the stacksam deploy --guided. This recreated the sam deployment bucket and deploy worked.You can, of course, always provide your own S3 bucket via
samconfig.tomlor as a parameter to deployments.
Can someone expand on this? In my case, runing sam deploy --guided, sam appears to disregard a custom bucket already defined in samconfig.toml.
Also running sam deploy when param s3_bucket is defined in samconfig.toml recreates
Error: S3 Bucket does not exist.
It doesn't look too different from this issue
Most helpful comment
In addition to the bucket, a sam deployment also creates two cloudformation stacks. One for keeping track of SAM CLI resources, and the other to track the app's resources. Try deleting these as well.