diff --git a/builtin/providers/aws/resource_aws_vpc_peering_connection.go b/builtin/providers/aws/resource_aws_vpc_peering_connection.go index 8d9711d7b..a8316c114 100644 --- a/builtin/providers/aws/resource_aws_vpc_peering_connection.go +++ b/builtin/providers/aws/resource_aws_vpc_peering_connection.go @@ -13,22 +13,25 @@ import ( func resourceAwsVpcPeeringConnection() *schema.Resource { return &schema.Resource{ Create: resourceAwsVpcPeeringCreate, - Read: resourceAwsVpcPeeringConnectionRead, - Update: nil, + Read: resourceAwsVpcPeeringRead, + Update: resourceAwsVpcPeeringUpdate, Delete: resourceAwsVpcPeeringDelete, Schema: map[string]*schema.Schema{ "peer_owner_id": &schema.Schema{ Type: schema.TypeString, Required: true, + ForceNew: true, }, "peer_vpc_id": &schema.Schema{ Type: schema.TypeString, Required: true, + ForceNew: true, }, "vpc_id": &schema.Schema{ Type: schema.TypeString, Required: true, + ForceNew: true, }, "tags": tagsSchema(), }, @@ -74,7 +77,7 @@ func resourceAwsVpcPeeringCreate(d *schema.ResourceData, meta interface{}) error return nil } -func resourceAwsVpcPeeringConnectionRead(d *schema.ResourceData, meta interface{}) error { +func resourceAwsVpcPeeringRead(d *schema.ResourceData, meta interface{}) error { ec2conn := meta.(*AWSClient).ec2conn pcRaw, _, err := resourceAwsVpcPeeringConnectionStateRefreshFunc(ec2conn, d.Id())() if err != nil { @@ -94,6 +97,19 @@ func resourceAwsVpcPeeringConnectionRead(d *schema.ResourceData, meta interface{ return nil } + +func resourceAwsVpcPeeringUpdate(d *schema.ResourceData, meta interface{}) error { + ec2conn := meta.(*AWSClient).ec2conn + + if err := setTags(ec2conn, d); err != nil { + return err + } else { + d.SetPartial("tags") + } + + return resourceAwsRouteTableRead(d, meta) +} + func resourceAwsVpcPeeringDelete(d *schema.ResourceData, meta interface{}) error { ec2conn := meta.(*AWSClient).ec2conn diff --git a/website/source/docs/providers/aws/r/vpc_peering.html.markdown b/website/source/docs/providers/aws/r/vpc_peering.html.markdown index 9fa2fa60d..59af3c0ca 100644 --- a/website/source/docs/providers/aws/r/vpc_peering.html.markdown +++ b/website/source/docs/providers/aws/r/vpc_peering.html.markdown @@ -48,11 +48,12 @@ The following arguments are supported: * `vpc_id` - (Required) The ID of the requester VPC. * `tags` - (Optional) A mapping of tags to assign to the resource. - -Note: You still have to accept the peering with the aws console, aws-cli or goamz - ## Attributes Reference The following attributes are exported: -* `id` - The ID of the VPC Peering Connection +* `id` - The ID of the VPC Peering Connectiona + + +## Notes +You still have to accept the peering with the aws console, aws-cli or goamz