Skip to content

Commit e6e6877

Browse files
author
Brad Sickles
committed
Updating docs and changing state to accept_status.
1 parent 4979fea commit e6e6877

File tree

4 files changed

+71
-10
lines changed

4 files changed

+71
-10
lines changed

builtin/providers/aws/resource_aws_vpc_peering_connection_accept.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func resourceAwsVpcPeeringConnectionAccept() *schema.Resource {
1818
Required: true,
1919
ForceNew: true,
2020
},
21-
"state": &schema.Schema{
21+
"accept_status": &schema.Schema{
2222
Type: schema.TypeString,
2323
Computed: true,
2424
},
@@ -29,32 +29,32 @@ func resourceAwsVpcPeeringConnectionAccept() *schema.Resource {
2929
func resourceAwsVPCPeeringAcceptCreate(d *schema.ResourceData, meta interface{}) error {
3030
conn := meta.(*AWSClient).ec2conn
3131

32-
if cur, ok := d.Get("state").(string); ok && cur == ec2.VpcPeeringConnectionStateReasonCodeActive {
32+
if cur, ok := d.Get("accept_status").(string); ok && cur == ec2.VpcPeeringConnectionStateReasonCodeActive {
3333
// already accepted
3434
return nil
3535
}
3636

37-
state, err := resourceVPCPeeringConnectionAccept(conn, d.Id())
37+
status, err := resourceVPCPeeringConnectionAccept(conn, d.Id())
3838
if err != nil {
3939
return err
4040
}
41-
d.Set("state", state)
41+
d.Set("accept_status", status)
4242

4343
// TODO: should we poll until this resolves? VpcPeeringConnectionStateReasonCodePendingAcceptance
4444

45-
if state != ec2.VpcPeeringConnectionStateReasonCodeActive {
46-
return fmt.Errorf("Error accepting connection, state: %s", state)
45+
if status != ec2.VpcPeeringConnectionStateReasonCodeActive {
46+
return fmt.Errorf("Error accepting connection, state: %s", status)
4747
}
4848
return nil
4949
}
5050

5151
func resourceAwsVPCPeeringAcceptRead(d *schema.ResourceData, meta interface{}) error {
5252
conn := meta.(*AWSClient).ec2conn
53-
_, state, err := resourceAwsVPCPeeringConnectionStateRefreshFunc(conn, d.Id())()
53+
_, status, err := resourceAwsVPCPeeringConnectionStateRefreshFunc(conn, d.Id())()
5454
if err != nil {
5555
return err
5656
}
57-
d.Set("state", state)
57+
d.Set("accept_status", status)
5858
d.SetId(d.Get("peering_connection_id").(string))
5959
return nil
6060
}

website/source/docs/providers/aws/r/vpc_peering.html.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ layout: "aws"
33
page_title: "AWS: aws_vpc_peering_connection"
44
sidebar_current: "docs-aws-resource-vpc-peering"
55
description: |-
6-
Provides an VPC Peering Connection resource.
6+
Provides a VPC Peering Connection resource.
77
---
88

99
# aws\_vpc\_peering\_connection
1010

11-
Provides an VPC Peering Connection resource.
11+
Provides a VPC Peering Connection resource.
1212

1313
## Example Usage
1414

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
layout: "aws"
3+
page_title: "AWS: aws_vpc_peering_connection_accept"
4+
sidebar_current: "docs-aws-resource-vpc-peering-accept"
5+
description: |-
6+
Provides a VPC Peering Connection Accept resource.
7+
---
8+
9+
# aws\_vpc\_peering\_connection\_accept
10+
11+
Provides a VPC Peering Connection Accept resource.
12+
13+
## Example Usage
14+
15+
Basic usage:
16+
17+
```
18+
resource "aws_vpc" "main" {
19+
cidr_block = "10.0.0.0/16"
20+
}
21+
22+
provider "aws" {
23+
// another AWS account creds
24+
access_key = "..."
25+
secret_key = "..."
26+
alias = "peer"
27+
}
28+
29+
resource "aws_vpc" "peer" {
30+
provider = "aws.peer"
31+
cidr_block = "10.1.0.0/16"
32+
}
33+
34+
resource "aws_vpc_peering_connection" "peer" {
35+
vpc_id = "${aws_vpc.main.id}"
36+
peer_vpc_id = "${aws_vpc.peer.id}"
37+
auto_accept = false
38+
}
39+
40+
resource "aws_vpc_peering_connection_accept" "peer" {
41+
provider = "aws.peer"
42+
peering_connection_id = "${aws_vpc_peering_connection.peer.id}"
43+
}
44+
```
45+
46+
## Argument Reference
47+
48+
The following arguments are supported:
49+
50+
* `peering_connection_id` - (Required) The VPC Peering Connection ID to accept.
51+
52+
## Attributes Reference
53+
54+
The following attributes are exported:
55+
56+
* `id` - The ID of the VPC Peering Connection.
57+
* `accept_status` - The Status of the VPC peering connection request.

website/source/layouts/aws.erb

+4
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,10 @@
786786
<a href="/docs/providers/aws/r/vpc_peering.html">aws_vpc_peering_connection</a>
787787
</li>
788788

789+
<li<%= sidebar_current("docs-aws-resource-vpc-peering-accept") %>>
790+
<a href="/docs/providers/aws/r/vpc_peering_accept.html">aws_vpc_peering_connection_accept</a>
791+
</li>
792+
789793
<li<%= sidebar_current("docs-aws-resource-vpn-connection") %>>
790794
<a href="/docs/providers/aws/r/vpn_connection.html">aws_vpn_connection</a>
791795
</li>

0 commit comments

Comments
 (0)