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 support for create instance with eni #10516

Closed
wants to merge 22 commits into from

Conversation

automaticgiant
Copy link
Contributor

@automaticgiant automaticgiant commented Dec 3, 2016

pretty unfamiliar with golang and codebase, but i'll give it a shot. hopefully ppl will help.
hopefully this will finish #1149 for real at some point.

it looks like it's still not set up to send the eni in the request.
idk how to get request logs from the aws go sdk while it's being used by tf, but the sts message i got back is consistent - says I can't use default sg/subnet - it's not taking the eni's sg/subnet.

hard to say whether being in vpc affects it, but i'm not encouraged to set up in a personal aws account to test.

ima keep working on it.

@automaticgiant
Copy link
Contributor Author

i'm pretty sure the important todo bits are in https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_instance.go#L1017 , but i'm not groking it all the way yet.

@automaticgiant
Copy link
Contributor Author

automaticgiant commented Dec 5, 2016

all i have for now is that it seems to work. i think maybe i should add a forcenew for the new instance attribute. not super clear on whether my implementation method (if id set, skip auto stuff - subnet/publicip) is solid. and i guess there is a way to test that it does to aws what it should?

@Ninir
Copy link
Contributor

Ninir commented Dec 5, 2016

Hi @automaticgiant
Thanks for the work here! There are other considerations to integrate on this: conflicts, . I made a work on this here and there is also #7096 for multiple ENIs.

I'll let Terraform team choose how to deal with all of this :)

@automaticgiant
Copy link
Contributor Author

those both look more thorough than mine. i only needed a little bit more functionality. should we try to collaborate on these and turn them into one solid pr?

- Update Terraform’s documentation
@Ninir
Copy link
Contributor

Ninir commented Dec 8, 2016

@automaticgiant Which little functionality did you need? I think I missed it comparing our PRs :)
Let's collaborate, for sure!

@automaticgiant
Copy link
Contributor Author

automaticgiant commented Dec 9, 2016

@Ninir the bit about exposing id from eni creation so you can create one and get the id from it to add to the new ec2 instance

@automaticgiant
Copy link
Contributor Author

automaticgiant commented Dec 9, 2016

should we be organizing related PR conversation in the original issue or any particular place? i think buy-in/guidance/coordination help from core team would be really helpful. we need to get the right people connected and looking at these.
i was kindof selfish and just wanted to fix it for myself, but now i realized i don't want to maintain my own fork so i made a pr without checking existing work.
but we do need to work together and get these related features polished, tested, documented, and merged.
@catsby - i didn't mention mitchell, figured you'd be good first step

@automaticgiant
Copy link
Contributor Author

#7096 #10593 #2998 #10244 and this (#10516) are what I could find that might need coordinated

@automaticgiant
Copy link
Contributor Author

i almost want to use chef-provisioning, but it looks like it's on life-support, so hesitant. need this TF feature.

@Ninir
Copy link
Contributor

Ninir commented Dec 9, 2016

@automaticgiant Ok I got it :) Instead of setting a new attribute, why not getting the id attribute directly?

For sure, this subject needs to be merged asap in order to prevent more and more PRs.
I would also want to add @stack72 to the reviewers/deciders here, and discuss how we can handle this in the better way.

If you want, I can work on the aggregation of everyone works! I might need to add a few acceptance tests :) this will close so much issues / PRs! 😄

@automaticgiant
Copy link
Contributor Author

automaticgiant commented Dec 9, 2016

@Ninir i don't understand the question. could you link to a code line or do a line comment? i just made something that solved my specific problem, however naive it may have been.

do you think we should request an integration branch to pr pieces to?

@Ninir
Copy link
Contributor

Ninir commented Dec 9, 2016

@automaticgiant Well, for instance, you can use aws_network_interface.test.id (i.e. the id attribute) which in your case is also the network_interface_id , since you alias it:

...

resource "aws_network_interface" "test" {
    subnet_id = "${aws_subnet.main.id}"
    private_ips = ["10.0.1.50"]
}
 
output "test" {
    value = "${aws_network_interface.test.id}"
}

Well, I think that we can put pieces together in 2 PRs: one for the network_interface_id addition, and one for network_interfaces for instance!

@automaticgiant
Copy link
Contributor Author

oh! is that the same value? didn't realize that.

if we get HC to do a branch we can pr to, everyone gets credit. not sure how important that is, but don't really want to steal code from PRs without crediting them.

@Ninir
Copy link
Contributor

Ninir commented Dec 13, 2016

Hi @automaticgiant

Yes it is the same value :)
Well, if we want to go for it, letting maintainers merge the most advanced /stable one and close related PRs/issues.

@automaticgiant
Copy link
Contributor Author

automaticgiant commented Dec 16, 2016

@Ninir @freimer @pielu @choosy
would any of you mind pring your changes to my fork, or would any of you rather host this feature integration branch?

* aws/feature/r-instance-net-iface-id: (74 commits)
  - Properly exercise network_interface_id from AWS SDK - Update Terraform’s documentation
  Update CHANGELOG.md
  provider/aws: Forces the api gateway domain name certificates to recreate the resource (hashicorp#10588)
  Update CHANGELOG.md
  provider/aws: FIxed the api_gw_domain_name replace operation (hashicorp#10179)
  Fixed note formatting
  Explicitly say `count` is not supported by modules (hashicorp#10553)
  docs/aws: Fix the discrepencies of the emr_cluster documentation (hashicorp#10578)
  Update CHANGELOG.md
  Service role is not updated on AWS for a CodeDeploy deployment group (hashicorp#9866)
  Update CHANGELOG.md
  provider/datadog hashicorp#9375: Refactor tags to a list instead of a map. (hashicorp#10570)
  Update the Vagrantfile to resolve package update/installation issue. (hashicorp#9783)
  docs/aws: Add iam_server_certificate data source to nav bar (hashicorp#10576)
  Update CHANGELOG.md
  feat/aws: add iam_server_certificate data source (hashicorp#10558)
  provider/azurerm: arm_virtual_machine panic fix
  Update .travis.yml
  provider/aws: Improved the documentation for EMR Cluster (hashicorp#10563)
  provider/azurerm: Do not pass an empty string of license_type to AMR VMs (hashicorp#10564)
  ...

# Conflicts:
#	builtin/providers/aws/resource_aws_instance.go
@pielu
Copy link

pielu commented Dec 20, 2016

@automaticgiant I have pulled your branch and merged with mine, not sure how I can create PR against yours though. Here's the branch. Let me know if there's anything more I could do to move this forward :-)

Hunter Morgan added 11 commits January 6, 2017 09:37
@automaticgiant
Copy link
Contributor Author

@pielu check it out yo automaticgiant#1

@pielu
Copy link

pielu commented Jan 9, 2017

@automaticgiant I think it's sorted out now. Should you need more actions on my side please give me a shout.

@automaticgiant
Copy link
Contributor Author

@Ninir @freimer @choosy
have two merged, mine and @pielu
pls check to see if yours can contribute.
volunteers for tests appreciated! i can start next week, but don't know what i'm doing :D

@freimer
Copy link

freimer commented Jan 25, 2017 via email

@grubernaut
Copy link
Contributor

Closing via #12933

@grubernaut grubernaut closed this Apr 26, 2017
@ghost
Copy link

ghost commented Apr 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants