terraform-aws-tfstate-backend
terraform-aws-tfstate-backend copied to clipboard
Migrate to AWS provider v4
what
- Replace s3 resources with the latest version of cloudposse/s3_bucket module
- Upgrade AWS provider to V4
why
- Support latest version of AWS provider V4
references
- https://github.com/cloudposse/terraform-aws-tfstate-backend/pull/113#pullrequestreview-929629524
- resolves #111
- overrides #113
migration
@Nuru 's comment above requests inclusion of the explicit warnings about potential data loss. However, I'm not sure where to include it. Also, it'd be only relevant to tfstate bucket since log bucket's force_destroy
isn't set by this module.
mfa_delete
option was also removed because it's not supported in downstream s3-bucket module.
I managed to migrate existing states simply by renaming modules:
% terraform state mv 'module.tfstate.aws_s3_bucket.default[0]' 'module.tfstate.module.tfstate_s3_bucket.aws_s3_bucket.default[0]'
% terraform state mv 'module.tfstate.aws_s3_bucket_public_access_block.default[0]' 'module.tfstate.module.tfstate_s3_bucket.aws_s3_bucket_public_access_block.default[0]'
Haven't tested replication.
Any chance this could get looked at, Cloudposse?
Can this be looked at, please? I think many users are forced to stay with AWS Provider v3 until tfstate backend supports v4 and are waiting for this...
/test all
I skimmed over the code and it looks OK to me. Let's make sure it passes the tests.
I'd like to see a plan of version 0.38.1 vs the changes in this PR. I wonder if we need a migration guide for this ? cc: @Nuru
We also should be graduating this module to 1.0 ASAP.
any update on this?
Well, it failed the bridgecrew and terratest status checks:
- bridgecrew's details page is private and i cannot view the details
- the
test/terratest
action failed due to a missinggo.sum
entry for a golang module.
The test/terratest
action failure is due to commit dfdcbb336d62b430bc2a810f69d5aff37c4d94ac
(tag: 0.31.0
) changing the go.mod
version, but not updating the go.sum
file:
/tmp/tmp.HFcF1wBKsb [ master ]
➜ git show dfdcbb336d6 -- test/src/go.mod test/src/go.sum
commit dfdcbb336d62b430bc2a810f69d5aff37c4d94ac (tag: 0.31.0)
Author: Maxim Mironenko <[email protected]>
Date: Sat Jan 30 21:29:44 2021 +0700
Bc compliance (#81)
* workflows updated
* readme updated, BC compliance checks fixed
diff --git a/test/src/go.mod b/test/src/go.mod
index f54cc98..c33d042 100644
--- a/test/src/go.mod
+++ b/test/src/go.mod
@@ -3,6 +3,6 @@ module github.com/cloudposse/terraform-aws-tfstate-backend
go 1.14
require (
- github.com/gruntwork-io/terratest v0.30.23
+ github.com/gruntwork-io/terratest v0.31.4
github.com/stretchr/testify v1.6.1
)
Once PR https://github.com/cloudposse/terraform-aws-tfstate-backend/pull/116 is merged, this PR branch can be updated to fix the tests.
Edit: It's merged. Please update this PR and I will rerun the tests.
Edit: I merged this repo's default branch into your PR branch.
/test all
Ok so tests are passed. Once this is good to go, just like Erik mentioned, we'll have to release this as a 1.x module version.
To do that, let's do the following (correct me if I'm mistaken).
- Please address unresolved comments
- We will rerun the tests
- Correct tests if they break
- Setup a local module tfstate backend using the current release version
0.38.1
- Apply
0.38.1
- Change the source of the module to this PR branch
rstml:master
- Plan
rstml:master
(future 1.x) - Ensure we can keep the persist the same functionality of the current
0.38.1
in the new1.x
version - Create a migration document in
docs/
to go from0.38.1
-> latest1.x
- Link the migration document from the
README.yaml
- Wait for more feedback from us
- Resolve feedback
- Merge
Are there any updates?
I didn't have time to incorporate @nitrocode 's changes yet. Maybe later this week.
Any updates on the progress?