-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
backend/cos: Add TencentCloud backend cos with lock #22540
Conversation
Test PASS
Test detail |
@pselle why closed? |
@likexian I am so sorry! This was an accident, but I'm sure that was very jarring. I apologize! |
@pselle Thank you for your reply, never mind. |
Hello, |
@likexian Could you tell me why your PR has been not merged? Is it because you can't guarantee the state consistency of the COS? (Must use consistency store like Dynamodb in AWS to ensure that the state of COS created is consistent with the state of COS queried) |
The state consistency can be ensure. |
Is it because someone handled this PR before, leading the official to think that this PR is in progress? Could you @ the related person to deal with the PR? |
Thank you for your advice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review. I'll be testing this through/building and testing it on TencentCloud next week, and may have more comments then.
"github.com/hashicorp/terraform/helper/schema" | ||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" | ||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" | ||
tag "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag/v20180813" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import looks a bit off -- will investigate, but we use Go modules, and wouldn't want to add code that makes it difficult for us to upgrade to future versions of Go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine! Resolving this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolving to add a non-blocking comment: If you can update this path to be a major version (https://github.com/golang/go/wiki/Modules#why-must-major-version-numbers-appear-in-import-paths) that would be great, but this is not a blocking comment as other imports in the project have the same issue, which we will have to visit when we upgrade to go1.14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this work is valueable, but I have to wait for the sdk team updating the sdk before I can update the import paths. I will update it when ready.
Hello, I was doing some cursory testing and found a bug in this backend that should be resolved, I've filed an issue for this: #24019 Hitting an error by attempting to delete a non-empty workspace results in a lingering state lock, preventing being able to do the destroy or any further operations on the workspace that require a lock (such as an apply) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done a cursory walkthrough of running this backend on Tencent, which included:
- Creating new workspaces
terraform workspace new
- Changing to those workspaces
terraform workspace select
- Building infrastructure in those workspaces (using the null provider, to rule out provider interference). Also used tencent provider to make another bucket, which worked perfectly.
- Deleting workspaces (both with and without objects in them)
The final section led to an open issue, which should be fixed before we are able to merge this backend, in addition to the other comments on this PR.
Additionally, I tried to run the tests on my machine and got access errors like the following:
assert.go:170: ! unexpected error: "failed to create bucket terraform-test-5a20b2e672-1258798060: PUT https://terraform-test-5a20b2e672-1258798060.cos.ap-guangzhou.myqcloud.com/: 403 AccessDenied(Message: Access Denied., RequestId: NWUzODhlM2NfOTcxYzBiMDlfODRmNV9lOGFkODA=, TraceId: OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1NmI1M2E2MTRlY2MzZDhmNmI5MWI1OTA2NzIxMzRkNDExNDJiYWZmM2ExNTVhMjIxMzhjNDI2YWU1MzAwNDViZjRmYTk4YzIxYzU2YzIzZDFlM2RkYWY=)"
I'll add a comment to where I believe one part of this should be updated, but it is unclear how to run these tests without some implied set-up.
The access error is because I have hardcode the appid in tests, which you have commented and I have fixed it. how to test
The |
@likexian Thank you for the other PR resolving the locking issue! I want to warn you, please do not rebase this PR on |
Test results passed, pasting results:
|
* add TencentCloud COS backend for remote state * add vendor of dependence * fixed error not handle and remove default value for prefix argument * get appid from TF_COS_APPID environment variables
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hello,
This PR provides a new backend
cos
that terraform can store state remotely inTencentCloud COS
with locking.About TencentCloud
Tencent Cloud is a secure, reliable and high-performance cloud compute service provided by Tencent. It is the 2st largest Cloud Provider in China.
About TencentCloud COS
Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data and accessible via HTTP/HTTPS protocols.