|
|
|
|
@ -36,7 +36,7 @@ func resourceAwsVpnGateway() *schema.Resource {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resourceAwsVpnGatewayCreate(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
createOpts := &ec2.CreateVPNGatewayInput{
|
|
|
|
|
AvailabilityZone: aws.String(d.Get("availability_zone").(string)),
|
|
|
|
|
@ -60,7 +60,7 @@ func resourceAwsVpnGatewayCreate(d *schema.ResourceData, meta interface{}) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
resp, err := conn.DescribeVPNGateways(&ec2.DescribeVPNGatewaysInput{
|
|
|
|
|
VPNGatewayIDs: []*string{aws.String(d.Id())},
|
|
|
|
|
@ -107,7 +107,7 @@ func resourceAwsVpnGatewayUpdate(d *schema.ResourceData, meta interface{}) error
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
if err := setTagsSDK(conn, d); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
@ -119,7 +119,7 @@ func resourceAwsVpnGatewayUpdate(d *schema.ResourceData, meta interface{}) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resourceAwsVpnGatewayDelete(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
// Detach if it is attached
|
|
|
|
|
if err := resourceAwsVpnGatewayDetach(d, meta); err != nil {
|
|
|
|
|
@ -153,7 +153,7 @@ func resourceAwsVpnGatewayDelete(d *schema.ResourceData, meta interface{}) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resourceAwsVpnGatewayAttach(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
if d.Get("vpc_id").(string) == "" {
|
|
|
|
|
log.Printf(
|
|
|
|
|
@ -198,7 +198,7 @@ func resourceAwsVpnGatewayAttach(d *schema.ResourceData, meta interface{}) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func resourceAwsVpnGatewayDetach(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
conn := meta.(*AWSClient).ec2SDKconn
|
|
|
|
|
conn := meta.(*AWSClient).ec2conn
|
|
|
|
|
|
|
|
|
|
// Get the old VPC ID to detach from
|
|
|
|
|
vpcID, _ := d.GetChange("vpc_id")
|
|
|
|
|
|