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

added self_link to hvn, peering and tgw attachment #111

Merged
merged 3 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions docs/data-sources/aws_network_peering.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data "hcp_aws_network_peering" "test" {
- **peer_vpc_region** (String) The region of the peer VPC in AWS.
- **project_id** (String) The ID of the HCP project where the network peering is located. Always matches the HVN's project.
- **provider_peering_id** (String) The peering connection ID used by AWS.
- **self_link** (String) A unique URL identifying the network peering.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/aws_transit_gateway_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ data "hcp_aws_transit_gateway_attachment" "test" {
- **organization_id** (String) The ID of the HCP organization where the transit gateway attachment is located. Always matches the HVN's organization.
- **project_id** (String) The ID of the HCP project where the transit gateway attachment is located. Always matches the HVN's project.
- **provider_transit_gateway_attachment_id** (String) The transit gateway attachment ID used by AWS.
- **self_link** (String) A unique URL identifying the transit gateway attachment.
- **state** (String) The state of the transit gateway attachment.
- **transit_gateway_id** (String) The ID of the user-owned transit gateway in AWS.

Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/hvn.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data "hcp_hvn" "example" {
- **project_id** (String) The ID of the HCP project where the HVN is located.
- **provider_account_id** (String) The provider account ID where the HVN is located.
- **region** (String) The region where the HVN is located.
- **self_link** (String) A unique URL identifying the HVN.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
1 change: 1 addition & 0 deletions docs/resources/aws_network_peering.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ resource "aws_vpc_peering_connection_accepter" "peer" {
- **organization_id** (String) The ID of the HCP organization where the network peering is located. Always matches the HVN's organization.
- **project_id** (String) The ID of the HCP project where the network peering is located. Always matches the HVN's project.
- **provider_peering_id** (String) The peering connection ID used by AWS.
- **self_link** (String) A unique URL identifying the network peering.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
1 change: 1 addition & 0 deletions docs/resources/aws_transit_gateway_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" {
- **organization_id** (String) The ID of the HCP organization where the transit gateway attachment is located. Always matches the HVN's organization.
- **project_id** (String) The ID of the HCP project where the transit gateway attachment is located. Always matches the HVN's project.
- **provider_transit_gateway_attachment_id** (String) The transit gateway attachment ID used by AWS.
- **self_link** (String) A unique URL identifying the transit gateway attachment.
- **state** (String) The state of the transit gateway attachment.

<a id="nestedblock--timeouts"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/resources/hvn.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ resource "hcp_hvn" "example" {
- **organization_id** (String) The ID of the HCP organization where the HVN is located.
- **project_id** (String) The ID of the HCP project where the HVN is located.
- **provider_account_id** (String) The provider account ID where the HVN is located.
- **self_link** (String) A unique URL identifying the HVN.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down
5 changes: 5 additions & 0 deletions internal/provider/data_source_aws_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func dataSourceAwsNetworkPeering() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the network peering.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func dataSourceAwsTransitGatewayAttachment() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the transit gateway attachment.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
5 changes: 5 additions & 0 deletions internal/provider/data_source_hvn.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func dataSourceHvn() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the HVN.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
14 changes: 14 additions & 0 deletions internal/provider/resource_aws_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ func resourceAwsNetworkPeering() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the network peering.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -330,6 +335,15 @@ func setPeeringResourceData(d *schema.ResourceData, peering *networkmodels.Hashi
return err
}

link := newLink(peering.Hvn.Location, PeeringResourceType, peering.ID)
selfLink, err := linkURL(link)
if err != nil {
return err
}
if err := d.Set("self_link", selfLink); err != nil {
return err
}

return nil
}

Expand Down
14 changes: 14 additions & 0 deletions internal/provider/resource_aws_transit_gateway_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func resourceAwsTransitGatewayAttachment() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the transit gateway attachment.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -327,6 +332,15 @@ func setTransitGatewayAttachmentResourceData(d *schema.ResourceData, tgwAtt *net
return err
}

link := newLink(tgwAtt.Location, TgwAttachmentResourceType, tgwAtt.ID)
selfLink, err := linkURL(link)
if err != nil {
return err
}
if err := d.Set("self_link", selfLink); err != nil {
return err
}

return nil
}

Expand Down
14 changes: 14 additions & 0 deletions internal/provider/resource_hvn.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func resourceHvn() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"self_link": {
Description: "A unique URL identifying the HVN.",
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -275,6 +280,15 @@ func setHvnResourceData(d *schema.ResourceData, hvn *networkmodels.HashicorpClou
if err := d.Set("provider_account_id", hvn.ProviderNetworkData.AwsNetworkData.AccountID); err != nil {
return err
}

link := newLink(hvn.Location, HvnResourceType, hvn.ID)
selfLink, err := linkURL(link)
if err != nil {
return err
}
if err := d.Set("self_link", selfLink); err != nil {
return err
}
return nil
}

Expand Down