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 outpost_arn field to data_source_aws_network_interface #12440

Merged
merged 3 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aws/data_source_aws_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func dataSourceAwsNetworkInterface() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"outpost_arn": {
Type: schema.TypeString,
Computed: true,
},
"vpc_id": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -179,6 +183,7 @@ func dataSourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{})
d.Set("private_ips", flattenNetworkInterfacesPrivateIPAddresses(eni.PrivateIpAddresses))
d.Set("requester_id", eni.RequesterId)
d.Set("subnet_id", eni.SubnetId)
d.Set("outpost_arn", eni.OutpostArn)
d.Set("vpc_id", eni.VpcId)
d.Set("tags", tagsToMap(eni.TagSet))
return nil
Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_network_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestAccDataSourceAwsNetworkInterface_basic(t *testing.T) {
resource.TestCheckResourceAttrSet("data.aws_network_interface.test", "interface_type"),
resource.TestCheckResourceAttrPair("data.aws_network_interface.test", "private_dns_name", "aws_network_interface.test", "private_dns_name"),
resource.TestCheckResourceAttrPair("data.aws_network_interface.test", "subnet_id", "aws_network_interface.test", "subnet_id"),
resource.TestCheckResourceAttr("data.aws_network_interface.test", "outpost_arn", ""),
resource.TestCheckResourceAttrSet("data.aws_network_interface.test", "vpc_id"),
),
},
Expand Down
6 changes: 6 additions & 0 deletions aws/resource_aws_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func resourceAwsNetworkInterface() *schema.Resource {
Default: true,
},

"outpost_arn": {
Type: schema.TypeString,
Computed: true,
},

"description": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -185,6 +190,7 @@ func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
d.Set("private_dns_name", eni.PrivateDnsName)
d.Set("mac_address", eni.MacAddress)
d.Set("private_ip", eni.PrivateIpAddress)
d.Set("outpost_arn", eni.OutpostArn)

if err := d.Set("private_ips", flattenNetworkInterfacesPrivateIPAddresses(eni.PrivateIpAddresses)); err != nil {
return fmt.Errorf("error setting private_ips: %s", err)
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_network_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func TestAccAWSENI_basic(t *testing.T) {
"aws_network_interface.bar", "tags.Name", "bar_interface"),
resource.TestCheckResourceAttr(
"aws_network_interface.bar", "description", "Managed by Terraform"),
resource.TestCheckResourceAttr(
"aws_network_interface.bar", "outpost_arn", ""),
),
},
{
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/network_interface.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Additionally, the following attributes are exported:
* `requester_id` - The ID of the entity that launched the instance on your behalf.
* `security_groups` - The list of security groups for the network interface.
* `subnet_id` - The ID of the subnet.
* `outpost_arn` - The Amazon Resource Name (ARN) of the Outpost.
* `tags` - Any tags assigned to the network interface.
* `vpc_id` - The ID of the VPC.

Expand Down