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

Add optional network_interface_id variable #124

Merged
merged 12 commits into from
Nov 2, 2023
Merged

Add optional network_interface_id variable #124

merged 12 commits into from
Nov 2, 2023

Conversation

gbarna-bd
Copy link
Contributor

what

  • Add optional network_interface_id variable to launch_template

why

  • Allow the attaching of existing network interfaces

references

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.

Hey @gbarna-bd -- this looks good and I think we can move it forward. I made one suggestion and asked for additional clarification on the subnets vs AZs addition. Check those out and let me know your thoughts.

Also, to get this merged we'll need to update our README. Please run the following commands, commit, and push the changes:

make init
make github/init
make readme

variables.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
@gbarna-bd gbarna-bd requested a review from Gowiem October 27, 2023 09:33
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.

One request on removing the default for subnet_ids, but otherwise this looks ready to ship.

variables.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
@Gowiem
Copy link
Member

Gowiem commented Oct 31, 2023

/terratest

@gbarna-bd
Copy link
Contributor Author

Do you need me to rebase (reorder and squash / fixup) my commits?

@Gowiem
Copy link
Member

Gowiem commented Oct 31, 2023

/terratest

@Gowiem
Copy link
Member

Gowiem commented Oct 31, 2023

@gbarna-bd nope, no need to squash. Since we only squash merge that avoids any ugliness in the history in main.

Gowiem
Gowiem previously approved these changes Oct 31, 2023
@Gowiem Gowiem added enhancement New feature or request minor New features that do not break anything labels Oct 31, 2023
@Gowiem
Copy link
Member

Gowiem commented Oct 31, 2023

@gbarna-bd we're seeing the following failure:

CleanShot 2023-10-31 at 13 04 42

We've dealt with this elsewhere, here is an example on how to fix: https://github.com/cloudposse/terraform-aws-lambda-function/pull/46/files

@gbarna-bd
Copy link
Contributor Author

@gbarna-bd we're seeing the following failure:

CleanShot 2023-10-31 at 13 04 42

We've dealt with this elsewhere, here is an example on how to fix: https://github.com/cloudposse/terraform-aws-lambda-function/pull/46/files

Thanks! I've wrapped the for_each in data.subnet_id.this in a ternary condition.

@gbarna-bd gbarna-bd requested a review from Gowiem November 1, 2023 11:18
@max-lobur
Copy link
Contributor

/terratest

@gbarna-bd
Copy link
Contributor Author

Is the failing test something that I can try to run locally?
So far, I've validated the PR with:

cd test
make init && make all

@Gowiem
Copy link
Member

Gowiem commented Nov 1, 2023

@gbarna-bd I haven't run the tests locally in a while as its a bit painful. Maybe @max-lobur can speak to that. Anyway, your error is the following:

CleanShot 2023-11-01 at 11 23 51

Take a look at the example fix that I shared before. You want to create that map of index => subnet_it like they do on this line and provide that as the value to for_each. Terraform is stupid and just can't figure out the graph without annoying workarounds like that.

@gbarna-bd
Copy link
Contributor Author

Replaced tomap() with a map comprehension / expression. Hopefully it works now :-)

@Gowiem
Copy link
Member

Gowiem commented Nov 2, 2023

/terratest

main.tf Outdated Show resolved Hide resolved
@Gowiem
Copy link
Member

Gowiem commented Nov 2, 2023

/terratest

@gbarna-bd
Copy link
Contributor Author

Finally!
Thanks for your help and patience with this one, @Gowiem.

@Gowiem Gowiem merged commit aa3840e into cloudposse:main Nov 2, 2023
9 checks passed
@Gowiem
Copy link
Member

Gowiem commented Nov 2, 2023

@gbarna-bd thanks for your hard work + patience on this one! Should be a release that rolls out 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.

None yet

3 participants