-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: when configuring tflocal for remote s3 state, live AWS is used #16
Comments
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide. |
Hi @torenware, Could you please try using this terraform code and running the terraform {
backend "s3" {
bucket = "mybucket"
key = "terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-state-lock"
endpoint = "http://s3.localhost.localstack.cloud:4566"
iam_endpoint = "http://localhost:4566"
sts_endpoint = "http://localhost:4566"
dynamodb_endpoint = "http://localhost:4566"
}
}
|
This time, it appears that if |
OK, if the lock table appears in the correct region, apply also works. So the terraform.backend block also needs endpoint and *_endpoint arguments? Is this documented anywhere? |
OK, I see it's documented here.. This is however a work-around; tflocal should not be going back to real-world AWS, yes? |
Sorry, I forgot to mention the documentation earlier. As |
Hi @torenware @MarcelStranak . Thanks for sharing the details here. Quick update - we have now pushed a few enhancements for When you get a chance, can you please upgrade to the latest version and give it another try? Thanks!
|
@whummer I'll give it a try later today. Thanks for implementing this! |
@whummer : definitely a problem with the new code. On
You should be able to reproduce this easily using my steps above. |
I've gotten this up in a debugger, and the problem occurs on handling |
Thanks for the update @torenware - this was an oversight in the last implementation, we've now added a fix to address this. Can you please upgrade the pip page (to version |
@whummer The new version works for my file. Looks good. |
@whummer this has been fixed now, yes? Should I close this issue? |
Hi all terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {}
} and I run terraform init with
I have the right perms set for the bucket too. Any help would be greatly appreciated. |
Hello @sakibstark11, kindly report this as a new issue, accompanied by a detailed description of the issue and a reproducible sample. Thank you. |
Thanks. |
Is there an existing issue for this?
Current Behavior
When setting up remote state using dynamoDB and s3, localstack currently behaves as follows:
tflocal init
. This will FAIL, saying that the bucket was not found.tflocal init
again. IT WILL SUCCEED, and moreover, the live S3 bucket on AWS will contain your remote state (including the fake ARN refs to the created objects on localstack).This is behavior is somewhat unexpected :-)
I have a repo containing the demonstration files for anyone who'd like to try this out for themselves.
Expected Behavior
I'd expect
tflocal
to look for the bucket and dynamodb table locally, on the localstack mocked db, and not on live AWS :-)How are you starting LocalStack?
With the
localstack
scriptSteps To Reproduce
How are you starting localstack (e.g.,
bin/localstack
command, arguments, ordocker-compose.yml
)Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: