// LocalGatewayRouteTableVpcAssociationState fetches the LocalGatewayRouteTableVpcAssociation and its State
LocalGatewayRouteTableVpcAssociationState fetches the LocalGatewayRouteTableVpcAssociation and its State
// LocalGatewayRouteTableVpcAssociationState fetches the LocalGatewayRouteTableVpcAssociation and its State
func LocalGatewayRouteTableVpcAssociationState(conn *ec2.EC2, localGatewayRouteTableVpcAssociationID string) resource.StateRefreshFunc {
	return func() (interface{}, string, error) {
		input := &ec2.DescribeLocalGatewayRouteTableVpcAssociationsInput{
			LocalGatewayRouteTableVpcAssociationIds: aws.StringSlice([]string{localGatewayRouteTableVpcAssociationID}),
		}
		output, err := conn.DescribeLocalGatewayRouteTableVpcAssociations(input)
		if err != nil {
			return nil, "", err
		}
		var association *ec2.LocalGatewayRouteTableVpcAssociation
		for _, outputAssociation := range output.LocalGatewayRouteTableVpcAssociations {
			if outputAssociation == nil {
				continue
			}
			if aws.StringValue(outputAssociation.LocalGatewayRouteTableVpcAssociationId) == localGatewayRouteTableVpcAssociationID {
				association = outputAssociation
				break
			}
		}
		if association == nil {
			return association, ec2.RouteTableAssociationStateCodeDisassociated, nil
		}
		return association, aws.StringValue(association.State), nil
	}
}
func LocalGatewayRouteTableVpcAssociationState ( conn * ec2 . EC2 , localGatewayRouteTableVpcAssociationID string ) resource . StateRefreshFunc { return func ( ) ( interface { } , string , error ) { input := & ec2 . DescribeLocalGatewayRouteTableVpcAssociationsInput { LocalGatewayRouteTableVpcAssociationIds : aws . StringSlice ( [ ] string { localGatewayRouteTableVpcAssociationID } ) , } output , err := conn . DescribeLocalGatewayRouteTableVpcAssociations ( input ) if err != nil { return nil , " " , err } var association * ec2 . LocalGatewayRouteTableVpcAssociation for _ , outputAssociation := range output . LocalGatewayRouteTableVpcAssociations { if outputAssociation == nil { continue } if aws . StringValue ( outputAssociation . LocalGatewayRouteTableVpcAssociationId ) == localGatewayRouteTableVpcAssociationID { association = outputAssociation break } } if association == nil { return association , ec2 . RouteTableAssociationStateCodeDisassociated , nil } return association , aws . StringValue ( association . State ) , nil } }
LocalGatewayRouteTableVpcAssociationState fetches the LocalGatewayRouteTableVpcAssociation and its State
LocalGatewayRouteTableVpcAssociationState fetches the LocalGatewayRouteTableVpcAssociation and its State