Skip to content
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

132: add transition_to_archive #144

Merged
merged 8 commits into from
Apr 18, 2024
Merged

132: add transition_to_archive #144

merged 8 commits into from
Apr 18, 2024

Conversation

jgournet
Copy link
Contributor

what

Add transition_to_archive, same as transition_to_ia
Also add 180, 270 and 365 days options

why

See #132

references

closes #132

@jgournet jgournet requested review from a team as code owners April 18, 2024 05:42
@jgournet jgournet requested review from kevcube and Gowiem April 18, 2024 05:42
Gowiem
Gowiem previously requested changes Apr 18, 2024
Copy link
Member

@Gowiem Gowiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgournet this looks good. I'm not sure why the originaly implementor chose to do these types of vars as a list(string), but I can see that you're just copying their pattern so I can't fault you for that!

Please run a tf fmt and then also run our Makefile automation so that we can regenerate the README. Please run the following locally and commit + push the result:

make init
make readme

Thanks!

main.tf Outdated Show resolved Hide resolved
@mergify mergify bot dismissed Gowiem’s stale review April 18, 2024 21:26

This Pull Request has been updated, so we're dismissing all reviews.

@jgournet
Copy link
Contributor Author

Done: ran terraform fmt, make init and make readme
Thanks @Gowiem !
(and yes, having a list was weird too, but it's my first PR with cloudposse ... so definitely not my place to change things :D )

Also: the automated tests fail to startup with this error:

Invalid workflow file: .github/workflows/release-branch.yml#L20
The workflow is not valid. .github/workflows/release-branch.yml (Line: 20, Col: 11): Secret REPO_ACCESS_TOKEN is required, but not provided while calling. .github/workflows/release-branch.yml (Line: 22, Col: 28): Invalid secret, github_access_token is not defined in the referenced workflow.

Am I meant to do something about it ?

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@Gowiem Gowiem added enhancement New feature or request minor New features that do not break anything labels Apr 18, 2024
@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

Aha we're still hitting a formatting issue, but it's in examples/complete. Can you run tf fmt in that dir as well and commit the result?

@jgournet
Copy link
Contributor Author

Pushed the format for examples/complete - thanks for the guidance (and sorry for the time this is taking)
note: but tests are still not running

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

@jgournet we're getting the following error:

TestExamplesComplete 2024-04-18T21:41:22Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: Unsupported argument
│ 
│   on ../../main.tf line 39, in resource "aws_efs_file_system" "default":
│   39:       transition_to_archive = try(var.transition_to_archive[0], null)
│ 
│ An argument named "transition_to_archive" is not expected here.
╵}
    apply.go:15: 
        	Error Trace:	apply.go:15
        	            				examples_complete_test.go:37
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; ╷
        	            	│ Error: Unsupported argument
        	            	│ 
        	            	│   on ../../main.tf line 39, in resource "aws_efs_file_system" "default":
        	            	│   39:       transition_to_archive = try(var.transition_to_archive[0], null)
        	            	│ 
        	            	│ An argument named "transition_to_archive" is not expected here.
        	            	╵}
        	Test:       	TestExamplesComplete

This is likely due to an issue with the wrong provider version. Can you check in on the provider version where this argument was introduced and update our version pinnings to enforce that we're using that version? Be sure to run make init / readme following you changes as that will create changes in the README. Thanks!

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

@jgournet failure in the examples/complete again:

Downloading registry.terraform.io/cloudposse/route53-cluster-hostname/aws 0.13.0 for efs.dns...
╷
│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider
│ hashicorp/aws: no available releases match the given constraints >= 2.0.0,
│ >= 3.0.0, >= 3.71.0, >= 4.9.0, 4.42.0, >= 5.32.0
╵

Sorry, but mind looking into that?

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@jgournet
Copy link
Contributor Author

 │ Error: putting EFS file system (fs-0880fb02c3829e333) lifecycle configuration: BadRequest: The ThroughputMode value for the file system does not support TransitionToArchive. Either change the ThroughputMode value to Elastic or remove the TransitionToArchive parameter.
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "9a99c3ab-4c41-4691-ae42-0a670a3a2c40"
│   },
│   ErrorCode: "BadRequest",
│   Message_: "The ThroughputMode value for the file system does not support TransitionToArchive. Either change the ThroughputMode value to Elastic or remove the TransitionToArchive parameter."
│ }

checking this one

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

That seems like a legit error, but it'd be a painful thing to check prior to runtime @jgournet. Mind changing the examples thoughtput mode and we'll get the tests passing that way?

@jgournet
Copy link
Contributor Author

@Gowiem : I actually removed (with comment) the "transition_to_archive" from the complete example.
=> do you prefer me changing the complete example throughput mode as you mentioned ?

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

No your change was fine @jgournet -- Let's see if they pass this time around 👍

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

/terratest

@Gowiem Gowiem enabled auto-merge (squash) April 18, 2024 22:31
@Gowiem Gowiem merged commit 0d6a38d into cloudposse:main Apr 18, 2024
11 checks passed
@Gowiem
Copy link
Member

Gowiem commented Apr 18, 2024

@jgournet our release workflow for this repo is breaking for some reason... apologies, but the release to the registry will be delayed while we get that sorted out. I'll try to circle back when fixed. Thanks for the hard work on this PR and the back and forth to get it over the line!

@jgournet
Copy link
Contributor Author

Thank you for your help and patience; and guidance !! really appreciated

@aballesta
Copy link

Hello @Gowiem , I hope you are doing fine, Is there any progress in fixing the release workflow? the variable transition_to_archive not exist on v1.1.0 and I was wondering when I could use this feature. Thank you.

@Gowiem
Copy link
Member

Gowiem commented Sep 4, 2024

@aballesta thanks for the ping. I'll try to look into this when I get the chance. It has been a while for sure so thanks for the patience. I'll try to follow up shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support transition_to_archive lifecycle policy
3 participants