From c68d9c4ae0ba4c1faf8010cefef61041cce38e03 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Thu, 20 Aug 2015 10:32:34 -0500 Subject: [PATCH 1/2] provider/aws: Allow Instance to be computed in EIPs --- builtin/providers/aws/resource_aws_eip.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/providers/aws/resource_aws_eip.go b/builtin/providers/aws/resource_aws_eip.go index 4729af537..5dabe9fc0 100644 --- a/builtin/providers/aws/resource_aws_eip.go +++ b/builtin/providers/aws/resource_aws_eip.go @@ -30,13 +30,13 @@ func resourceAwsEip() *schema.Resource { "instance": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "network_interface": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ConflictsWith: []string{"instance"}, + Type: schema.TypeString, + Optional: true, + Computed: true, }, "allocation_id": &schema.Schema{ From 9d973f127913a5f9a1f82973d6e0898f3be64240 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Thu, 8 Oct 2015 09:20:51 -0500 Subject: [PATCH 2/2] document limitation of instance id / network interface id --- website/source/docs/providers/aws/r/eip.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/source/docs/providers/aws/r/eip.html.markdown b/website/source/docs/providers/aws/r/eip.html.markdown index dd44391be..11692a4e9 100644 --- a/website/source/docs/providers/aws/r/eip.html.markdown +++ b/website/source/docs/providers/aws/r/eip.html.markdown @@ -27,6 +27,11 @@ The following arguments are supported: * `instance` - (Optional) EC2 instance ID. * `network_interface` - (Optional) Network interface ID to associate with. +~> **NOTE:** You can specify either the `instance` ID or the `network_interface` ID, +but not both. Including both will **not** return an error from the AWS API, but will +have undefined behavior. See the relevant [AssociateAddress API Call][1] for +more information. + ## Attributes Reference The following attributes are exported: @@ -36,3 +41,5 @@ The following attributes are exported: * `instance` - Contains the ID of the attached instance. * `network_interface` - Contains the ID of the attached network interface. + +[1]: http://docs.aws.amazon.com/fr_fr/AWSEC2/latest/APIReference/API_AssociateAddress.html