-
Notifications
You must be signed in to change notification settings - Fork 919
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
Automate Terraform Platform Detection for Lockfile Hashes #4905
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c790cbf
WIP: pull hashes one at a time
Nishnha cb88054
Working terraform architecture type detection
Nishnha bd2c1ce
Working automatic multi-architecture terraform platform detection
Nishnha 01e4ba2
Copy tests from lockfile project, add multiple platforms
Nishnha 0ebe734
Rubocop automatic corrections
Nishnha db9bf82
Stop looking for platforms early if we already found them all
Nishnha a8aeac1
Add comment about ordering of architectures, remove unnecessary metho…
Nishnha d4cadd2
WIP: First optimization pass
Nishnha 437e479
Optimized lockfile architecture detection
Nishnha 6207d49
Fix incorrect lockfile versions in tests
Nishnha b629417
Merge branch 'main' into nishnha/automate-terraform-hashes
Nishnha 646eff8
Rubocop
Nishnha File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
terraform/spec/fixtures/projects/lockfile_multiple_platforms/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
terraform/spec/fixtures/projects/lockfile_multiple_platforms/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
provider "aws" { | ||
region = "us-west-2" | ||
} | ||
|
||
resource "random_pet" "petname" { | ||
length = 5 | ||
separator = "-" | ||
} | ||
|
||
resource "aws_s3_bucket" "sample" { | ||
bucket = random_pet.petname.id | ||
acl = "public-read" | ||
|
||
region = "us-west-2" | ||
} |
13 changes: 13 additions & 0 deletions
13
terraform/spec/fixtures/projects/lockfile_multiple_platforms/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
required_providers { | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.0.0" | ||
} | ||
|
||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 3.37.0, < 3.46.0" | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Whew that's a big one 😄 are there maybe any methods that we can extract out of here to make this a little easier to grok? Happy to take a stab at it (tomorrow) also