-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix: New lines in modified attributes #76
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
39b7b5c
adding test case for tf11
avnerenv0 3363ef7
got the basics working
avnerenv0 3929877
test case
avnerenv0 4b930d0
putting the tokens option up there
avnerenv0 6f03167
Revert "putting the tokens option up there"
avnerenv0 7d472ae
fixing expected for tf12
avnerenv0 251b038
fixing tf11 tests
avnerenv0 46f4bf9
adding quotes for tf 11
avnerenv0 9c50d16
fixing tf13_14 tests
avnerenv0 aa39a0d
bak change
avnerenv0 b6bf119
Merge branch 'master' into fix-merge-in-merge
avnerenv0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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
18 changes: 18 additions & 0 deletions
18
test/fixture/terraform_11/aws_tags_merge/expected/main.terratag.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,18 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_s3_bucket" "a" { | ||
bucket = "my-another-tf-test-bucket" | ||
|
||
tags = "${merge("${merge( | ||
map("a", "b"), | ||
map("c", "d") | ||
)}", local.terratag_added_main)}" | ||
} | ||
|
||
locals { | ||
terratag_added_main = {"env0_environment_id"="40907eff-cf7c-419a-8694-e1c6bf1d1168","env0_project_id"="43fd4ff1-8d37-4d9d-ac97-295bd850bf94"} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
test/fixture/terraform_11/aws_tags_merge/expected/main.tf.bak
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 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_s3_bucket" "a" { | ||
bucket = "my-another-tf-test-bucket" | ||
|
||
tags = "${merge( | ||
map("a", "b"), | ||
map("c", "d") | ||
)}" | ||
} |
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 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_s3_bucket" "a" { | ||
bucket = "my-another-tf-test-bucket" | ||
|
||
tags = "${merge( | ||
map("a", "b"), | ||
map("c", "d") | ||
)}" | ||
} |
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
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
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
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
32 changes: 32 additions & 0 deletions
32
test/fixture/terraform_12/aws_tags_merge/expected/main.terratag.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,32 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
resource "aws_s3_bucket" "example" { | ||
bucket = "example" | ||
acl = "public-read" | ||
force_destroy = true | ||
|
||
tags = merge(merge( | ||
{ | ||
"Name" = format("%s", var.name) | ||
}, | ||
var.tags | ||
), local.terratag_added_main) | ||
} | ||
|
||
locals { | ||
terratag_added_main = {"env0_environment_id"="40907eff-cf7c-419a-8694-e1c6bf1d1168","env0_project_id"="43fd4ff1-8d37-4d9d-ac97-295bd850bf94"} | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
test/fixture/terraform_12/aws_tags_merge/expected/main.tf.bak
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,27 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
resource "aws_s3_bucket" "example" { | ||
bucket = "example" | ||
acl = "public-read" | ||
force_destroy = true | ||
|
||
tags = merge( | ||
{ | ||
"Name" = format("%s", var.name) | ||
}, | ||
var.tags | ||
) | ||
} |
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,27 @@ | ||
provider "aws" { | ||
version = "~> 2.0" | ||
region = "us-east-1" | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
resource "aws_s3_bucket" "example" { | ||
bucket = "example" | ||
acl = "public-read" | ||
force_destroy = true | ||
|
||
tags = merge( | ||
{ | ||
"Name" = format("%s", var.name) | ||
}, | ||
var.tags | ||
) | ||
} |
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
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
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
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
Oops, something went wrong.
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.
@avnerenv0 is there any special reason why
tf12
scenario/tests are different thantf11
? 🤔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.
just because the interpolation syntax
"${...}"
I wanted to make sure it works as expected